Class DefaultedRegistry<T>

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

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

    • defaultId

      private final Identifier defaultId
      Mappings:
      Namespace Name Mixin selector
      official bp Lgb;bp:Lwb;
      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;
    • defaultValue

      private T defaultValue
      Mappings:
      Namespace Name Mixin selector
      official bq Lgb;bq:Ljava/lang/Object;
      intermediary field_11015 Lnet/minecraft/class_2348;field_11015:Ljava/lang/Object;
      named defaultValue Lnet/minecraft/util/registry/DefaultedRegistry;defaultValue:Ljava/lang/Object;
  • Constructor Details

    • DefaultedRegistry

      public DefaultedRegistry​(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lgb;<init>(Ljava/lang/String;Lwa;Lcom/mojang/serialization/Lifecycle;)V
      intermediary <init> Lnet/minecraft/class_2348;<init>(Ljava/lang/String;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;)V
      named <init> Lnet/minecraft/util/registry/DefaultedRegistry;<init>(Ljava/lang/String;Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Lifecycle;)V
  • Method Details

    • set

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

      public int getRawId​(@Nullable T entry)
      Specified by:
      getRawId in interface IndexedIterable<T>
      Overrides:
      getRawId in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgg;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

      @Nonnull public Identifier getId​(T entry)
      Overrides:
      getId in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official b Lgn;b(Ljava/lang/Object;)Lwb;
      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

      @Nonnull public T get​(@Nullable Identifier id)
      Overrides:
      get in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgn;a(Lwb;)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 Identifier id)
      Overrides:
      getOrEmpty in class Registry<T>
      Mappings:
      Namespace Name Mixin selector
      official b Lgn;b(Lwb;)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

      @Nonnull 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 Lgg;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

      @Nonnull public T getRandom​(Random random)
      Overrides:
      getRandom in class SimpleRegistry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgi;a(Ljava/util/Random;)Ljava/lang/Object;
      intermediary method_10240 Lnet/minecraft/class_2370;method_10240(Ljava/util/Random;)Ljava/lang/Object;
      named getRandom Lnet/minecraft/util/registry/SimpleRegistry;getRandom(Ljava/util/Random;)Ljava/lang/Object;
    • getDefaultId

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