Skip to content

Commit 13826a0

Browse files
authored
Update 1.0.5: Resolve safe position for custom plot homes (#6)
1 parent 1635152 commit 13826a0

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
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.0.4</version>
9+
<version>1.0.5</version>
1010

1111
<properties>
1212
<maven.compiler.source>17</maven.compiler.source>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,15 @@ public void teleportPlayerToPlot(Player player, Plot plot, boolean homeAllowed)
10461046

10471047
if(homeAllowed) {
10481048
final Vector3 homePosition = plot.getHomePosition();
1049-
if(homePosition != null) plotVec = homePosition;
1049+
if(homePosition != null) plotVec = homePosition.clone();
10501050
}
10511051

1052-
player.teleport(Location.fromObject(plotVec, this.level));
1052+
for(int y = plotVec.getFloorY(); this.level.isOverWorld() ? y <= 319 : y <= 255; y++) {
1053+
plotVec.setY(y);
1054+
if(this.level.standable(plotVec)) break;
1055+
}
1056+
1057+
player.teleport(plotVec);
10531058
}
10541059

10551060
}

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.0.4"
2+
version: "1.0.5"
33
api: [ "1.0.13" ]
44
author: Kevims
55
main: ms.kevi.plotplugin.PlotPlugin

0 commit comments

Comments
 (0)