Klasse BossRegistry

java.lang.Object
de.delinkedde.mobarenareborn.boss.BossRegistry

public final class BossRegistry extends Object
Loads and holds the configured bosses from bosses.yml.

On first run the bundled default bosses.yml is written to the data folder. Each entry is parsed by BossDefinition.fromSection(String, ConfigurationSection); malformed entries are skipped with a warning rather than aborting the load.

  • Konstruktordetails

    • BossRegistry

      public BossRegistry(@NotNull @NotNull MobArenaPlugin plugin)
      Parameter:
      plugin - the owning plugin
  • Methodendetails

    • random

      @NotNull public Optional<BossDefinition> random()
      Gibt zurück:
      a random registered boss definition, if any exist
    • load

      public void load()
      Loads (or reloads) all bosses from bosses.yml, writing the default file if absent.
    • register

      public void register(@NotNull @NotNull BossDefinition definition)
      Registers (or replaces) a boss definition.
      Parameter:
      definition - the definition to register
    • get

      @NotNull public @NotNull Optional<BossDefinition> get(@NotNull @NotNull String id)
      Resolves a boss by identifier, ignoring case.
      Parameter:
      id - the boss identifier
      Gibt zurück:
      the definition, if present
    • any

      @NotNull public @NotNull Optional<BossDefinition> any()
      Returns the first registered boss, used as the fallback for boss waves.
      Gibt zurück:
      the first boss, if any are defined
    • all

      @NotNull public @NotNull Collection<BossDefinition> all()
      Gibt zurück:
      an unmodifiable view of all boss definitions