Class RegistryReadingOps<T>

java.lang.Object
net.minecraft.util.dynamic.ForwardingDynamicOps<T>
net.minecraft.util.dynamic.RegistryReadingOps<T>
All Implemented Interfaces:
com.mojang.serialization.DynamicOps<T>

public class RegistryReadingOps<T> extends ForwardingDynamicOps<T>
A dynamic ops that encode an id for a registry element rather than a full object.
See Also:
Encoder.encode(Object, DynamicOps, Object)
Mappings:
Namespace Name
official wu
intermediary net/minecraft/class_5384
named net/minecraft/util/dynamic/RegistryReadingOps
  • Field Details

    • manager

      private final DynamicRegistryManager manager
      Mappings:
      Namespace Name Mixin selector
      official b Lwu;b:Lgx;
      intermediary field_25514 Lnet/minecraft/class_5384;field_25514:Lnet/minecraft/class_5455;
      named manager Lnet/minecraft/util/dynamic/RegistryReadingOps;manager:Lnet/minecraft/util/registry/DynamicRegistryManager;
  • Constructor Details

    • RegistryReadingOps

      private RegistryReadingOps(com.mojang.serialization.DynamicOps<T> delegate, DynamicRegistryManager tracker)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwu;<init>(Lcom/mojang/serialization/DynamicOps;Lgx;)V
      intermediary <init> Lnet/minecraft/class_5384;<init>(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_5455;)V
      named <init> Lnet/minecraft/util/dynamic/RegistryReadingOps;<init>(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/util/registry/DynamicRegistryManager;)V
  • Method Details

    • of

      public static <T> RegistryReadingOps<T> of(com.mojang.serialization.DynamicOps<T> delegate, DynamicRegistryManager tracker)
      Mappings:
      Namespace Name Mixin selector
      official a Lwu;a(Lcom/mojang/serialization/DynamicOps;Lgx;)Lwu;
      intermediary method_29771 Lnet/minecraft/class_5384;method_29771(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_5455;)Lnet/minecraft/class_5384;
      named of Lnet/minecraft/util/dynamic/RegistryReadingOps;of(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/util/registry/DynamicRegistryManager;)Lnet/minecraft/util/dynamic/RegistryReadingOps;
    • encodeOrId

      protected <E> com.mojang.serialization.DataResult<T> encodeOrId(E input, T prefix, RegistryKey<? extends Registry<E>> registryReference, com.mojang.serialization.Codec<E> codec)
      Encode an id for a registry element than a full object if possible.

      This method is called by casting an arbitrary dynamic ops to a registry reading ops.

      See Also:
      RegistryOps.decodeOrId(Object, RegistryKey, Codec, boolean)
      Mappings:
      Namespace Name Mixin selector
      official a Lwu;a(Ljava/lang/Object;Ljava/lang/Object;Lwv;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/DataResult;
      intermediary method_29772 Lnet/minecraft/class_5384;method_29772(Ljava/lang/Object;Ljava/lang/Object;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/DataResult;
      named encodeOrId Lnet/minecraft/util/dynamic/RegistryReadingOps;encodeOrId(Ljava/lang/Object;Ljava/lang/Object;Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/DataResult;