From 648518d5b6f99fd4f79e31637994788d6448414a Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 21 Sep 2019 22:43:26 +0200 Subject: [PATCH] Allow claiming town plots in the same chunk Off by one error --- .../components/townyfactions/TownyFactionsComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java b/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java index 986467c..5a49d14 100644 --- a/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java +++ b/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java @@ -66,8 +66,8 @@ public class TownyFactionsComponent extends Component implements public void onTownyClaim(TownPreClaimEvent event) { PS coord = PS.valueOf(getLocation(event.getTownBlock().getWorldCoord())); int distance = distance().get(); - for (int i = -distance; i <= distance; i++) { - for (int j = -distance; j <= distance; j++) { + for (int i = -distance + 1; i <= distance - 1; i++) { + for (int j = -distance + 1; j <= distance - 1; j++) { if (i * i + j * j <= distance * distance) { PS chunk = PS.valueOf(coord.getChunkX(true) + i, coord.getChunkZ(true) + j) .withWorld(coord.getWorld());