mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
ScriptBlock:
-More checks for null tile entities.
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user