Fixed conversion from world to chunk coords.

Added test that catches this case.
This commit is contained in:
2020-04-27 15:14:33 -05:00
parent 26ebf7af33
commit 49f26f7901
2 changed files with 6 additions and 1 deletions

View File

@@ -61,6 +61,11 @@ public class UtilitiesTest {
assertEquals(new Point2(-4, -3), Utilities.worldToChunkCoordinates(-55, -33));
}
@Test
public void testWorldToChunkCoordinatesNegativeOffClose() {
assertEquals(new Point2(15, -15), Utilities.worldToChunkCoordinates(255, -227));
}
@Test
public void testWorldToChunkCoordinatesPositivePerfect() {
assertEquals(new Point2(4, 5), Utilities.worldToChunkCoordinates(64, 80));