package net.knarcraft.minigames.arena.parkour; import net.knarcraft.minigames.arena.ArenaGameMode; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.jetbrains.annotations.NotNull; import java.util.HashMap; import java.util.Map; /** * A representation of possible arena game-modes */ public enum ParkourArenaGameMode implements ConfigurationSerializable, ArenaGameMode { /** * The default game-mode. Failing once throws the player out. */ DEFAULT, /** * A hardcore game mode where no checkpoints are allowed */ HARDCORE, ; /** * Tries to match the correct game-mode according to the given string * * @param gameMode
The game-mode string to match
* @returnThe specified arena game-mode
*/ @NotNull public static ParkourArenaGameMode matchGameMode(@NotNull String gameMode) { try { return ParkourArenaGameMode.valueOf(gameMode.toUpperCase()); } catch (IllegalArgumentException exception) { return ParkourArenaGameMode.DEFAULT; } } @NotNull @Override public MapThe data to deserialize
* @returnThe deserialized arena game-mode
*/ @SuppressWarnings("unused") @NotNull public static ParkourArenaGameMode deserialize(@NotNull Map