From 4d3838caa7a321f6877e3c25b21c266c6428eb23 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 26 Aug 2019 00:59:27 +0200 Subject: [PATCH] Fix Towny claim check and depend on the Core --- plugin.yml | 1 + .../components/townyfactions/TownyFactionsComponent.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin.yml b/plugin.yml index d2e613f..5dd8f6a 100644 --- a/plugin.yml +++ b/plugin.yml @@ -15,3 +15,4 @@ commands: description: A set of commands designed for R and D softdepend: [Factions] +depend: [ButtonCore] \ No newline at end of file diff --git a/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java b/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java index f09e221..b6cda94 100644 --- a/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java +++ b/src/main/java/buttondevteam/presents/components/townyfactions/TownyFactionsComponent.java @@ -63,13 +63,13 @@ public class TownyFactionsComponent extends Component implements @EventHandler public void onTownyClaim(TownPreClaimEvent event) { - PS chunkCoord = PS.valueOf(getLocation(event.getTownBlock().getWorldCoord())).getChunkCoords(true); + 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++) { if (i * i + j * j <= distance * distance) { - PS chunk = PS.valueOf(chunkCoord.getChunkX() + i, chunkCoord.getChunkZ() + j) - .withWorld(chunkCoord.getWorld()); //TODO: Doesn't have the world for some reason + PS chunk = PS.valueOf(coord.getChunkX(true) + i, coord.getChunkZ(true) + j) + .withWorld(coord.getWorld()); if (!BoardColl.get().getFactionAt(chunk).isNone()) { event.setCancelled(true); }