Fix AnvilMenu worldpos NPE (#1311)
This commit is contained in:
parent
10da078de0
commit
52ab6e5e52
|
@ -18,11 +18,12 @@ public interface IWorldPosCallableBridge {
|
|||
}
|
||||
|
||||
default Location bridge$getLocation() {
|
||||
CraftWorld world = ((WorldBridge) bridge$getWorld()).bridge$getWorld();
|
||||
BlockPos blockPos = bridge$getPosition();
|
||||
if (blockPos == null) {
|
||||
return null;
|
||||
} else {
|
||||
Level level = bridge$getWorld();
|
||||
CraftWorld world = level == null ? null : ((WorldBridge) level).bridge$getWorld();
|
||||
return new Location(world, blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user