mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Update locales, add tpall check for no online players
This commit is contained in:
1 parent
33fdab44f2
commit
e8e9b1ffb9
15 files changed
+36
-143
No files matched your search
@@ -65,6 +65,7 @@ public class TpCommand extends Command implements TabProvider {
|
||||
// Execute a teleport
|
||||
private void execute(@NotNull CommandUser executor, @NotNull Teleportable teleportable, @NotNull Target target,
|
||||
@NotNull String[] args) {
|
||||
// Build and execute the teleport
|
||||
final TeleportBuilder builder = Teleport.builder(plugin)
|
||||
.teleporter(teleportable)
|
||||
.target(target);
|
||||
@@ -75,6 +76,20 @@ public class TpCommand extends Command implements TabProvider {
|
||||
builder.toTeleport().execute();
|
||||
} catch (TeleportationException e) {
|
||||
e.displayMessage(executor, plugin, args);
|
||||
return;
|
||||
}
|
||||
|
||||
// Display teleport completion message
|
||||
final String teleporterName = teleportable instanceof OnlineUser user
|
||||
? user.getUsername() : ((Username) teleportable).name();
|
||||
if (target instanceof Position position) {
|
||||
plugin.getLocales().getLocale("teleporting_other_complete_position", teleporterName,
|
||||
Integer.toString((int) position.getX()), Integer.toString((int) position.getY()),
|
||||
Integer.toString((int) position.getZ()))
|
||||
.ifPresent(executor::sendMessage);
|
||||
} else {
|
||||
plugin.getLocales().getLocale("teleporting_other_complete", teleporterName, ((Username) target).name())
|
||||
.ifPresent(executor::sendMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user