Null check bounding boxes

This commit is contained in:
fullwall 2022-03-12 14:27:37 +08:00
parent 4397aa4ae8
commit 4a612392ed

View File

@ -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;