mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
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) {
|
||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||
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) {
|
||||
|
@ -432,7 +432,7 @@ public class NMSImpl implements NMSBridge {
|
||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||
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) {
|
||||
|
@ -438,7 +438,7 @@ public class NMSImpl implements NMSBridge {
|
||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||
WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
|
||||
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) {
|
||||
|
@ -448,7 +448,7 @@ public class NMSImpl implements NMSBridge {
|
||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
||||
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) {
|
||||
|
@ -448,7 +448,7 @@ public class NMSImpl implements NMSBridge {
|
||||
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
|
||||
ServerLevel world = ((CraftWorld) block.getWorld()).getHandle();
|
||||
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) {
|
||||
|
@ -296,7 +296,7 @@ public class NMSImpl implements NMSBridge {
|
||||
Block type = CraftMagicNumbers.getBlock(block);
|
||||
BlockPosition pos = new BlockPosition(block.getX(), block.getY(), block.getZ());
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user