From 97310cc6ff45933858677fff866bd69ad03678c3 Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Sun, 8 Sep 2024 19:45:41 -0400 Subject: [PATCH] ItemStack related mappings --- mappings/net/minecraft/item/Item.mapping | 7 +++- mappings/net/minecraft/item/ItemStack.mapping | 40 +++++++++++++++++++ mappings/net/minecraft/item/Items.mapping | 3 ++ .../net/minecraft/nbt/NbtCompound.mapping | 1 + mappings/net/minecraft/nbt/NbtElement.mapping | 1 + mappings/net/minecraft/nbt/NbtList.mapping | 1 + 6 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mappings/net/minecraft/item/Item.mapping b/mappings/net/minecraft/item/Item.mapping index ad3ff99954..8aac704f09 100644 --- a/mappings/net/minecraft/item/Item.mapping +++ b/mappings/net/minecraft/item/Item.mapping @@ -49,6 +49,8 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item FIELD field_8015 propertyGetters Ljava/util/Map; METHOD (Lnet/minecraft/class_1792$class_1793;)V ARG 1 settings + METHOD method_0_8266 getTranslationKey (Lnet/minecraft/class_1799;)Ljava/lang/String; + ARG 1 stack METHOD method_16698 isNetworkSynced ()Z COMMENT {@return whether the item needs to sync additional data to clients} COMMENT @@ -201,6 +203,7 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item ARG 1 stack ARG 2 world ARG 3 player + METHOD method_7844 getAttributeModifiers ()Lcom/google/common/collect/Multimap; METHOD method_7844 getAttributeModifiers (Lnet/minecraft/class_1304;)Lcom/google/common/collect/Multimap; COMMENT {@return the attribute modifiers the item provides} COMMENT @@ -322,6 +325,8 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item METHOD method_7863 addPropertyGetter (Lnet/minecraft/class_2960;Lnet/minecraft/class_1800;)V ARG 1 id ARG 2 property + METHOD method_7864 getName (Lnet/minecraft/class_1799;)Ljava/lang/String; + ARG 1 stack METHOD method_7864 getName (Lnet/minecraft/class_1799;)Lnet/minecraft/class_2561; ARG 1 stack METHOD method_7865 getMiningSpeedMultiplier (Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)F @@ -335,7 +340,7 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item COMMENT @see MiningToolItem ARG 1 stack ARG 2 state - METHOD method_7866 getTranslationKey (Lnet/minecraft/class_1799;)Ljava/lang/String; + METHOD method_7866 getOrCreateTranslationKey (Lnet/minecraft/class_1799;)Ljava/lang/String; COMMENT Gets the translation key of this item using the provided item stack for context. ARG 1 stack METHOD method_7867 fromBlock (Lnet/minecraft/class_2248;)Lnet/minecraft/class_1792; diff --git a/mappings/net/minecraft/item/ItemStack.mapping b/mappings/net/minecraft/item/ItemStack.mapping index a63e1a5a7d..f29ede313a 100644 --- a/mappings/net/minecraft/item/ItemStack.mapping +++ b/mappings/net/minecraft/item/ItemStack.mapping @@ -80,6 +80,7 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT COMMENT COMMENT + FIELD field_0_8640 damage I FIELD field_24092 LORE_STYLE Lnet/minecraft/class_2583; FIELD field_24093 holder Lnet/minecraft/class_1297; FIELD field_24671 CODEC Lcom/mojang/serialization/Codec; @@ -131,6 +132,9 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT COMMENT @see Item Stack NBT Operations FIELD field_8041 frame Lnet/minecraft/class_1533; + METHOD (Lnet/minecraft/class_1792;II)V + ARG 1 item + ARG 2 count METHOD (Lnet/minecraft/class_1935;)V ARG 1 item METHOD (Lnet/minecraft/class_1935;I)V @@ -147,6 +151,16 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack METHOD (Lnet/minecraft/class_6880;I)V ARG 1 itemEntry ARG 2 count + METHOD method_0_8322 fromNbt (Lnet/minecraft/class_2487;)Lnet/minecraft/class_1799; + ARG 0 nbt + METHOD method_0_8329 getTooltip (Lnet/minecraft/class_1657;Z)Ljava/util/List; + ARG 1 player + METHOD method_0_8333 getItem ()Lnet/minecraft/class_1792; + METHOD method_0_8334 setDamage (I)V + ARG 1 damage + METHOD method_0_8344 readNbt (Lnet/minecraft/class_2487;)V + ARG 1 nbt + METHOD method_0_8355 getDamage ()I METHOD method_17869 (Ljava/util/List;Lnet/minecraft/class_2487;Lnet/minecraft/class_1887;)V ARG 2 e METHOD method_17870 appendEnchantments (Ljava/util/List;Lnet/minecraft/class_2499;)V @@ -263,6 +277,16 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT COMMENT @see Item Stack NBT Operations ARG 1 key + METHOD method_7911 getOrCreateSubNbt (Ljava/lang/String;Z)Lnet/minecraft/class_2487; + COMMENT {@return the compound NBT at the specified key in this item stack's NBT, or a + COMMENT new compound added to the stack if absent} + COMMENT + COMMENT

This should not be used when reading the NBT, as this can modify the item stack. + COMMENT Use {@link #getSubNbt} with a check for {@code null} instead. + COMMENT + COMMENT @see Item Stack NBT Operations + ARG 1 key + ARG 2 createSubNbt METHOD method_7912 setBobbingAnimationTime (I)V ARG 1 bobbingAnimationTime METHOD method_7913 use (Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1271; @@ -335,6 +359,15 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT COMMENT @see #setCustomName COMMENT @see #hasCustomName + METHOD method_7926 getAttributeModifiers ()Lcom/google/common/collect/Multimap; + COMMENT {@return a multimap of attribute modifiers for {@code slot}} + COMMENT + COMMENT

If a custom attribute modifier exists under the {@code AttributeModifiers} key, + COMMENT this returns those modifiers only; otherwise, this returns the item's default + COMMENT attribute modifier. + COMMENT + COMMENT @see Item#getAttributeModifiers + COMMENT @see #addAttributeModifier METHOD method_7926 getAttributeModifiers (Lnet/minecraft/class_1304;)Lcom/google/common/collect/Multimap; COMMENT {@return a multimap of attribute modifiers for {@code slot}} COMMENT @@ -384,6 +417,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT Sets the count of items in this item stack. ARG 1 count COMMENT the count of items + METHOD method_7940 canDestroy (Lnet/minecraft/class_2248;)Z + ARG 1 block METHOD method_7940 canDestroy (Lnet/minecraft/class_2378;Lnet/minecraft/class_2694;)Z ARG 1 blockRegistry ARG 2 pos @@ -407,6 +442,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT @see #getEnchantments METHOD method_7943 setFrame (Lnet/minecraft/class_1533;)V ARG 1 frame + METHOD method_7944 canPlaceOn (Lnet/minecraft/class_2248;)Z + ARG 1 block METHOD method_7944 canPlaceOn (Lnet/minecraft/class_2378;Lnet/minecraft/class_2694;)Z ARG 1 blockRegistry ARG 2 pos @@ -524,6 +561,7 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack COMMENT @see Item#getMaxDamage COMMENT @see #isDamaged COMMENT @see #getDamage + METHOD method_7964 getName ()Ljava/lang/String; METHOD method_7964 getName ()Lnet/minecraft/class_2561; COMMENT {@return the custom name of the stack if it exists, or the item's name} METHOD method_7965 getBobbingAnimationTime ()I @@ -605,6 +643,8 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack ARG 0 left ARG 1 right METHOD method_7976 getUseAction ()Lnet/minecraft/class_1839; + METHOD method_7977 setCustomName (Ljava/lang/String;)Lnet/minecraft/class_1799; + ARG 1 name METHOD method_7977 setCustomName (Lnet/minecraft/class_2561;)Lnet/minecraft/class_1799; COMMENT Sets the custom name of this item stack to {@code name}. If {@code null} is COMMENT passed, this will remove the custom name (but does not remove other NBT compounds diff --git a/mappings/net/minecraft/item/Items.mapping b/mappings/net/minecraft/item/Items.mapping index 5f76337af4..edfe869bb3 100644 --- a/mappings/net/minecraft/item/Items.mapping +++ b/mappings/net/minecraft/item/Items.mapping @@ -445,6 +445,7 @@ CLASS net/minecraft/class_1802 net/minecraft/item/Items FIELD field_8200 RED_SAND Lnet/minecraft/class_1792; FIELD field_8201 BIRCH_WOOD Lnet/minecraft/class_1792; FIELD field_8202 PURPUR_SLAB Lnet/minecraft/class_1792; + FIELD field_8204 FILLED_MAP Lnet/minecraft/class_1806; FIELD field_8205 YELLOW_CONCRETE_POWDER Lnet/minecraft/class_1792; FIELD field_8206 ANDESITE_WALL Lnet/minecraft/class_1792; FIELD field_8210 SPRUCE_WOOD Lnet/minecraft/class_1792; @@ -540,6 +541,7 @@ CLASS net/minecraft/class_1802 net/minecraft/item/Items FIELD field_8368 GREEN_BED Lnet/minecraft/class_1792; FIELD field_8369 MOSSY_COBBLESTONE_SLAB Lnet/minecraft/class_1792; FIELD field_8376 OAK_TRAPDOOR Lnet/minecraft/class_1792; + FIELD field_8378 FISHING_ROD Lnet/minecraft/class_1787; FIELD field_8380 ORANGE_SHULKER_BOX Lnet/minecraft/class_1792; FIELD field_8381 DEAD_BRAIN_CORAL Lnet/minecraft/class_1792; FIELD field_8382 PODZOL Lnet/minecraft/class_1792; @@ -823,6 +825,7 @@ CLASS net/minecraft/class_1802 net/minecraft/item/Items FIELD field_8863 YELLOW_BED Lnet/minecraft/class_1792; FIELD field_8865 LEVER Lnet/minecraft/class_1792; FIELD field_8866 COMMAND_BLOCK Lnet/minecraft/class_1792; + FIELD field_8868 SHEARS Lnet/minecraft/class_1820; FIELD field_8869 LIGHT_BLUE_STAINED_GLASS Lnet/minecraft/class_1792; FIELD field_8870 RED_GLAZED_TERRACOTTA Lnet/minecraft/class_1792; FIELD field_8871 GRAY_STAINED_GLASS_PANE Lnet/minecraft/class_1792; diff --git a/mappings/net/minecraft/nbt/NbtCompound.mapping b/mappings/net/minecraft/nbt/NbtCompound.mapping index 545d585f61..9a13e252bc 100644 --- a/mappings/net/minecraft/nbt/NbtCompound.mapping +++ b/mappings/net/minecraft/nbt/NbtCompound.mapping @@ -189,6 +189,7 @@ CLASS net/minecraft/class_2487 net/minecraft/nbt/NbtCompound COMMENT @see #get(String) ARG 1 key ARG 2 element + METHOD method_10566 put (Ljava/lang/String;Lnet/minecraft/class_2520;)V METHOD method_10567 putByte (Ljava/lang/String;B)V COMMENT Puts a {@code byte} to this compound. COMMENT diff --git a/mappings/net/minecraft/nbt/NbtElement.mapping b/mappings/net/minecraft/nbt/NbtElement.mapping index 764c284eee..fa0a9eda7a 100644 --- a/mappings/net/minecraft/nbt/NbtElement.mapping +++ b/mappings/net/minecraft/nbt/NbtElement.mapping @@ -63,6 +63,7 @@ CLASS net/minecraft/class_2520 net/minecraft/nbt/NbtElement COMMENT @see NbtCompound#getType(String) COMMENT @see NbtCompound#contains(String, int) FIELD field_33264 MAX_DEPTH I + METHOD method_0_5049 isEmpty ()Z METHOD method_10707 copy ()Lnet/minecraft/class_2520; COMMENT {@return an NBT element of equal value that won't change with this element} METHOD method_10708 createTag (B)Lnet/minecraft/class_2520; diff --git a/mappings/net/minecraft/nbt/NbtList.mapping b/mappings/net/minecraft/nbt/NbtList.mapping index c2a5c17175..290161a76e 100644 --- a/mappings/net/minecraft/nbt/NbtList.mapping +++ b/mappings/net/minecraft/nbt/NbtList.mapping @@ -27,6 +27,7 @@ CLASS net/minecraft/class_2499 net/minecraft/nbt/NbtList ARG 1 o METHOD get (I)Ljava/lang/Object; ARG 1 index + METHOD method_0_5022 size ()I METHOD method_10600 getInt (I)I COMMENT {@return the integer at {@code index}, or {@code 0} if the index is out of bounds COMMENT or if this is not a list of integers}