mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-01 10:09:33 +02:00
Fix npes.
This commit is contained in:
parent
898a9a5212
commit
934644633f
|
@ -29,26 +29,27 @@ public class BlockCacheCB2511 extends BlockCache implements IBlockAccess{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
public void setAccess(final World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fetchTypeId(int x, int y, int z) {
|
||||
public int fetchTypeId(final int x, final int y, final int z) {
|
||||
return world.getTypeId(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fetchData(int x, int y, int z) {
|
||||
public int fetchData(final int x, final int y, final int z) {
|
||||
return world.getData(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] fetchBounds(int x, int y, int z){
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
|
||||
// TODO: change api for this / use nodes (!)
|
||||
final int id = getTypeId(x, y, z);
|
||||
final net.minecraft.server.Block block = net.minecraft.server.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
block.updateShape(this, x, y, z); // TODO: use THIS instead of world.
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
|
|
@ -30,7 +30,7 @@ public class BlockCacheCB2512 extends BlockCache implements IBlockAccess{ // TOD
|
|||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,6 +49,7 @@ public class BlockCacheCB2512 extends BlockCache implements IBlockAccess{ // TOD
|
|||
// TODO: change api for this / use nodes (!)
|
||||
final int id = getTypeId(x, y, z);
|
||||
final net.minecraft.server.v1_4_5.Block block = net.minecraft.server.v1_4_5.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
block.updateShape(this, x, y, z); // TODO: use THIS instead of world.
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
|
Loading…
Reference in New Issue
Block a user