Skip to content

Commit

Permalink
Fix AnvilMenu worldpos NPE (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Apr 12, 2024
1 parent ecd493d commit e88b7bf
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -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());
}
}
Expand Down

0 comments on commit e88b7bf

Please sign in to comment.