diff --git a/src/main/java/me/william278/huskhomes2/commands/TpAllCommand.java b/src/main/java/me/william278/huskhomes2/commands/TpAllCommand.java index b052b48c..813e8745 100644 --- a/src/main/java/me/william278/huskhomes2/commands/TpAllCommand.java +++ b/src/main/java/me/william278/huskhomes2/commands/TpAllCommand.java @@ -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"); } diff --git a/src/main/resources/languages/en-gb.yml b/src/main/resources/languages/en-gb.yml index a69858d8..a1ab93ba 100644 --- a/src/main/resources/languages/en-gb.yml +++ b/src/main/resources/languages/en-gb.yml @@ -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'