package net.knarcraft.minigames.config; import net.knarcraft.minigames.util.MaterialHelper; import org.bukkit.Material; import org.bukkit.configuration.file.FileConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Set; /** * A configuration for a mini-game */ public abstract class MiniGameConfiguration { protected FileConfiguration configuration; /** * Instantiates a new mini-game configuration * * @param configuration
The YAML configuration to use internally
*/ public MiniGameConfiguration(@NotNull FileConfiguration configuration) { this.configuration = configuration; this.load(); } /** * Loads all configuration values from disk * * @param configurationThe configuration to load
*/ public void load(FileConfiguration configuration) { this.configuration = configuration; this.load(); } /** * Loads all configuration values from disk, using the current file configuration */ protected abstract void load(); /** * Loads the materials specified in the block whitelist */ public @NotNull Set