Class PlatformRegistryImpl<T>

java.lang.Object
com.refinedmods.refinedstorage.common.support.registry.PlatformRegistryImpl<T>
All Implemented Interfaces:
PlatformRegistry<T>

public class PlatformRegistryImpl<T> extends Object implements PlatformRegistry<T>
  • Constructor Details

    • PlatformRegistryImpl

      public PlatformRegistryImpl()
  • Method Details

    • register

      public void register(net.minecraft.resources.ResourceLocation id, T value)
      Description copied from interface: PlatformRegistry
      Registers a value in the registry, identified by the id. Duplicate IDs or values are not allowed.
      Specified by:
      register in interface PlatformRegistry<T>
      Parameters:
      id - the id
      value - the value
    • getId

      public Optional<net.minecraft.resources.ResourceLocation> getId(T value)
      Specified by:
      getId in interface PlatformRegistry<T>
      Parameters:
      value - the value
      Returns:
      the id of the value, if present
    • get

      public Optional<T> get(net.minecraft.resources.ResourceLocation id)
      Specified by:
      get in interface PlatformRegistry<T>
      Parameters:
      id - the id
      Returns:
      the value, if present
    • getAll

      public List<T> getAll()
      Specified by:
      getAll in interface PlatformRegistry<T>
      Returns:
      an unmodifiable list of all values
    • nextOrNullIfLast

      @Nullable public T nextOrNullIfLast(T value)
      Description copied from interface: PlatformRegistry
      Returns the next value in the ordered list. If the value is not found, it will return the first value. If the value is the last value in the ordered list, it will return null.
      Specified by:
      nextOrNullIfLast in interface PlatformRegistry<T>
      Parameters:
      value - the given value
      Returns:
      the next value after the given value, or null if it's the last value
    • codec

      public com.mojang.serialization.Codec<T> codec()
      Specified by:
      codec in interface PlatformRegistry<T>
      Returns:
      a Codec for this registry
    • streamCodec

      public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T> streamCodec()
      Specified by:
      streamCodec in interface PlatformRegistry<T>
      Returns:
      a StreamCodec for this registry