Skip to content

Commit 66cb85c

Browse files
authored
Update 1.2.1 (#16)
Fix PlotManager#getMergedPlot
1 parent 07d6a82 commit 66cb85c

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>ms.kevi</groupId>
88
<artifactId>plotplugin</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.2.1</version>
1010

1111
<properties>
1212
<maven.compiler.source>17</maven.compiler.source>
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>cn.powernukkitx</groupId>
2828
<artifactId>powernukkitx</artifactId>
29-
<version>1.19.20-r1</version>
29+
<version>1.19.20-r4</version>
3030
<scope>compile</scope>
3131
</dependency>
3232
<dependency>

src/main/java/ms/kevi/plotplugin/manager/PlotManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public Plot getMergedPlot(int x, int z) {
127127
final int plotSize = this.levelSettings.getPlotSize();
128128
final int totalSize = this.levelSettings.getTotalSize();
129129

130-
final int idX = x / totalSize;
131-
final int idZ = z / totalSize;
130+
final int idX = x >= 0 ? x / totalSize : (x / totalSize) - 1;
131+
final int idZ = x >= 0 ? z / totalSize : (z / totalSize) - 1;
132132

133133
final int difX = x >= 0 ? x % totalSize : Math.abs((x - plotSize + 1) % totalSize);
134134
final int difZ = z >= 0 ? z % totalSize : Math.abs((z - plotSize + 1) % totalSize);
@@ -159,8 +159,8 @@ private PlotId getPlotIdByPos(int x, int z) {
159159
final int plotSize = this.levelSettings.getPlotSize();
160160
final int totalSize = plotSize + this.levelSettings.getRoadSize();
161161

162-
final int idX = x / totalSize;
163-
final int idZ = z / totalSize;
162+
final int idX = x >= 0 ? x / totalSize : (x / totalSize) - 1;
163+
final int idZ = x >= 0 ? z / totalSize : (z / totalSize) - 1;
164164

165165
final int difX = x >= 0 ? x % totalSize : Math.abs((x - plotSize + 1) % totalSize);
166166
final int difZ = z >= 0 ? z % totalSize : Math.abs((z - plotSize + 1) % totalSize);

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Plots
2-
version: "1.2.0"
2+
version: "1.2.1"
33
api: [ "1.0.13" ]
44
author: Kevims
55
main: ms.kevi.plotplugin.PlotPlugin

0 commit comments

Comments
 (0)