make y location of homes always absolute (#3568)

This commit is contained in:
Hannes Greule 2022-04-19 00:48:51 +02:00 committed by GitHub
parent e5764b958d
commit b11bb6fa22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -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"));

View File

@ -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()