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 hd
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> Lgx;<init>(Lya;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 <V extends T> V set(int rawId, RegistryKey<T> key, V entry, com.mojang.serialization.Lifecycle lifecycle)
      Mappings:
      Namespace Name Mixin selector
      official a Lhd;a(ILya;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;
    • add

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

      public abstract <V extends T> V replace(OptionalInt rawId, RegistryKey<T> key, V 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 Lhd;a(Ljava/util/OptionalInt;Lya;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Ljava/lang/Object;
      intermediary method_31062 Lnet/minecraft/class_2385;method_31062(Ljava/util/OptionalInt;Lnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Ljava/lang/Object;
      named replace Lnet/minecraft/util/registry/MutableRegistry;replace(Ljava/util/OptionalInt;Lnet/minecraft/util/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Ljava/lang/Object;
    • isEmpty

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