From bc92d94f89f90590c7cb40a2a3b3cb419d9e42bb Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 29 Apr 2013 12:48:41 +0200 Subject: [PATCH] Use the bukkit rounding tools to round the same way always. --- src/com/massivecraft/mcore/ps/PS.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/mcore/ps/PS.java b/src/com/massivecraft/mcore/ps/PS.java index 6e9c2616..1b3f14ee 100644 --- a/src/com/massivecraft/mcore/ps/PS.java +++ b/src/com/massivecraft/mcore/ps/PS.java @@ -473,7 +473,7 @@ public final class PS implements Cloneable, Serializable, Comparable public static Integer calcBlockCoord(Double location, Integer block, Integer chunk) { if (block != null) return block; - if (location != null) return (int) Math.floor(location); + if (location != null) return (int) Location.locToBlock(location); if (chunk != null) return chunk * 16; return null; } @@ -487,7 +487,7 @@ public final class PS implements Cloneable, Serializable, Comparable public static Integer calcChunkCoord(Double location, Integer block, Integer chunk) { if (chunk != null) return chunk; - if (location != null) return location.intValue() >> 4; + if (location != null) return Location.locToBlock(location) >> 4; if (block != null) return block >> 4; return null; }