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() {
|
default Location bridge$getLocation() {
|
||||||
CraftWorld world = ((WorldBridge) bridge$getWorld()).bridge$getWorld();
|
|
||||||
BlockPos blockPos = bridge$getPosition();
|
BlockPos blockPos = bridge$getPosition();
|
||||||
if (blockPos == null) {
|
if (blockPos == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
Level level = bridge$getWorld();
|
||||||
|
CraftWorld world = level == null ? null : ((WorldBridge) level).bridge$getWorld();
|
||||||
return new Location(world, blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
return new Location(world, blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user