Interface ScenarioSettings
public interface ScenarioSettings
A scenario's settings as they apply to one match, already resolved.
Resolution runs in a fixed order and stops at the first source that supplies a value:
- the temporary lobby override, set for this one match;
- the source arena's override;
- the global configuration in
scenarios.yml; - the scenario's own default from its
ScenarioSettingdeclaration.
The view is a snapshot taken when the match locked its scenarios in, so a reload or a GUI edit during a running match never changes the rules underneath the players.
Every accessor falls back to the declared default when a stored value is missing or unusable, so a broken configuration degrades to the scenario's defaults instead of failing the match.
- Since:
- 1.6.0
-
Method Summary
Modifier and TypeMethodDescriptionasMap()Every resolved value, keyed by setting key.booleangetBoolean(@NotNull String key) double@NotNull List<ScenarioEntry> getEntries(@NotNull String key) The setting read as a list of structured entries.int@NotNull Optional<org.bukkit.Material> getMaterial(@NotNull String key) The setting read as a single material, empty when the name does not resolve.@NotNull List<org.bukkit.Material> getMaterials(@NotNull String key) The setting read as a material list, skipping names that no longer resolve on this server version.@NotNull StringgetStringList(@NotNull String key) booleanWhether the setting key was declared by the scenario.The raw resolved value, empty when the key was never declared.@NotNull StringThe scenario these settings belong to.@NotNull ScenarioSettingSourceWhere the resolved value came from.
-
Method Details
-
scenarioId
The scenario these settings belong to. -
has
Whether the setting key was declared by the scenario. -
raw
The raw resolved value, empty when the key was never declared. -
source
Where the resolved value came from. -
getBoolean
-
getInt
-
getDouble
-
getString
-
getStringList
-
getMaterials
The setting read as a material list, skipping names that no longer resolve on this server version. -
getMaterial
The setting read as a single material, empty when the name does not resolve. -
getEntries
The setting read as a list of structured entries.Every entry is shaped by the
ScenarioEntrySchemathe setting declared, and entries that no longer fit that schema are left out rather than handed over half-formed. A key that is not aScenarioSettingType.STRUCTURED_LISTyields an empty list.- Since:
- 1.6.0
-
asMap
Every resolved value, keyed by setting key.
-