Send error if not enough players to do /tpall

This commit is contained in:
William committed 2022-01-15 19:10:23 +00:00
1 parent 6a2161434e
commit 2dd0bbb9d8
2 files changed
+6 -1

No files matched your search

@@ -1,5 +1,6 @@
package me.william278.huskhomes2.commands;
import me.william278.huskhomes2.HuskHomes;
import me.william278.huskhomes2.MessageManager;
import me.william278.huskhomes2.teleport.TeleportManager;
import org.bukkit.command.Command;
@@ -9,6 +10,10 @@ public class TpAllCommand extends CommandBase {
@Override
protected void onCommand(Player p, Command command, String label, String[] args) {
if (HuskHomes.getPlayerList().getPlayers().size() <= 1) {
MessageManager.sendMessage(p, "error_no_other_online_players");
return;
}
TeleportManager.teleportAllHere(p);
MessageManager.sendMessage(p, "teleporting_all_players");
}
+1 -1
View File
@@ -122,7 +122,7 @@ error_home_invalid_other: '[Error:](#ff3300) [%1% doesn''t have a home set named
error_edit_home_maximum_public_homes: '[Error:](#ff3300) [You can only make a maximum of %1% homes public.](#ff7e5e)'
teleporting_cancelled_pvp: '[Teleportation cancelled; you engaged in combat!](#ff7e5e)'
tpaall_request_sent: '[You sent a teleport request asking everyone to teleport to you!](#00fb9a)'
error_no_other_online_players: '[Error:](#ff3300) [There are no other online players to send a request to!](#ff7e5e)'
error_no_other_online_players: '[Error:](#ff3300) [There are no other online players who could teleport to you.](#ff7e5e)'
teleporting_all_players: '[Teleporting all players to your position...](#00fb9a)'
home_command_description: 'Teleport to one of your homes'
sethome_command_description: 'Set a new home with given name'