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 gx
intermediary net/minecraft/class_2348
named net/minecraft/util/registry/DefaultedRegistry
  • Field Details

    • defaultId

      private final Identifier defaultId
      Mappings:
      Namespace Name Mixin selector
      official bR Lgx;bR:Labb;
      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 bS Lgx;bS:Lhc;
      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> Lgx;<init>(Ljava/lang/String;Laba;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 Lht;a(ILaba;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lhc;
      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 Lhf;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 Lhm;b(Ljava/lang/Object;)Labb;
      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 Lhm;a(Labb;)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 Lhm;b(Labb;)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 Lhf;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 Lhm;a(Lamn;)Ljava/util/Optional;
      intermediary method_10240 Lnet/minecraft/class_2378;method_10240(Lnet/minecraft/class_5819;)Ljava/util/Optional;
      named getRandom Lnet/minecraft/util/registry/Registry;getRandom(Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;
    • getDefaultId

      public Identifier getDefaultId()
      Mappings:
      Namespace Name Mixin selector
      official a Lgx;a()Labb;
      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;