From 8c7bca38392ba8d7865e899502cc7e4df9ad425b Mon Sep 17 00:00:00 2001 From: m4ndeokyi Date: Wed, 10 Jan 2024 17:12:52 +0900 Subject: [PATCH] Update TpllCommand.java Fix the command re-applying the offset --- .../btegermany/terraplusminus/commands/TpllCommand.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java b/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java index 573922b..4c7421a 100644 --- a/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java +++ b/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java @@ -121,8 +121,6 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command World tpWorld = player.getWorld(); - int xOffset = Terraplusminus.config.getInt("terrain_offset.x"); - int zOffset = Terraplusminus.config.getInt("terrain_offset.z"); double minLat = Terraplusminus.config.getDouble("min_latitude"); double maxLat = Terraplusminus.config.getDouble("max_latitude"); double minLon = Terraplusminus.config.getDouble("min_longitude"); @@ -179,8 +177,8 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command tpWorld = Bukkit.getWorld(nextServer.getWorldName()); height = height - yOffset + nextServer.getOffset(); player.sendMessage(Terraplusminus.config.getString("prefix") + "§7Teleporting to " + coordinates[1] + ", " + coordinates[0] + " in another world. This may take a bit..."); - //player.teleport(new Location(tpWorld, mcCoordinates[0] + xOffset, height, mcCoordinates[1] + zOffset, player.getLocation().getYaw(), player.getLocation().getPitch())); - PaperLib.teleportAsync(player, new Location(tpWorld, mcCoordinates[0] + xOffset, height, mcCoordinates[1] + zOffset, player.getLocation().getYaw(), player.getLocation().getPitch())); + //player.teleport(new Location(tpWorld, mcCoordinates[0], height, mcCoordinates[1], player.getLocation().getYaw(), player.getLocation().getPitch())); + PaperLib.teleportAsync(player, new Location(tpWorld, mcCoordinates[0], height, mcCoordinates[1], player.getLocation().getYaw(), player.getLocation().getPitch())); return true; } } else { @@ -201,7 +199,7 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command tpWorld = Bukkit.getWorld(previousServer.getWorldName()); height = height - yOffset + previousServer.getOffset(); player.sendMessage(Terraplusminus.config.getString("prefix") + "§7Teleporting to " + coordinates[1] + ", " + coordinates[0] + " in another world. This may take a bit..."); - PaperLib.teleportAsync(player, new Location(tpWorld, mcCoordinates[0] + xOffset, height, mcCoordinates[1] + zOffset, player.getLocation().getYaw(), player.getLocation().getPitch())); + PaperLib.teleportAsync(player, new Location(tpWorld, mcCoordinates[0], height, mcCoordinates[1], player.getLocation().getYaw(), player.getLocation().getPitch())); return true; } } else {