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");
}