Skip to content

Commit

Permalink
Fixes console teleporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 11, 2021
1 parent f3a7ed1 commit 6b6ab71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ public boolean execute(User user, String label, List<String> 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);
}

Expand All @@ -112,6 +111,7 @@ public boolean execute(User user, String label, List<String> args) {
.entity(player)
.location(warpSpot)
.failureMessage(failureMessage)
.thenRun(() -> user.sendMessage("general.success"))
.build();
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,5 @@ public void testExecuteUserStringListOfStringKnownTargetHasIslandEnd() {
verify(user).getTranslation(eq("commands.admin.tp.manual"), eq("[location]"), eq("0 0 0"));
}





















}

0 comments on commit 6b6ab71

Please sign in to comment.