Change [Tile]EntityRef.dirty to be consistent with all other dirty flags

I don't like how these are all properties. Most of the usages just set dirty=True, and the only time dirty=False is set is when the chunk is written or the scene node is redrawn.
This commit is contained in:
David Vierra 2015-11-20 06:19:35 -10:00
parent ac5c61a37c
commit 4e55976088
2 changed files with 14 additions and 4 deletions

View File

@ -519,14 +519,14 @@ class FindReplaceNBT(QtCore.QObject):
if tileEntity:
tag = tileEntity.raw_tag()
_replaceInTag(result, tag)
tileEntity.dirty()
tileEntity.dirty = True
if result.resultType == result.EntityResult:
entity = result.getEntity(self.editorSession.currentDimension) # xxx put dimension in result!!!!
if entity:
tag = entity.raw_tag()
_replaceInTag(result, tag)
entity.dirty()
entity.dirty = True
# if result.resultType == result.ItemResult: # xxx
yield

View File

@ -215,8 +215,13 @@ class PCEntityRefBase(object):
return self.__class__(tag)
@property
def dirty(self):
self.chunk.dirty = True
return self.chunk.dirty
@dirty.setter
def dirty(self, value):
self.chunk.dirty = value
@property
def blockTypes(self):
@ -305,8 +310,13 @@ class PCTileEntityRefBase(object):
return self.__class__(tag)
@property
def dirty(self):
self.chunk.dirty = True
return self.chunk.dirty
@dirty.setter
def dirty(self, value):
self.chunk.dirty = value
@property
def blockTypes(self):