From a24585e497a714187c2293563f2649a3b1687077 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 27 Aug 2023 15:20:16 +0200 Subject: [PATCH] Potential posToChunk fix Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/utils/Region.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java index 9e547c8..6789d14 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java @@ -19,6 +19,7 @@ package de.steamwar.fightsystem.utils; +import de.steamwar.techhider.ProtocolUtils; import org.bukkit.Location; import org.bukkit.block.Block; @@ -79,24 +80,20 @@ public class Region { return maxZ - minZ; } - public double posToChunk(int pos){ - return pos / 16.0; - } - private int getMinChunkX(){ - return (int) Math.floor(posToChunk(minX)); + return ProtocolUtils.posToChunk(minX); } private int getMaxChunkX(){ - return (int) Math.ceil(posToChunk(maxX)); + return ProtocolUtils.posToChunk(maxX); } private int getMinChunkZ(){ - return (int) Math.floor(posToChunk(minZ)); + return ProtocolUtils.posToChunk(minZ); } private int getMaxChunkZ(){ - return (int) Math.ceil(posToChunk(maxZ)); + return ProtocolUtils.posToChunk(maxZ); } public boolean chunkOutside(int cX, int cZ) {