Klasse ArenaManager
java.lang.Object
de.delinkedde.mobarenareborn.arena.ArenaManager
Owns the in-memory registry of arenas and their on-disk representation.
Arenas live in plugins/MobArenaReborn/arenas/, one YAML file per arena. The
manager loads them on start-up and provides create, remove, lookup and save operations.
Arena identifiers are normalised to lower case and validated against
NAME_PATTERN.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final PatternPermitted arena identifiers: lower-case letters, digits and underscores, 1 to 32 chars. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungArenaManager(@NotNull MobArenaPlugin plugin) Creates an arena manager bound to the plugin's data folder. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@NotNull Collection<Arena> all()Finds the arena whose region contains the given location.@NotNull ArenaCreates a new, empty, disabled arena and persists it.Looks up an arena by name, ignoring case.voidloadAll()Loads (or reloads) every arena from disk, replacing the in-memory registry.names()booleanRemoves an arena and deletes its file.voidPersists the current state of an arena to disk.
-
Felddetails
-
NAME_PATTERN
Permitted arena identifiers: lower-case letters, digits and underscores, 1 to 32 chars.
-
-
Konstruktordetails
-
ArenaManager
Creates an arena manager bound to the plugin's data folder.- Parameter:
plugin- the owning plugin instance
-
-
Methodendetails
-
loadAll
public void loadAll()Loads (or reloads) every arena from disk, replacing the in-memory registry. -
get
Looks up an arena by name, ignoring case.- Parameter:
name- the arena identifier- Gibt zurück:
- the arena, if present
-
all
- Gibt zurück:
- an unmodifiable view of all loaded arenas
-
arenaAt
Finds the arena whose region contains the given location.- Parameter:
location- the location to test- Gibt zurück:
- the containing arena, if any
-
names
- Gibt zurück:
- an unmodifiable view of all arena identifiers
-
create
Creates a new, empty, disabled arena and persists it.- Parameter:
name- the desired identifier- Gibt zurück:
- the created arena
- Löst aus:
IllegalArgumentException- if the name is invalid or already in useIOException- if the arena file cannot be written
-
remove
Removes an arena and deletes its file.- Parameter:
name- the arena identifier- Gibt zurück:
trueif an arena was removed- Löst aus:
IOException- if the arena file exists but cannot be deleted
-
save
Persists the current state of an arena to disk.- Parameter:
arena- the arena to save- Löst aus:
IOException- if the arena file cannot be written
-