Store the caster UUID regardless of whether the entity actually exists, and only read the UUID if it exists in the tag compound
This commit is contained in:
@@ -29,7 +29,7 @@ public class TileEntityPlayerSave extends TileEntity {
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound){
|
||||
super.readFromNBT(tagCompound);
|
||||
casterUUID = tagCompound.getUniqueId("casterUUID");
|
||||
if(tagCompound.hasUniqueId("casterUUID")) casterUUID = tagCompound.getUniqueId("casterUUID");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,7 +37,7 @@ public class TileEntityPlayerSave extends TileEntity {
|
||||
|
||||
super.writeToNBT(tagCompound);
|
||||
|
||||
if(this.getCaster() != null){
|
||||
if(casterUUID != null){
|
||||
tagCompound.setUniqueId("casterUUID", casterUUID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user