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