From 807a677e9a59929e27ac1991c3fa1cf6a2ec0f4d Mon Sep 17 00:00:00 2001 From: ysl3000 Date: Mon, 3 Feb 2020 09:42:48 +1100 Subject: [PATCH] SPIGOT-5558: Fix World#getHighestBlockAt, previously off by +1 --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 326835cf23..1458b0a637 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -291,11 +291,8 @@ public class CraftWorld implements World { @Override public int getHighestBlockYAt(int x, int z) { - if (!isChunkLoaded(x >> 4, z >> 4)) { - getChunkAt(x >> 4, z >> 4); // Transient load for this tick - } - - return world.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, new BlockPosition(x, 0, z)).getY(); + // Transient load for this tick + return world.getChunkAt(x >> 4, z >> 4).a(HeightMap.Type.MOTION_BLOCKING, x, z); } @Override