Class Registry<T extends Keyed>

java.lang.Object
net.pl3x.map.core.registry.Registry<T>
All Implemented Interfaces:
Iterable<@NotNull T>
Direct Known Subclasses:
BiomeRegistry, BlockRegistry, HeightmapRegistry, IconRegistry, PlayerRegistry, RendererRegistry, WorldRegistry

public class Registry<T extends Keyed> extends Object implements Iterable<@NotNull T>
  • Field Details

    • entries

      protected final Map<@NotNull String,@NotNull T extends Keyed> entries
  • Constructor Details

    • Registry

      public Registry()
  • Method Details

    • register

      @NotNull public T register(@NotNull T value)
    • register

      @NotNull public T register(@NotNull @NotNull String id, @NotNull T value)
    • unregister

      @Nullable public T unregister(@NotNull @NotNull String id)
    • unregister

      public void unregister()
      Unregister all entries.
    • has

      public boolean has(@NotNull @NotNull String key)
    • get

      @Nullable public T get(@NotNull @NotNull String id)
    • getOrDefault

      @NotNull public T getOrDefault(@NotNull @NotNull String id, @NotNull T def)
    • entrySet

      @NotNull public @NotNull Set<@NotNull Map.Entry<@NotNull String,@NotNull T>> entrySet()
    • values

      @NotNull public @NotNull Collection<@NotNull T> values()
    • size

      public int size()
    • iterator

      @NotNull public @NotNull Iterator<@NotNull T> iterator()
      Specified by:
      iterator in interface Iterable<T extends Keyed>