mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2025-12-05 02:18:46 +01:00
Parkour implementation safety save 2
This is just a safety save in case the code gets too broken to fix.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
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,
|
||||
;
|
||||
|
||||
/**
|
||||
* Tries to match the correct game-mode according to the given string
|
||||
*
|
||||
* @param gameMode <p>The game-mode string to match</p>
|
||||
* @return <p>The specified arena game-mode</p>
|
||||
*/
|
||||
public static @NotNull ParkourArenaGameMode matchGamemode(@NotNull String gameMode) {
|
||||
return ParkourArenaGameMode.DEFAULT;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Map<String, Object> serialize() {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("name", this.name());
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the arena game-mode specified by the given data
|
||||
*
|
||||
* @param data <p>The data to deserialize</p>
|
||||
* @return <p>The deserialized arena game-mode</p>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public static ParkourArenaGameMode deserialize(Map<String, Object> data) {
|
||||
return ParkourArenaGameMode.valueOf((String) data.get("name"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user