Skip to content

Commit

Permalink
Update 1.0.5: Resolve safe position for custom plot homes (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
KCodeYT authored Jun 7, 2022
1 parent 1635152 commit 13826a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ms.kevi</groupId>
<artifactId>plotplugin</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/ms/kevi/plotplugin/manager/PlotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,15 @@ public void teleportPlayerToPlot(Player player, Plot plot, boolean homeAllowed)

if(homeAllowed) {
final Vector3 homePosition = plot.getHomePosition();
if(homePosition != null) plotVec = homePosition;
if(homePosition != null) plotVec = homePosition.clone();
}

player.teleport(Location.fromObject(plotVec, this.level));
for(int y = plotVec.getFloorY(); this.level.isOverWorld() ? y <= 319 : y <= 255; y++) {
plotVec.setY(y);
if(this.level.standable(plotVec)) break;
}

player.teleport(plotVec);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Plots
version: "1.0.4"
version: "1.0.5"
api: [ "1.0.13" ]
author: Kevims
main: ms.kevi.plotplugin.PlotPlugin

0 comments on commit 13826a0

Please sign in to comment.