Null check 1.8.8 getCollisionBox
This commit is contained in:
parent
13f7961556
commit
da71b8d811
|
@ -388,7 +388,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||||
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
||||||
return shape.isEmpty() ? new BoundingBox(0, 0, 0, 0, 0, 0) : NMSBoundingBox.wrap(shape.getBoundingBox());
|
return shape.isEmpty() ? BoundingBox.EMPTY : NMSBoundingBox.wrap(shape.getBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
|
@ -432,7 +432,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||||
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
||||||
return shape.isEmpty() ? new BoundingBox(0, 0, 0, 0, 0, 0) : NMSBoundingBox.wrap(shape.getBoundingBox());
|
return shape.isEmpty() ? BoundingBox.EMPTY : NMSBoundingBox.wrap(shape.getBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
|
@ -438,7 +438,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||||
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
||||||
return shape.isEmpty() ? new BoundingBox(0, 0, 0, 0, 0, 0) : NMSBoundingBox.wrap(shape.getBoundingBox());
|
return shape.isEmpty() ? BoundingBox.EMPTY : NMSBoundingBox.wrap(shape.getBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
|
@ -448,7 +448,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||||
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
||||||
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
||||||
return shape.isEmpty() ? new BoundingBox(0, 0, 0, 0, 0, 0) : NMSBoundingBox.wrap(shape.bounds());
|
return shape.isEmpty() ? BoundingBox.EMPTY : NMSBoundingBox.wrap(shape.bounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
|
@ -448,7 +448,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||||
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
||||||
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
VoxelShape shape = ((CraftBlock) block).getNMS().getCollisionShape(world, ((CraftBlock) block).getPosition());
|
||||||
return shape.isEmpty() ? new BoundingBox(0, 0, 0, 0, 0, 0) : NMSBoundingBox.wrap(shape.bounds());
|
return shape.isEmpty() ? BoundingBox.EMPTY : NMSBoundingBox.wrap(shape.bounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
|
@ -296,7 +296,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
Block type = CraftMagicNumbers.getBlock(block);
|
Block type = CraftMagicNumbers.getBlock(block);
|
||||||
BlockPosition pos = new BlockPosition(block.getX(), block.getY(), block.getZ());
|
BlockPosition pos = new BlockPosition(block.getX(), block.getY(), block.getZ());
|
||||||
AxisAlignedBB aabb = type.a(world, pos, world.getType(pos));
|
AxisAlignedBB aabb = type.a(world, pos, world.getType(pos));
|
||||||
return new BoundingBox(aabb.a, aabb.b, aabb.c, aabb.d, aabb.e, aabb.f);
|
return aabb == null ? BoundingBox.EMPTY : new BoundingBox(aabb.a, aabb.b, aabb.c, aabb.d, aabb.e, aabb.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
private float getDragonYaw(Entity handle, double tX, double tZ) {
|
||||||
|
|
Loading…
Reference in New Issue