mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Add new /tp locales making it more clear what action was performed
This commit is contained in:
1 parent
0e542928f1
commit
312bff2efc
3 files changed
+38
-5
No files matched your search
@@ -72,7 +72,15 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
||||
plugin.getTeleportManager()
|
||||
.teleportPlayerToPlayerByName(playerToTeleportName, targetPosition.targetPlayer, onlineUser)
|
||||
.thenAccept(resultIfPlayerExists -> resultIfPlayerExists.ifPresentOrElse(
|
||||
result -> plugin.getTeleportManager().finishTeleport(onlineUser, result),
|
||||
result -> {
|
||||
if (result.successful) {
|
||||
plugin.getLocales().getLocale("teleporting_other_complete",
|
||||
playerToTeleportName, targetPosition.targetPlayer)
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getTeleportManager().finishTeleport(onlineUser, result);
|
||||
},
|
||||
() -> plugin.getLocales().getLocale("error_player_not_found", playerToTeleportName)
|
||||
.ifPresent(onlineUser::sendMessage)));
|
||||
return;
|
||||
@@ -81,7 +89,18 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
||||
assert targetPosition.targetPosition != null;
|
||||
plugin.getTeleportManager().teleportPlayerByName(playerToTeleportName, targetPosition.targetPosition, onlineUser)
|
||||
.thenAccept(resultIfPlayerExists -> resultIfPlayerExists.ifPresentOrElse(
|
||||
result -> plugin.getTeleportManager().finishTeleport(onlineUser, result),
|
||||
result -> {
|
||||
if (result.successful && !playerToTeleportName.equalsIgnoreCase(onlineUser.username)) {
|
||||
plugin.getLocales().getLocale("teleporting_other_complete_position",
|
||||
playerToTeleportName,
|
||||
Integer.toString((int) targetPosition.targetPosition.x),
|
||||
Integer.toString((int) targetPosition.targetPosition.y),
|
||||
Integer.toString((int) targetPosition.targetPosition.z))
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getTeleportManager().finishTeleport(onlineUser, result);
|
||||
},
|
||||
() -> plugin.getLocales().getLocale("error_player_not_found", playerToTeleportName)
|
||||
.ifPresent(onlineUser::sendMessage)));
|
||||
return;
|
||||
@@ -153,7 +172,7 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
||||
return completions;
|
||||
}
|
||||
completions.addAll(List.of("~", Integer.toString((int) user.getPosition().z)));
|
||||
} else if (isCoordinate(args[1])){
|
||||
} else if (isCoordinate(args[1])) {
|
||||
if (user == null) {
|
||||
return completions;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,20 @@ public class TpHereCommand extends CommandBase implements TabCompletable {
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getTeleportManager().teleportPlayerByName(args[0], onlineUser.getPosition(), onlineUser);
|
||||
final String targetPlayerName = args[0];
|
||||
plugin.getTeleportManager().teleportPlayerByName(targetPlayerName, onlineUser.getPosition(), onlineUser)
|
||||
.thenAccept(resultIfPlayerExists -> resultIfPlayerExists.ifPresentOrElse(
|
||||
result -> {
|
||||
if (result.successful) {
|
||||
plugin.getLocales().getLocale("teleporting_other_complete",
|
||||
targetPlayerName, onlineUser.username)
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getTeleportManager().finishTeleport(onlineUser, result);
|
||||
},
|
||||
() -> plugin.getLocales().getLocale("error_player_not_found", targetPlayerName)
|
||||
.ifPresent(onlineUser::sendMessage)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
teleporting_last_position: '[Returning to your last position in](#00fb9a) [%1%](#00fb9a bold) [seconds](#00fb9a)'
|
||||
teleporting_offline_player: '[Teleporting you to where %1% last logged out…](#00fb9a)'
|
||||
teleporting_warmup_start: '[You will be teleported in](#00fb9a) [%1%](#00fb9a bold) [seconds, please stand still…](#00fb9a)'
|
||||
teleporting_cancelled_movement: '[Teleportation cancelled; you moved!](#ff7e5e)'
|
||||
@@ -7,6 +6,8 @@ teleporting_complete: '[Teleportation complete!](#00fb9a)'
|
||||
teleporting_action_bar_warmup: '[Teleporting in](#00fb9a) [%1%](#00fb9a bold)[…](#00fb9a)'
|
||||
teleporting_action_bar_processing: '[Teleporting…](#00fb9a)'
|
||||
teleporting_action_bar_cancelled: '[Teleportation cancelled!](#ff7e5e)'
|
||||
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
||||
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||
|
||||
edit_home_menu_title: '[Viewing details for your home,](#00fb9a) [%1%](#00fb9a bold)[:](#00fb9a)'
|
||||
edit_home_menu_title_other: '[Viewing details for %1%''s home,](#00fb9a) [%2%](#00fb9a bold)[:](#00fb9a)'
|
||||
|
||||
Reference in new issue
Block a user