Klasse Arena

java.lang.Object
de.delinkedde.mobarenareborn.arena.Arena

public final class Arena extends Object
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.

  • Konstruktordetails

    • Arena

      public Arena(@NotNull @NotNull String name)
      Creates an empty, disabled arena with the given name.
      Parameter:
      name - the unique arena identifier (lower-case letters, digits and underscores)
  • Methodendetails

    • name

      @NotNull public @NotNull String 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

      @NotNull public @NotNull String waveSet()
      Gibt zurück:
      the name of the wave set this arena uses (default "default")
    • setWaveSet

      public void setWaveSet(@Nullable @Nullable String waveSet)
      Sets the wave set this arena uses (a name defined in waves.yml).
      Parameter:
      waveSet - the wave-set name; blank resets to "default"
    • settings

      @NotNull public @NotNull Map<String,Object> settings()
      Gibt zurück:
      an unmodifiable view of the per-arena setting overrides (keys without the arena. prefix, for example min-players)
    • setSetting

      public void setSetting(@NotNull @NotNull String key, @Nullable @Nullable Object value)
      Sets or clears a per-arena setting override.
      Parameter:
      key - the setting key without the arena. prefix
      value - the override value, or null to clear it
    • intOverride

      @Nullable public @Nullable Integer intOverride(@NotNull @NotNull String key)
      Parameter:
      key - the setting key without the arena. prefix
      Gibt zurück:
      the integer override, or null if not set to a number
    • stringOverride

      @Nullable public @Nullable String stringOverride(@NotNull @NotNull String key)
      Parameter:
      key - the setting key without the arena. prefix
      Gibt zurück:
      the string override, or null if not set to a string
    • region

      @Nullable public @Nullable Region region()
      Gibt zurück:
      the region, or null if not yet set
    • setRegion

      public void setRegion(@Nullable @Nullable Region region)
      Sets the arena region.
      Parameter:
      region - the new region
    • warp

      @Nullable public @Nullable Location warp(@NotNull @NotNull WarpType type)
      Returns a warp location.
      Parameter:
      type - the warp type
      Gibt zurück:
      the location, or null if the warp is not set
    • setWarp

      public void setWarp(@NotNull @NotNull WarpType type, @NotNull @NotNull Location location)
      Sets or replaces a warp location.
      Parameter:
      type - the warp type
      location - the location to store; a defensive clone is kept
    • warps

      @NotNull public @NotNull Map<WarpType,Location> warps()
      Gibt zurück:
      an unmodifiable view of the configured warps
    • addSpawnpoint

      public boolean addSpawnpoint(@NotNull @NotNull String id, @NotNull @NotNull Location location)
      Adds or replaces a named spawnpoint.
      Parameter:
      id - the spawnpoint identifier
      location - the location to store; a defensive clone is kept
      Gibt zurück:
      true if an existing spawnpoint with the same id was replaced
    • removeSpawnpoint

      public boolean removeSpawnpoint(@NotNull @NotNull String id)
      Removes a named spawnpoint.
      Parameter:
      id - the spawnpoint identifier
      Gibt zurück:
      true if a spawnpoint was removed
    • spawnpoints

      @NotNull public @NotNull Map<String,Location> spawnpoints()
      Gibt zurück:
      an unmodifiable view of the configured spawnpoints, keyed by identifier
    • missingRequirements

      @NotNull public @NotNull List<String> 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:
      true if all requirements are met and the arena may be enabled