mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-10 02:19:30 +01:00
Fixes console teleporting.
https://github.com/BentoBoxWorld/BentoBox/issues/1877
This commit is contained in:
parent
f3a7ed1303
commit
6b6ab711e5
@ -100,10 +100,9 @@ public class AdminTeleportCommand extends CompositeCommand {
|
||||
// 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 class AdminTeleportCommand extends CompositeCommand {
|
||||
.entity(player)
|
||||
.location(warpSpot)
|
||||
.failureMessage(failureMessage)
|
||||
.thenRun(() -> user.sendMessage("general.success"))
|
||||
.build();
|
||||
return true;
|
||||
}
|
||||
|
@ -283,24 +283,5 @@ public class AdminTeleportCommandTest {
|
||||
verify(user).getTranslation(eq("commands.admin.tp.manual"), eq("[location]"), eq("0 0 0"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user