Denies playing hardcore in a no-checkpoint arena

This commit is contained in:
2023-04-28 15:32:51 +02:00
parent e039840e89
commit fc1902e86a
4 changed files with 21 additions and 1 deletions

View File

@ -71,6 +71,12 @@ public class JoinParkourArenaCommand implements CommandExecutor {
gameMode = ParkourArenaGameMode.DEFAULT;
}
// Don't allow joining the hardcore game-mode if there are no checkpoints to skip
if (specifiedArena.hasNoCheckpoints() && gameMode == ParkourArenaGameMode.HARDCORE) {
player.sendMessage(Message.ERROR_HARDCORE_NO_CHECKPOINTS.getMessage());
return false;
}
// Make sure the player has beaten the necessary levels
ParkourArenaGroup arenaGroup = MiniGames.getInstance().getParkourArenaHandler().getGroup(specifiedArena.getArenaId());
if (arenaGroup != null && !doGroupChecks(specifiedArena, arenaGroup, gameMode, player)) {