diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommand.java index abdeffe81..bb98b9ab4 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommand.java @@ -100,10 +100,9 @@ public boolean execute(User user, String label, List args) { // Otherwise, ask the admin to go to a safe spot String failureMessage = user.getTranslation("commands.admin.tp.manual", "[location]", warpSpot.getBlockX() + " " + warpSpot.getBlockY() + " " + warpSpot.getBlockZ()); - - Player player = user.getPlayer(); + // Set the player + Player player = args.size() == 2 ? userToTeleport.getPlayer() : user.getPlayer(); if (args.size() == 2) { - player = userToTeleport.getPlayer(); failureMessage = userToTeleport.getTranslation(NOT_SAFE); } @@ -112,6 +111,7 @@ public boolean execute(User user, String label, List args) { .entity(player) .location(warpSpot) .failureMessage(failureMessage) + .thenRun(() -> user.sendMessage("general.success")) .build(); return true; } diff --git a/src/test/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommandTest.java b/src/test/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommandTest.java index 71960c644..9d692be09 100644 --- a/src/test/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommandTest.java +++ b/src/test/java/world/bentobox/bentobox/api/commands/admin/AdminTeleportCommandTest.java @@ -283,24 +283,5 @@ public void testExecuteUserStringListOfStringKnownTargetHasIslandEnd() { verify(user).getTranslation(eq("commands.admin.tp.manual"), eq("[location]"), eq("0 0 0")); } - - - - - - - - - - - - - - - - - - - }