Wrap NBTTagCompound#setTag in static helper with safeguards against circular references, fixes #299

This commit is contained in:
Electroblob77
2020-01-27 13:45:47 +00:00
parent 6cd6411c25
commit f5da195605
31 changed files with 96 additions and 48 deletions
@@ -1,5 +1,6 @@
package electroblob.wizardry.tileentity;
import electroblob.wizardry.util.NBTExtras;
import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityList;
@@ -152,7 +153,7 @@ public class TileEntityStatue extends TileEntity implements ITickable {
tagCompound.setFloat("entityYawHead", creature.rotationYawHead);
tagCompound.setFloat("entityYawOffset", creature.renderYawOffset);
}
tagCompound.setTag("entity", entityCompound);
NBTExtras.storeTagSafely(tagCompound, "entity", entityCompound);
tagCompound.setInteger("timer", timer);
tagCompound.setInteger("lifetime", lifetime);
tagCompound.setBoolean("isIce", isIce);