diff --git a/pom.xml b/pom.xml index 699907d..a2689e8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ms.kevi plotplugin - 1.2.0 + 1.2.1 17 @@ -26,7 +26,7 @@ cn.powernukkitx powernukkitx - 1.19.20-r1 + 1.19.20-r4 compile diff --git a/src/main/java/ms/kevi/plotplugin/manager/PlotManager.java b/src/main/java/ms/kevi/plotplugin/manager/PlotManager.java index a85f5ea..7bd04e5 100644 --- a/src/main/java/ms/kevi/plotplugin/manager/PlotManager.java +++ b/src/main/java/ms/kevi/plotplugin/manager/PlotManager.java @@ -127,8 +127,8 @@ public Plot getMergedPlot(int x, int z) { final int plotSize = this.levelSettings.getPlotSize(); final int totalSize = this.levelSettings.getTotalSize(); - final int idX = x / totalSize; - final int idZ = z / totalSize; + final int idX = x >= 0 ? x / totalSize : (x / totalSize) - 1; + final int idZ = x >= 0 ? z / totalSize : (z / totalSize) - 1; final int difX = x >= 0 ? x % totalSize : Math.abs((x - plotSize + 1) % totalSize); final int difZ = z >= 0 ? z % totalSize : Math.abs((z - plotSize + 1) % totalSize); @@ -159,8 +159,8 @@ private PlotId getPlotIdByPos(int x, int z) { final int plotSize = this.levelSettings.getPlotSize(); final int totalSize = plotSize + this.levelSettings.getRoadSize(); - final int idX = x / totalSize; - final int idZ = z / totalSize; + final int idX = x >= 0 ? x / totalSize : (x / totalSize) - 1; + final int idZ = x >= 0 ? z / totalSize : (z / totalSize) - 1; final int difX = x >= 0 ? x % totalSize : Math.abs((x - plotSize + 1) % totalSize); final int difZ = z >= 0 ? z % totalSize : Math.abs((z - plotSize + 1) % totalSize); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index bed4da0..a99bd25 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: Plots -version: "1.2.0" +version: "1.2.1" api: [ "1.0.13" ] author: Kevims main: ms.kevi.plotplugin.PlotPlugin \ No newline at end of file