Class DefaultedRegistry<T>

All Implemented Interfaces:
com.mojang.serialization.Keyable, Iterable<T>, IndexedIterable<T>

public class DefaultedRegistry<T> extends SimpleRegistry<T>
Mappings:
Namespace Name
official gn
intermediary net/minecraft/class_2348
named net/minecraft/util/registry/DefaultedRegistry
  • Field Details

    • defaultId

      private final Identifier defaultId
      Mappings:
      Namespace Name Mixin selector
      official bC Lgn;bC:Lyt;
      intermediary field_11014 Lnet/minecraft/class_2348;field_11014:Lnet/minecraft/class_2960;
      named defaultId Lnet/minecraft/util/registry/DefaultedRegistry;defaultId:Lnet/minecraft/util/Identifier;
    • defaultEntry

      private RegistryEntry<T> defaultEntry
      Mappings:
      Namespace Name Mixin selector
      official bD Lgn;bD:Lgs;
      intermediary field_11015 Lnet/minecraft/class_2348;field_11015:Lnet/minecraft/class_6880;
      named defaultEntry Lnet/minecraft/util/registry/DefaultedRegistry;defaultEntry:Lnet/minecraft/util/registry/RegistryEntry;
  • Constructor Details

    • DefaultedRegistry

      public DefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, @Nullable @Nullable Function<T,RegistryEntry.Reference<T>> valueToEntryFunction)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lgn;<init>(Ljava/lang/String;Lys;Lcom/mojang/serialization/Lifecycle;Ljava/util/function/Function;)V
      intermediary <init> Lnet/minecraft/class_2348;<init>(Ljava/lang/String;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Ljava/util/function/Function;)V
      named <init> Lnet/minecraft/util/registry/DefaultedRegistry;<init>(Ljava/lang/String;Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Lifecycle;Ljava/util/function/Function;)V
  • Method Details

    • set

      public RegistryEntry<T> set(int rawId, RegistryKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle)
      Overrides:
      set in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lhi;a(ILys;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lgs;
      intermediary method_10273 Lnet/minecraft/class_2385;method_10273(ILnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/class_6880;
      named set Lnet/minecraft/util/registry/MutableRegistry;set(ILnet/minecraft/util/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/util/registry/RegistryEntry;
    • getRawId

      public int getRawId(@Nullable T value)
      Specified by:
      getRawId in interface IndexedIterable<T>
      Overrides:
      getRawId in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgu;a(Ljava/lang/Object;)I
      intermediary method_10206 Lnet/minecraft/class_2359;method_10206(Ljava/lang/Object;)I
      named getRawId Lnet/minecraft/util/collection/IndexedIterable;getRawId(Ljava/lang/Object;)I
    • getId

      @NotNull public @NotNull Identifier getId(T value)
      Overrides:
      getId in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official b Lhb;b(Ljava/lang/Object;)Lyt;
      intermediary method_10221 Lnet/minecraft/class_2378;method_10221(Ljava/lang/Object;)Lnet/minecraft/class_2960;
      named getId Lnet/minecraft/util/registry/Registry;getId(Ljava/lang/Object;)Lnet/minecraft/util/Identifier;
    • get

      Overrides:
      get in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lhb;a(Lyt;)Ljava/lang/Object;
      intermediary method_10223 Lnet/minecraft/class_2378;method_10223(Lnet/minecraft/class_2960;)Ljava/lang/Object;
      named get Lnet/minecraft/util/registry/Registry;get(Lnet/minecraft/util/Identifier;)Ljava/lang/Object;
    • getOrEmpty

      public Optional<T> getOrEmpty(@Nullable @Nullable Identifier id)
      Overrides:
      getOrEmpty in class Registry<T>
      Mappings:
      Namespace Name Mixin selector
      official b Lhb;b(Lyt;)Ljava/util/Optional;
      intermediary method_17966 Lnet/minecraft/class_2378;method_17966(Lnet/minecraft/class_2960;)Ljava/util/Optional;
      named getOrEmpty Lnet/minecraft/util/registry/Registry;getOrEmpty(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
    • get

      @NotNull public T get(int index)
      Specified by:
      get in interface IndexedIterable<T>
      Overrides:
      get in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgu;a(I)Ljava/lang/Object;
      intermediary method_10200 Lnet/minecraft/class_2359;method_10200(I)Ljava/lang/Object;
      named get Lnet/minecraft/util/collection/IndexedIterable;get(I)Ljava/lang/Object;
    • getRandom

      public Optional<RegistryEntry<T>> getRandom(Random random)
      Overrides:
      getRandom in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lhb;a(Ljava/util/Random;)Ljava/util/Optional;
      intermediary method_10240 Lnet/minecraft/class_2378;method_10240(Ljava/util/Random;)Ljava/util/Optional;
      named getRandom Lnet/minecraft/util/registry/Registry;getRandom(Ljava/util/Random;)Ljava/util/Optional;
    • getDefaultId

      public Identifier getDefaultId()
      Mappings:
      Namespace Name Mixin selector
      official a Lgn;a()Lyt;
      intermediary method_10137 Lnet/minecraft/class_2348;method_10137()Lnet/minecraft/class_2960;
      named getDefaultId Lnet/minecraft/util/registry/DefaultedRegistry;getDefaultId()Lnet/minecraft/util/Identifier;