Makes some GUI changes

Makes the current state of the player toggle visible.
Makes it possible to toggle player visibility outside arenas.
This commit is contained in:
2023-05-10 16:33:01 +02:00
parent 7848a0a028
commit d6fb9ab0b9
9 changed files with 102 additions and 21 deletions

View File

@ -3,6 +3,7 @@ package net.knarcraft.minigames.command;
import net.knarcraft.minigames.MiniGames;
import net.knarcraft.minigames.arena.ArenaSession;
import net.knarcraft.minigames.config.Message;
import net.knarcraft.minigames.gui.MiniGamesGUI;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
@ -28,12 +29,12 @@ public class MenuCommand implements TabExecutor {
ArenaSession existingSession = MiniGames.getInstance().getSession(player.getUniqueId());
if (existingSession == null) {
commandSender.sendMessage(Message.ERROR_NOT_IN_ARENA.getMessage());
new MiniGamesGUI(player).openFor(player);
return false;
} else {
existingSession.getGUI().openFor(player);
return true;
}
existingSession.getGUI().openFor(player);
return true;
}
@Nullable