Klasse Arena
java.lang.Object
de.delinkedde.mobarenareborn.arena.Arena
A configured arena: its region, named warps, monster spawnpoints and enabled state.
An Arena is a mutable domain object owned by the ArenaManager. It carries
no gameplay state (joined players, current wave); that is introduced with the arena session
in a later milestone. Persistence is delegated to ArenaStorage.
An arena may only be enabled once missingRequirements() is empty, that is once a
region, all required warps and at least one spawnpoint have been set.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanaddSpawnpoint(@NotNull String id, @NotNull Location location) Adds or replaces a named spawnpoint.@Nullable IntegerintOverride(@NotNull String key) booleanbooleanisReady()Computes the list of unmet requirements that prevent the arena from being enabled.@NotNull Stringname()@Nullable Regionregion()booleanremoveSpawnpoint(@NotNull String id) Removes a named spawnpoint.voidsetEnabled(boolean enabled) Sets the enabled state.voidSets the arena region.voidsetSetting(@NotNull String key, @Nullable Object value) Sets or clears a per-arena setting override.settings()voidSets or replaces a warp location.voidsetWaveSet(@Nullable String waveSet) Sets the wave set this arena uses (a name defined inwaves.yml).@Nullable StringstringOverride(@NotNull String key) @Nullable LocationReturns a warp location.warps()@NotNull StringwaveSet()
-
Konstruktordetails
-
Arena
Creates an empty, disabled arena with the given name.- Parameter:
name- the unique arena identifier (lower-case letters, digits and underscores)
-
-
Methodendetails
-
name
- Gibt zurück:
- the unique arena identifier
-
isEnabled
public boolean isEnabled()- Gibt zurück:
- whether the arena is enabled and joinable
-
setEnabled
public void setEnabled(boolean enabled) Sets the enabled state.- Parameter:
enabled- the new state
-
waveSet
- Gibt zurück:
- the name of the wave set this arena uses (default
"default")
-
setWaveSet
Sets the wave set this arena uses (a name defined inwaves.yml).- Parameter:
waveSet- the wave-set name; blank resets to"default"
-
settings
- Gibt zurück:
- an unmodifiable view of the per-arena setting overrides (keys without the
arena.prefix, for examplemin-players)
-
setSetting
Sets or clears a per-arena setting override.- Parameter:
key- the setting key without thearena.prefixvalue- the override value, ornullto clear it
-
intOverride
- Parameter:
key- the setting key without thearena.prefix- Gibt zurück:
- the integer override, or
nullif not set to a number
-
stringOverride
- Parameter:
key- the setting key without thearena.prefix- Gibt zurück:
- the string override, or
nullif not set to a string
-
region
- Gibt zurück:
- the region, or
nullif not yet set
-
setRegion
Sets the arena region.- Parameter:
region- the new region
-
warp
Returns a warp location.- Parameter:
type- the warp type- Gibt zurück:
- the location, or
nullif the warp is not set
-
setWarp
Sets or replaces a warp location.- Parameter:
type- the warp typelocation- the location to store; a defensive clone is kept
-
warps
- Gibt zurück:
- an unmodifiable view of the configured warps
-
addSpawnpoint
Adds or replaces a named spawnpoint.- Parameter:
id- the spawnpoint identifierlocation- the location to store; a defensive clone is kept- Gibt zurück:
trueif an existing spawnpoint with the same id was replaced
-
removeSpawnpoint
Removes a named spawnpoint.- Parameter:
id- the spawnpoint identifier- Gibt zurück:
trueif a spawnpoint was removed
-
spawnpoints
- Gibt zurück:
- an unmodifiable view of the configured spawnpoints, keyed by identifier
-
missingRequirements
Computes the list of unmet requirements that prevent the arena from being enabled.- Gibt zurück:
- a human-readable list of missing items; empty when the arena is ready
-
isReady
public boolean isReady()- Gibt zurück:
trueif all requirements are met and the arena may be enabled
-