From 39381f07f94ec57d26e097fe03ac5d2756602ec4 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 27 Apr 2020 13:21:04 -0500 Subject: [PATCH] Fixed incorrect method call. Added tests to make sure that this doesn't happen. --- src/main/java/ca/recrown/islandsurvivalcraft/Utilities.java | 2 +- src/test/java/ca/recrown/islandsurvivalcraft/UtilitiesTest.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/Utilities.java b/src/main/java/ca/recrown/islandsurvivalcraft/Utilities.java index 907ff2d..2cad129 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/Utilities.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/Utilities.java @@ -67,6 +67,6 @@ public class Utilities { } public static Point2 worldToLocalChunkCoordinates(Point2 worldCoordinates) { - return worldToChunkCoordinates(worldCoordinates.x, worldCoordinates.y); + return worldToLocalChunkCoordinates(worldCoordinates.x, worldCoordinates.y); } } \ No newline at end of file diff --git a/src/test/java/ca/recrown/islandsurvivalcraft/UtilitiesTest.java b/src/test/java/ca/recrown/islandsurvivalcraft/UtilitiesTest.java index 5ec6be0..8911167 100644 --- a/src/test/java/ca/recrown/islandsurvivalcraft/UtilitiesTest.java +++ b/src/test/java/ca/recrown/islandsurvivalcraft/UtilitiesTest.java @@ -74,10 +74,12 @@ public class UtilitiesTest { @Test public void testWorldToLocalCoordinatesNegative() { assertEquals(new Point2(2, 5), Utilities.worldToLocalChunkCoordinates(-62, -27)); + assertEquals(new Point2(2, 5), Utilities.worldToLocalChunkCoordinates(new Point2(-62, -27))); } @Test public void testWorldToLocalCoordinatesPositive() { assertEquals(new Point2(7, 3), Utilities.worldToLocalChunkCoordinates(39, 83)); + assertEquals(new Point2(7, 3), Utilities.worldToLocalChunkCoordinates(new Point2(39, 83))); } }