From b11bb6fa22a56580f0a5a1b1fffd66f9e288791c Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 19 Apr 2022 00:48:51 +0200 Subject: [PATCH] make y location of homes always absolute (#3568) --- .../main/java/com/plotsquared/core/command/SetHome.java | 8 ++++++-- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/SetHome.java b/Core/src/main/java/com/plotsquared/core/command/SetHome.java index 4b9c44650..c54691c36 100644 --- a/Core/src/main/java/com/plotsquared/core/command/SetHome.java +++ b/Core/src/main/java/com/plotsquared/core/command/SetHome.java @@ -57,8 +57,12 @@ public class SetHome extends SetCommand { Plot base = plot.getBasePlot(false); Location bottom = base.getBottomAbs(); Location location = player.getLocationFull(); - BlockLoc rel = new BlockLoc(location.getX() - bottom.getX(), location.getY(), - location.getZ() - bottom.getZ(), location.getYaw(), location.getPitch() + BlockLoc rel = new BlockLoc( + location.getX() - bottom.getX(), + location.getY(), // y is absolute + location.getZ() - bottom.getZ(), + location.getYaw(), + location.getPitch() ); base.setHome(rel); player.sendMessage(TranslatableCaption.of("position.position_set")); diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 8b0e78610..b709de857 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -1465,7 +1465,7 @@ public class Plot { .at( bottom.getWorldName(), bottom.getX() + home.getX(), - bottom.getY() + home.getY(), + home.getY(), // y is absolute bottom.getZ() + home.getZ(), home.getYaw(), home.getPitch()