Fixed conversion from world to chunk coords.
Added test that catches this case.
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user