Class MutableRegistry<T>

java.lang.Object
net.minecraft.util.registry.Registry<T>
net.minecraft.util.registry.MutableRegistry<T>
All Implemented Interfaces:
com.mojang.serialization.Keyable, Iterable<T>, IndexedIterable<T>
Direct Known Subclasses:
SimpleRegistry

public abstract class MutableRegistry<T> extends Registry<T>
Mappings:
Namespace Name
official ht
intermediary net/minecraft/class_2385
named net/minecraft/util/registry/MutableRegistry
  • Constructor Details

    • MutableRegistry

      public MutableRegistry(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lhm;<init>(Laba;Lcom/mojang/serialization/Lifecycle;)V
      intermediary <init> Lnet/minecraft/class_2378;<init>(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;)V
      named <init> Lnet/minecraft/util/registry/Registry;<init>(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Lifecycle;)V
  • Method Details

    • set

      public abstract RegistryEntry<T> set(int rawId, RegistryKey<T> key, T value, com.mojang.serialization.Lifecycle lifecycle)
      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;
    • add

      public abstract RegistryEntry<T> add(RegistryKey<T> key, T entry, com.mojang.serialization.Lifecycle lifecycle)
      Mappings:
      Namespace Name Mixin selector
      official a Lht;a(Laba;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lhc;
      intermediary method_10272 Lnet/minecraft/class_2385;method_10272(Lnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/class_6880;
      named add Lnet/minecraft/util/registry/MutableRegistry;add(Lnet/minecraft/util/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/util/registry/RegistryEntry;
    • replace

      public abstract RegistryEntry<T> replace(OptionalInt rawId, RegistryKey<T> key, T newEntry, com.mojang.serialization.Lifecycle lifecycle)
      If the given key is already present in the registry, replaces the entry associated with the given key with the new entry. This method asserts that the raw ID is equal to the value already in the registry. The raw ID not being present may lead to buggy behavior.

      If the given key is not already present in the registry, adds the entry to the registry. If rawId is present, then this method gives the entry this raw ID. Otherwise, uses the next available ID.

      Mappings:
      Namespace Name Mixin selector
      official a Lht;a(Ljava/util/OptionalInt;Laba;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lhc;
      intermediary method_31062 Lnet/minecraft/class_2385;method_31062(Ljava/util/OptionalInt;Lnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/class_6880;
      named replace Lnet/minecraft/util/registry/MutableRegistry;replace(Ljava/util/OptionalInt;Lnet/minecraft/util/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/util/registry/RegistryEntry;
    • isEmpty

      public abstract boolean isEmpty()
      Mappings:
      Namespace Name Mixin selector
      official j Lht;j()Z
      intermediary method_35863 Lnet/minecraft/class_2385;method_35863()Z
      named isEmpty Lnet/minecraft/util/registry/MutableRegistry;isEmpty()Z