added Entity class with position methods

This commit is contained in:
David Vierra 2011-04-16 00:28:55 -10:00
parent 73653c3130
commit f95f6c6795

View File

@ -4056,6 +4056,17 @@ class TileEntity(object):
def setpos(cls, tag, pos):
for a, p in zip('xyz', pos):
tag[a] = TAG_Int(p)
class Entity(object):
@classmethod
def pos(cls, tag):
if "Pos" not in tag:
print tag
return [a.value for a in tag["Pos"]]
@classmethod
def setpos(cls, tag, pos):
tag["Pos"] = TAG_List([TAG_Int(p) for p in pos])
class MCAlphaDimension (MCInfdevOldLevel):
def loadLevelDat(self, create, random_seed, last_played):