ScriptBlock:

-More checks for null tile entities.
This commit is contained in:
Luis C.M committed 2022-11-06 01:36:01 -06:00
1 parent 0291fd44a5
commit 084e6e4149
1 file changed
+6
@@ -119,10 +119,16 @@ public class ScriptBlock implements IBlock {
}
public TileEntity getMCTileEntity() {
if (this.tile == null)
return null;
return this.tile.getMCTileEntity();
}
public INbt getTileEntityNBT() {
if (this.tile == null || this.tile.getMCTileEntity() == null)
return null;
NBTTagCompound compound = new NBTTagCompound();
this.tile.getMCTileEntity().writeToNBT(compound);
return NpcAPI.Instance().getINbt(compound);