Improves messages #16

This commit is contained in:
2023-04-18 17:25:10 +02:00
parent 58e25bcb30
commit e6bb324da1
37 changed files with 335 additions and 117 deletions

View File

@ -2,6 +2,7 @@ package net.knarcraft.minigames.command;
import net.knarcraft.minigames.MiniGames;
import net.knarcraft.minigames.arena.ArenaSession;
import net.knarcraft.minigames.config.Message;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
@ -21,13 +22,13 @@ public class LeaveArenaCommand implements TabExecutor {
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] strings) {
if (!(commandSender instanceof Player player)) {
commandSender.sendMessage("This command must be used by a player");
commandSender.sendMessage(Message.ERROR_PLAYER_ONLY.getMessage());
return false;
}
ArenaSession existingSession = MiniGames.getInstance().getSession(player.getUniqueId());
if (existingSession == null) {
commandSender.sendMessage("You are not in a mini-games arena!");
commandSender.sendMessage(Message.ERROR_NOT_IN_ARENA.getMessage());
return false;
}