Some registry stuff (#1682)

* Some registry stuff

* Remove empty comment
This commit is contained in:
Joseph Burton 2020-08-14 21:30:05 +01:00 committed by GitHub
parent d7f1eebc54
commit 30360d6f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 7 deletions

View File

@ -2,3 +2,4 @@ CLASS net/minecraft/class_2359 net/minecraft/util/collection/IndexedIterable
METHOD method_10200 get (I)Ljava/lang/Object;
ARG 1 index
METHOD method_10206 getRawId (Ljava/lang/Object;)I
ARG 1 entry

View File

@ -11,18 +11,20 @@ CLASS net/minecraft/class_5455 net/minecraft/util/registry/DynamicRegistryManage
COMMENT or configuration of dynamic registries.</p>
FIELD field_25918 LOGGER Lorg/apache/logging/log4j/Logger;
FIELD field_25919 INFOS Ljava/util/Map;
FIELD field_26733 BUILTIN Lnet/minecraft/class_5455$class_5457;
METHOD method_30518 getDimensionTypes ()Lnet/minecraft/class_2378;
METHOD method_30519 load (Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5382;)V
COMMENT Loads a dynamic registry manager from the resource manager's data files.
METHOD method_30520 register (Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)V
ARG 0 infosBuilder
ARG 1 registryRef
ARG 2 entryCodec
METHOD method_30524 addBuiltinEntries (Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_2378;)V
COMMENT Add all entries of the {@code registry} to the corresponding registry
COMMENT within this manager.
ARG 0 manager
ARG 1 registry
METHOD method_30525 setupBuiltin (Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5321;)V
METHOD method_30525 copyFromBuiltin (Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5321;)V
COMMENT Add all entries of the registry referred by {@code registryRef} to the
COMMENT corresponding registry within this manager.
ARG 0 manager
@ -45,17 +47,26 @@ CLASS net/minecraft/class_5455 net/minecraft/util/registry/DynamicRegistryManage
COMMENT
COMMENT @throws IllegalStateException if the registry does not exist
ARG 1 key
METHOD method_31060 register (Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)V
ARG 0 infosBuilder
ARG 1 registryRef
ARG 2 entryCodec
ARG 3 networkEntryCodec
CLASS class_5456 Info
COMMENT Represents the serialization behavior of the registries, including the
COMMENT id of the registry, the codec for its elements, and whether the registry
COMMENT should be sent to the client.
FIELD field_25920 registry Lnet/minecraft/class_5321;
FIELD field_25921 elementCodec Lcom/mojang/serialization/Codec;
FIELD field_25921 entryCodec Lcom/mojang/serialization/Codec;
FIELD field_26687 networkEntryCodec Lcom/mojang/serialization/Codec;
METHOD <init> (Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)V
ARG 1 registry
ARG 2 entryCodec
ARG 3 networkEntryCodec
METHOD method_30535 getRegistry ()Lnet/minecraft/class_5321;
METHOD method_30536 getElementCodec ()Lcom/mojang/serialization/Codec;
METHOD method_30536 getEntryCodec ()Lcom/mojang/serialization/Codec;
METHOD method_30537 isSynced ()Z
METHOD method_31061 getNetworkEntryCodec ()Lcom/mojang/serialization/Codec;
CLASS class_5457 Impl
COMMENT An immutable implementation of the dynamic registry manager, representing
COMMENT a specialized configuration of registries. It has a codec that allows

View File

@ -6,3 +6,14 @@ CLASS net/minecraft/class_2385 net/minecraft/util/registry/MutableRegistry
ARG 1 rawId
ARG 2 key
ARG 3 entry
METHOD method_31062 replace (Ljava/util/OptionalInt;Lnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Ljava/lang/Object;
COMMENT If the given key is already present in the registry, replaces the entry associated with the given
COMMENT key with the new entry. This method asserts that the raw ID is equal to the value already in
COMMENT the registry. The raw ID not being present may lead to buggy behavior.
COMMENT
COMMENT <p>If the given key is not already present in the registry, adds the entry to the registry. If
COMMENT {@code rawId} is present, then this method gives the entry this raw ID. Otherwise, uses the
COMMENT next available ID.</p>
ARG 1 rawId
ARG 2 key
ARG 3 newEntry

View File

@ -145,6 +145,13 @@ CLASS net/minecraft/class_2378 net/minecraft/util/registry/Registry
ARG 1 defaultId
ARG 3 defaultEntry
METHOD method_29113 getKey (Ljava/lang/Object;)Ljava/util/Optional;
ARG 1 value
ARG 1 entry
METHOD method_29722 getEntries ()Ljava/util/Set;
METHOD method_30517 getKey ()Lnet/minecraft/class_5321;
METHOD method_31138 getLifecycle ()Lcom/mojang/serialization/Lifecycle;
METHOD method_31139 getEntryLifecycle (Ljava/lang/Object;)Lcom/mojang/serialization/Lifecycle;
ARG 1 entry
METHOD method_31140 getOrThrow (Lnet/minecraft/class_5321;)Ljava/lang/Object;
ARG 1 key
METHOD method_31189 getOrEmpty (Lnet/minecraft/class_5321;)Ljava/util/Optional;
ARG 1 key

View File

@ -45,3 +45,7 @@ CLASS net/minecraft/class_5321 net/minecraft/util/registry/RegistryKey
METHOD method_29181 of (Lnet/minecraft/class_2960;Lnet/minecraft/class_2960;)Lnet/minecraft/class_5321;
ARG 0 registry
ARG 1 value
METHOD method_31163 isOf (Lnet/minecraft/class_5321;)Z
COMMENT Returns whether this registry key belongs to the given registry (according to its type, not whether the registry actually contains this key).
ARG 1 registry
COMMENT the key of the registry that this registry key should be inside

View File

@ -1,10 +1,34 @@
CLASS net/minecraft/class_2370 net/minecraft/util/registry/SimpleRegistry
FIELD field_11107 entriesById Lcom/google/common/collect/BiMap;
FIELD field_11107 idToEntry Lcom/google/common/collect/BiMap;
FIELD field_11108 randomEntries [Ljava/lang/Object;
FIELD field_11109 nextId I
FIELD field_11111 LOGGER Lorg/apache/logging/log4j/Logger;
FIELD field_25067 entriesByKey Lcom/google/common/collect/BiMap;
FIELD field_25067 keyToEntry Lcom/google/common/collect/BiMap;
FIELD field_26682 rawIdToEntry Lit/unimi/dsi/fastutil/objects/ObjectList;
FIELD field_26683 entryToRawId Lit/unimi/dsi/fastutil/objects/Object2IntMap;
FIELD field_26731 entryToLifecycle Ljava/util/Map;
FIELD field_26732 lifecycle Lcom/mojang/serialization/Lifecycle;
METHOD method_10240 getRandom (Ljava/util/Random;)Ljava/lang/Object;
METHOD method_29721 createCodec (Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
METHOD method_29098 createRegistryManagerCodec (Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
ARG 2 entryCodec
METHOD method_29721 createRegistryCodec (Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
ARG 0 registryRef
ARG 1 lifecycle
ARG 2 entryCodec
METHOD method_30929 createRegistryManagerEntryCodec (Lnet/minecraft/class_5321;Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/MapCodec;
ARG 1 entryCodec
METHOD method_31051 set (ILnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;Z)Ljava/lang/Object;
ARG 1 rawId
ARG 2 key
ARG 3 entry
ARG 5 checkDuplicateKeys
METHOD method_31059 createCodec (Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
ARG 2 entryCodec
CLASS class_5501 RegistryManagerEntry
FIELD field_26684 key Lnet/minecraft/class_5321;
FIELD field_26685 rawId I
FIELD field_26686 entry Ljava/lang/Object;
METHOD <init> (Lnet/minecraft/class_5321;ILjava/lang/Object;)V
ARG 1 key
ARG 2 rawId
ARG 3 entry