Klasse ClassRegistry

java.lang.Object
de.delinkedde.mobarenareborn.classes.ClassRegistry

public final class ClassRegistry extends Object
Loads and holds the configured classes from classes.yml.

On first run the bundled default classes.yml is written to the data folder. Each class entry defines a role, base health, an inventory (armor, weapon, off-hand, extras) and the level rewards. Malformed entries are skipped with a warning rather than aborting the load.

  • Konstruktordetails

    • ClassRegistry

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

    • load

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

      public void register(@NotNull @NotNull ArenaClass arenaClass)
      Registers (or replaces) a class.
      Parameter:
      arenaClass - the class to register
    • get

      @NotNull public @NotNull Optional<ArenaClass> get(@NotNull @NotNull String name)
      Resolves a class by name, ignoring case.
      Parameter:
      name - the class identifier
      Gibt zurück:
      the class, if present
    • all

      @NotNull public @NotNull Collection<ArenaClass> all()
      Gibt zurück:
      an unmodifiable view of all classes
    • names

      @NotNull public @NotNull Set<String> names()
      Gibt zurück:
      an unmodifiable view of all class identifiers