mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-15 21:54:50 +00:00
Fixed NullPointerException crash from breaking blocks that have no tile entities.
This commit is contained in:
1 parent
e9a8f8cebc
commit
5cb5770a20
2 files changed
+6
-4
No files matched your search
@@ -171,15 +171,17 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
}
|
||||
|
||||
public ITileEntity getITileEntity(IWorld world, IPos pos) {
|
||||
return new ScriptTileEntity<>(world.getMCWorld().getTileEntity(pos.getX(), pos.getY(),pos.getZ()));
|
||||
TileEntity tileEntity = world.getMCWorld().getTileEntity(pos.getX(), pos.getY(),pos.getZ());
|
||||
return this.getITileEntity(tileEntity);
|
||||
}
|
||||
|
||||
public ITileEntity getITileEntity(IWorld world, int x, int y, int z) {
|
||||
return new ScriptTileEntity<>(world.getMCWorld().getTileEntity(x,y,z));
|
||||
TileEntity tileEntity = world.getMCWorld().getTileEntity(x,y,z);
|
||||
return this.getITileEntity(tileEntity);
|
||||
}
|
||||
|
||||
public ITileEntity getITileEntity(TileEntity tileEntity) {
|
||||
return new ScriptTileEntity<>(tileEntity);
|
||||
return tileEntity == null ? null : new ScriptTileEntity<>(tileEntity);
|
||||
}
|
||||
|
||||
public IPos getIPos(BlockPos pos) {
|
||||
|
||||
Reference in new issue
Block a user