Use the bukkit rounding tools to round the same way always.

This commit is contained in:
Olof Larsson 2013-04-29 12:48:41 +02:00
parent 5649117b1f
commit bc92d94f89

View File

@ -473,7 +473,7 @@ public final class PS implements Cloneable, Serializable, Comparable<PS>
public static Integer calcBlockCoord(Double location, Integer block, Integer chunk) public static Integer calcBlockCoord(Double location, Integer block, Integer chunk)
{ {
if (block != null) return block; 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; if (chunk != null) return chunk * 16;
return null; return null;
} }
@ -487,7 +487,7 @@ public final class PS implements Cloneable, Serializable, Comparable<PS>
public static Integer calcChunkCoord(Double location, Integer block, Integer chunk) public static Integer calcChunkCoord(Double location, Integer block, Integer chunk)
{ {
if (chunk != null) return 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; if (block != null) return block >> 4;
return null; return null;
} }