diff --git a/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java b/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java index f4d5df895..e8cc4c664 100644 --- a/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java +++ b/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java @@ -90,7 +90,11 @@ public final class ChunkUtils { } public static Chunk retrieve(Instance instance, Chunk originChunk, double x, double z) { - return ChunkUtils.same(originChunk, x, z) ? originChunk : instance.getChunkAt(x, z); + final int chunkX = getChunkCoordinate(x); + final int chunkZ = getChunkCoordinate(z); + final boolean sameChunk = originChunk.getChunkX() == chunkX && + originChunk.getChunkZ() == chunkZ; + return sameChunk ? originChunk : instance.getChunk(chunkX, chunkZ); } public static Chunk retrieve(Instance instance, Chunk originChunk, Point position) {