From 24c0864ff8d9110341f3583e8c611a6d485b72c9 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 14 May 2020 16:55:39 +0100 Subject: [PATCH] Fix both a negative x and z coordinate not being possible --- .../java/de/themoep/randomteleport/searcher/RandomSearcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/RandomSearcher.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/RandomSearcher.java index fe9aa0b..a1fef3c 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/RandomSearcher.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/searcher/RandomSearcher.java @@ -369,7 +369,7 @@ public class RandomSearcher { randChunkX = (random.nextBoolean() ? 1 : -1) * random.nextInt(maxChunk + 1); randChunkZ = (random.nextBoolean() ? 1 : -1) * random.nextInt(maxChunk + 1); } - } while (!checked.put(randChunkX, randChunkZ) || !inRadius(randChunkX, randChunkZ, minChunk, maxChunk)); + } while (!checked.put(randChunkX, randChunkZ) || !inRadius(Math.abs(randChunkX), Math.abs(randChunkZ), minChunk, maxChunk)); randomLoc.setX(((center.getBlockX() >> 4) + randChunkX) * 16); randomLoc.setZ(((center.getBlockZ() >> 4) + randChunkZ) * 16);