mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 11:05:49 +01:00
Null check bounding boxes
This commit is contained in:
parent
4397aa4ae8
commit
4a612392ed
@ -35,6 +35,8 @@ public class BoundingBoxExaminer implements BlockExaminer {
|
|||||||
if (!MinecraftBlockExaminer.canStandIn(up) && MinecraftBlockExaminer.canStandOn(down)) {
|
if (!MinecraftBlockExaminer.canStandIn(up) && MinecraftBlockExaminer.canStandOn(down)) {
|
||||||
BoundingBox above = source.getCollisionBox(pos.getBlockX(), pos.getBlockY() + 2, pos.getBlockZ());
|
BoundingBox above = source.getCollisionBox(pos.getBlockX(), pos.getBlockY() + 2, pos.getBlockZ());
|
||||||
BoundingBox below = source.getCollisionBox(pos.getBlockX(), pos.getBlockY() - 1, pos.getBlockZ());
|
BoundingBox below = source.getCollisionBox(pos.getBlockX(), pos.getBlockY() - 1, pos.getBlockZ());
|
||||||
|
if (above == null || below == null)
|
||||||
|
return PassableState.IGNORE;
|
||||||
float height = (float) (above.minY - below.maxY);
|
float height = (float) (above.minY - below.maxY);
|
||||||
if (height < this.height) {
|
if (height < this.height) {
|
||||||
return PassableState.UNPASSABLE;
|
return PassableState.UNPASSABLE;
|
||||||
|
Loading…
Reference in New Issue
Block a user