Klasse MobRegistry

java.lang.Object
de.delinkedde.mobarenareborn.mob.MobRegistry

public final class MobRegistry extends Object
Registry of spawnable MobType definitions.

Lookups are tolerant of formatting: identifiers are normalised by lower-casing and removing every character that is not a letter or digit, so zombie_villager, Zombie-Villager and zombievillager all resolve to the same type. The default vanilla roster is registered on construction; further types can be added via register(MobType).

  • Konstruktordetails

    • MobRegistry

      public MobRegistry()
      Creates a registry pre-populated with the default vanilla mob roster.
  • Methodendetails

    • register

      public void register(@NotNull @NotNull MobType type)
      Registers (or replaces) a mob type.
      Parameter:
      type - the type to register
    • get

      @NotNull public @NotNull Optional<MobType> get(@NotNull @NotNull String name)
      Resolves a mob type by identifier, ignoring case, underscores, hyphens and dots.
      Parameter:
      name - the identifier as written in configuration
      Gibt zurück:
      the matching type, if registered
    • ids

      @NotNull public @NotNull Set<String> ids()
      Gibt zurück:
      an unmodifiable view of all registered (normalised) identifiers
    • normalise

      @NotNull public static @NotNull String normalise(@NotNull @NotNull String name)
      Normalises an identifier for tolerant lookup.
      Parameter:
      name - the raw identifier
      Gibt zurück:
      the identifier reduced to lower-case letters and digits