From 5c1cc38702dde44d0ade5acddf42660571d5a5b9 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Tue, 12 Apr 2022 18:26:18 +0200 Subject: [PATCH] make y location of homes always absolute --- .../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()