Clearer and more accurate naming for some component stuff (#3805)

* Clearer naming for some component stuff

* more

* a few more renames and javadoc tweaks
This commit is contained in:
Shnupbups 2024-03-01 23:27:31 +11:00 committed by GitHub
parent a5fe6de797
commit 0ca64f33da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 30 deletions

View File

@ -2,10 +2,10 @@ CLASS net/minecraft/class_9326 net/minecraft/component/ComponentChanges
FIELD field_49588 EMPTY Lnet/minecraft/class_9326;
FIELD field_49589 CODEC Lcom/mojang/serialization/Codec;
FIELD field_49590 PACKET_CODEC Lnet/minecraft/class_9139;
FIELD field_49591 changes Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;
FIELD field_49591 changedComponents Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;
FIELD field_49592 REMOVE_PREFIX Ljava/lang/String;
METHOD <init> (Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;)V
ARG 1 changes
ARG 1 changedComponents
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_57841 builder ()Lnet/minecraft/class_9326$class_9327;

View File

@ -1,20 +1,20 @@
CLASS net/minecraft/class_9335 net/minecraft/component/ComponentMapImpl
FIELD field_49654 baseComponents Lnet/minecraft/class_9323;
FIELD field_49655 extraComponents Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;
FIELD field_49655 changedComponents Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;
FIELD field_49656 copyOnWrite Z
METHOD <init> (Lnet/minecraft/class_9323;)V
ARG 1 baseComponents
METHOD <init> (Lnet/minecraft/class_9323;Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;Z)V
ARG 1 baseComponents
ARG 2 extraComponents
ARG 2 changedComponents
ARG 3 copyOnWrite
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_57933 copyFrom (Lnet/minecraft/class_9323;)V
METHOD method_57933 setAll (Lnet/minecraft/class_9323;)V
ARG 1 components
METHOD method_57934 shouldReuseChangesMap (Lnet/minecraft/class_9323;Lit/unimi/dsi/fastutil/objects/Reference2ObjectMap;)Z
ARG 0 baseComponents
ARG 1 changes
ARG 1 changedComponents
METHOD method_57935 create (Lnet/minecraft/class_9323;Lnet/minecraft/class_9326;)Lnet/minecraft/class_9335;
ARG 0 baseComponents
ARG 1 changes

View File

@ -44,7 +44,7 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item
METHOD method_16698 isNetworkSynced ()Z
COMMENT {@return whether the item needs to sync additional data to clients}
COMMENT
COMMENT <p>Items should ideally store all necessary information on the stack's NBT.
COMMENT <p>Items should ideally store all necessary information in the stack's components.
COMMENT However, this is not always possible for things like maps. In those cases,
COMMENT items can send a packet to the player holding it that syncs additional data.
COMMENT Such items must subclass {@link NetworkSyncedItem}.
@ -247,8 +247,8 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item
METHOD method_7854 getDefaultStack ()Lnet/minecraft/class_1799;
COMMENT {@return the default stack for this item}
COMMENT
COMMENT <p>Items that expect certain NBT data in the item stack should override
COMMENT this method to return the stack with the NBT data.
COMMENT <p>Items that expect certain components in the item stack should override
COMMENT this method to return the stack with the component data.
METHOD method_7856 isSuitableFor (Lnet/minecraft/class_2680;)Z
COMMENT Determines whether this item can be used as a suitable tool for mining the specified block.
COMMENT Depending on block implementation, when combined together, the correct item and block may achieve a better mining speed and yield
@ -262,10 +262,10 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item
COMMENT Checks if this item has a remainder item that is left behind when used as a crafting ingredient.
METHOD method_7858 getRecipeRemainder ()Lnet/minecraft/class_1792;
COMMENT Gets the remainder item that should be left behind when this item is used as a crafting ingredient.
METHOD method_7860 postProcessNbt (Lnet/minecraft/class_1799;)V
COMMENT Processes the NBT applied to an item stack of this item.
METHOD method_7860 postProcessComponents (Lnet/minecraft/class_1799;)V
COMMENT Processes the components applied to an item stack of this item.
COMMENT
COMMENT <p>This is only used in vanilla to process player head NBT data.
COMMENT <p>This is only used in vanilla to process player head component data.
ARG 1 stack
METHOD method_7861 finishUsing (Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;)Lnet/minecraft/class_1799;
COMMENT Called when an entity finishes using the item, such as eating food or drinking a potion.

View File

@ -8,8 +8,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
COMMENT method. This also means they cannot be used as a map key. To check if an item stack
COMMENT is of a certain item, use {@link #isOf(Item)}. To compare two item stacks, use {@link
COMMENT #areItemsEqual} to check the item only, or {@link #areEqual} to also check the item
COMMENT count and the NBT. Use {@link #isEmpty} to check if an item stack is empty instead of
COMMENT doing {@code stack == ItemStack.EMPTY}.
COMMENT count and the components. Use {@link #isEmpty} to check if an item stack is empty instead
COMMENT of doing {@code stack == ItemStack.EMPTY}.
COMMENT
COMMENT <p>When storing an item stack in an inventory or other places, make sure that an instance
COMMENT is never stored in multiple places. When two inventories hold the same instance, it
@ -115,8 +115,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 3 clickType
ARG 4 player
ARG 5 cursorStackReference
METHOD method_31577 areItemsAndNbtEqual (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
COMMENT {@return whether the given item stacks' items and NBT are equal}
METHOD method_31577 areItemsAndComponentsEqual (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
COMMENT {@return whether the given item stacks' items and components are equal}
COMMENT
COMMENT <p>If this returns {@code true}, the two item stacks can be combined into one,
COMMENT as long as the resulting item count does not exceed {@linkplain Item#getMaxCount
@ -154,12 +154,12 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
METHOD method_45435 isItemEnabled (Lnet/minecraft/class_7699;)Z
ARG 1 enabledFeatures
METHOD method_46651 copyWithCount (I)Lnet/minecraft/class_1799;
COMMENT {@return a copy of this item stack, including the NBT, and {@linkplain #getBobbingAnimationTime bobbing animation time}},
COMMENT {@return a copy of this item stack, including the components, and {@linkplain #getBobbingAnimationTime bobbing animation time}},
COMMENT with the item count set to {@code count}
COMMENT
COMMENT @see #copy
COMMENT @see #copyNbtToNewStack
COMMENT @see #copyNbtToNewStackIgnoreEmpty
COMMENT @see #copyComponentsToNewStack
COMMENT @see #copyComponentsToNewStackIgnoreEmpty
ARG 1 count
COMMENT the item count of the resultant stack
METHOD method_51164 copyAndEmpty ()Lnet/minecraft/class_1799;
@ -171,12 +171,12 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 0 instance
METHOD method_56700 (Lnet/minecraft/class_1799;)Ljava/util/Optional;
ARG 0 stack
METHOD method_56701 copyNbtToNewStack (Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;
COMMENT {@return a new item stack with the NBT copied from this item stack}
METHOD method_56701 copyComponentsToNewStack (Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;
COMMENT {@return a new item stack with the components copied from this item stack}
COMMENT
COMMENT @see #copy
COMMENT @see #copyWithCount
COMMENT @see #copyNbtToNewStackIgnoreEmpty
COMMENT @see #copyComponentsToNewStackIgnoreEmpty
ARG 1 item
COMMENT the item of the resultant stack
ARG 2 count
@ -185,8 +185,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 0 fieldName
METHOD method_56703 (Ljava/util/Optional;)Lnet/minecraft/class_1799;
ARG 0 optional
METHOD method_56704 copyNbtToNewStackIgnoreEmpty (Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;
COMMENT {@return a new item stack with the NBT copied from this item stack, even if this stack is empty}
METHOD method_56704 copyComponentsToNewStackIgnoreEmpty (Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;
COMMENT {@return a new item stack with the components copied from this item stack, even if this stack is empty}
COMMENT
COMMENT @see #copy
COMMENT @see #copyWithCount
@ -231,7 +231,7 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 2 player
ARG 3 attribute
ARG 4 modifier
METHOD method_57365 copyComponentsFrom (Lnet/minecraft/class_9323;)V
METHOD method_57365 applyComponentsFrom (Lnet/minecraft/class_9323;)V
ARG 1 components
METHOD method_57366 applyChanges (Lnet/minecraft/class_9326;)V
ARG 1 changes
@ -462,14 +462,14 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
COMMENT }</pre>
ARG 1 amount
METHOD method_7972 copy ()Lnet/minecraft/class_1799;
COMMENT {@return a copy of this item stack, including the item count, NBT, and
COMMENT {@return a copy of this item stack, including the item count, components, and
COMMENT {@linkplain #getBobbingAnimationTime bobbing animation time}}
COMMENT
COMMENT @see #copyWithCount
COMMENT @see #copyNbtToNewStack
COMMENT @see #copyNbtToNewStackIgnoreEmpty
COMMENT @see #copyComponentsToNewStack
COMMENT @see #copyComponentsToNewStackIgnoreEmpty
METHOD method_7973 areEqual (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
COMMENT {@return whether the given item stacks are equal, including the item count and NBT}
COMMENT {@return whether the given item stacks are equal, including the item count and components}
COMMENT
COMMENT @see #areItemsEqual
COMMENT @see #areItemsAndNbtEqual
@ -506,7 +506,7 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 2 player
ARG 3 amount
METHOD method_7984 areItemsEqual (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
COMMENT {@return whether the given item stacks contain the same item, regardless of item count or NBT}
COMMENT {@return whether the given item stacks contain the same item, regardless of item count or components}
COMMENT
COMMENT @see #areEqual
COMMENT @see #areItemsAndNbtEqual