From 99ba24aaaffa42b06e9f1762277252b84c196bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=ADSollace?= Date: Fri, 27 Mar 2020 20:04:46 +0200 Subject: [PATCH] Remap inventories :D (#1154) * Remap inventories :D * @see -> see @link * getMaxStackAmount -> getMaxCountPerStack Co-Authored-By: Juuxel <6596629+Juuxel@users.noreply.github.com> * Rename InventoryChangedListener.mapping to InventoryChangeCallback.mapping * putStack -> setStack * JD fixes Co-Authored-By: liach <7806504+liach@users.noreply.github.com> * Fix filename * isAccessible -> canStayOpen * isAccessible -> canStayOpen * Update javadoc * jd for getMaxCountPerStack Return value jd taken from #1053 (with fixes) * Update mappings/net/minecraft/inventory/SidedInventory.mapping Co-Authored-By: Yanis48 * canStayOpen -> canPlayerUse * canStayOpen -> canPlayerUse Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com> Co-authored-by: liach <7806504+liach@users.noreply.github.com> Co-authored-by: Yanis48 --- .../inventory/BasicInventory.mapping | 13 ++++-- .../inventory/CraftingResultInventory.mapping | 2 +- .../inventory/EnderChestInventory.mapping | 5 ++- .../net/minecraft/inventory/Inventory.mapping | 42 +++++++++++++------ .../InventoryChangedListener.mapping | 3 ++ .../inventory/InventoryListener.mapping | 2 - .../inventory/SidedInventory.mapping | 10 +++-- mappings/net/minecraft/util/Clearable.mapping | 1 + 8 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 mappings/net/minecraft/inventory/InventoryChangedListener.mapping delete mode 100644 mappings/net/minecraft/inventory/InventoryListener.mapping diff --git a/mappings/net/minecraft/inventory/BasicInventory.mapping b/mappings/net/minecraft/inventory/BasicInventory.mapping index a8dae7245f..fa3f0996b1 100644 --- a/mappings/net/minecraft/inventory/BasicInventory.mapping +++ b/mappings/net/minecraft/inventory/BasicInventory.mapping @@ -1,12 +1,15 @@ CLASS net/minecraft/class_1277 net/minecraft/inventory/BasicInventory - FIELD field_5828 stackList Lnet/minecraft/class_2371; + FIELD field_5828 stacks Lnet/minecraft/class_2371; FIELD field_5829 listeners Ljava/util/List; FIELD field_5831 size I METHOD (I)V ARG 1 size METHOD ([Lnet/minecraft/class_1799;)V ARG 1 items - METHOD method_20631 poll (Lnet/minecraft/class_1792;I)Lnet/minecraft/class_1799; + METHOD method_20631 removeItem (Lnet/minecraft/class_1792;I)Lnet/minecraft/class_1799; + COMMENT Searches this inventory for the specified item and removes the given amount from this inventory. + COMMENT + COMMENT @return the stack of removed items ARG 1 item ARG 2 count METHOD method_20632 transfer (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V @@ -18,11 +21,15 @@ CLASS net/minecraft/class_1277 net/minecraft/inventory/BasicInventory ARG 1 stack METHOD method_24514 clearToList ()Ljava/util/List; COMMENT Clears this inventory and return all the non-empty stacks in a list. + METHOD method_24825 canCombine (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z + ARG 1 one + ARG 2 two METHOD method_5488 removeListener (Lnet/minecraft/class_1265;)V ARG 1 listener METHOD method_5489 addListener (Lnet/minecraft/class_1265;)V ARG 1 listener - METHOD method_5491 add (Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799; + METHOD method_5491 addStack (Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799; ARG 1 stack METHOD method_7659 readTags (Lnet/minecraft/class_2499;)V + ARG 1 tags METHOD method_7660 getTags ()Lnet/minecraft/class_2499; diff --git a/mappings/net/minecraft/inventory/CraftingResultInventory.mapping b/mappings/net/minecraft/inventory/CraftingResultInventory.mapping index d39d9c2a30..12c701d35d 100644 --- a/mappings/net/minecraft/inventory/CraftingResultInventory.mapping +++ b/mappings/net/minecraft/inventory/CraftingResultInventory.mapping @@ -1,3 +1,3 @@ CLASS net/minecraft/class_1731 net/minecraft/inventory/CraftingResultInventory FIELD field_7865 lastRecipe Lnet/minecraft/class_1860; - FIELD field_7866 stack Lnet/minecraft/class_2371; + FIELD field_7866 stacks Lnet/minecraft/class_2371; diff --git a/mappings/net/minecraft/inventory/EnderChestInventory.mapping b/mappings/net/minecraft/inventory/EnderChestInventory.mapping index 203d6f6ff2..577ee8b6eb 100644 --- a/mappings/net/minecraft/inventory/EnderChestInventory.mapping +++ b/mappings/net/minecraft/inventory/EnderChestInventory.mapping @@ -1,3 +1,4 @@ CLASS net/minecraft/class_1730 net/minecraft/inventory/EnderChestInventory - FIELD field_7864 currentBlockEntity Lnet/minecraft/class_2611; - METHOD method_7661 setCurrentBlockEntity (Lnet/minecraft/class_2611;)V + FIELD field_7864 activeBlockEntity Lnet/minecraft/class_2611; + METHOD method_7661 setActiveBlockEntity (Lnet/minecraft/class_2611;)V + ARG 1 blockEntity diff --git a/mappings/net/minecraft/inventory/Inventory.mapping b/mappings/net/minecraft/inventory/Inventory.mapping index 2b9c191be5..9ce1d802c0 100644 --- a/mappings/net/minecraft/inventory/Inventory.mapping +++ b/mappings/net/minecraft/inventory/Inventory.mapping @@ -1,28 +1,44 @@ CLASS net/minecraft/class_1263 net/minecraft/inventory/Inventory - METHOD method_18861 countInInv (Lnet/minecraft/class_1792;)I + METHOD method_18861 count (Lnet/minecraft/class_1792;)I + COMMENT Returns the number of times the specified item occurs in this inventory across all stored stacks. ARG 1 item - METHOD method_18862 containsAnyInInv (Ljava/util/Set;)Z + METHOD method_18862 containsAny (Ljava/util/Set;)Z + COMMENT Determines whether this inventory contains any of the given candidate items. ARG 1 items METHOD method_5431 markDirty ()V - METHOD method_5432 onInvClose (Lnet/minecraft/class_1657;)V + METHOD method_5432 onClose (Lnet/minecraft/class_1657;)V ARG 1 player - METHOD method_5434 takeInvStack (II)Lnet/minecraft/class_1799; + METHOD method_5434 removeStack (II)Lnet/minecraft/class_1799; + COMMENT Removes a specific number of items from the given slot. + COMMENT + COMMENT @return the removed items as a stack ARG 1 slot ARG 2 amount - METHOD method_5435 onInvOpen (Lnet/minecraft/class_1657;)V + METHOD method_5435 onOpen (Lnet/minecraft/class_1657;)V ARG 1 player - METHOD method_5437 isValidInvStack (ILnet/minecraft/class_1799;)Z + METHOD method_5437 isValid (ILnet/minecraft/class_1799;)Z + COMMENT Returns whether the given stack is a valid for the indicated slot position. ARG 1 slot ARG 2 stack - METHOD method_5438 getInvStack (I)Lnet/minecraft/class_1799; + METHOD method_5438 getStack (I)Lnet/minecraft/class_1799; + COMMENT Fetches the stack currently stored at the given slot. If the slot is empty, + COMMENT or is outside the bounds of this inventory, returns see {@link ItemStack.EMPTY}. ARG 1 slot - METHOD method_5439 getInvSize ()I - METHOD method_5441 removeInvStack (I)Lnet/minecraft/class_1799; + METHOD method_5439 size ()I + METHOD method_5441 removeStack (I)Lnet/minecraft/class_1799; + COMMENT Removes the stack currently stored at the indicated slot. + COMMENT + COMMENT @return the stack previously stored at the indicated slot. ARG 1 slot - METHOD method_5442 isInvEmpty ()Z - METHOD method_5443 canPlayerUseInv (Lnet/minecraft/class_1657;)Z + METHOD method_5442 isEmpty ()Z + METHOD method_5443 canPlayerUse (Lnet/minecraft/class_1657;)Z ARG 1 player - METHOD method_5444 getInvMaxStackAmount ()I - METHOD method_5447 setInvStack (ILnet/minecraft/class_1799;)V + METHOD method_5444 getMaxCountPerStack ()I + COMMENT Returns the maximum number of items a stack can contain when placed inside this inventory. + COMMENT No slots may have more than this number of items. It is effectively the + COMMENT stacking limit for this inventory's slots. + COMMENT + COMMENT @return the max {@link net.minecraft.item.ItemStack#getCount() count} of item stacks in this inventory + METHOD method_5447 setStack (ILnet/minecraft/class_1799;)V ARG 1 slot ARG 2 stack diff --git a/mappings/net/minecraft/inventory/InventoryChangedListener.mapping b/mappings/net/minecraft/inventory/InventoryChangedListener.mapping new file mode 100644 index 0000000000..51632601a2 --- /dev/null +++ b/mappings/net/minecraft/inventory/InventoryChangedListener.mapping @@ -0,0 +1,3 @@ +CLASS net/minecraft/class_1265 net/minecraft/inventory/InventoryChangedListener + METHOD method_5453 onInventoryChanged (Lnet/minecraft/class_1263;)V + ARG 1 sender diff --git a/mappings/net/minecraft/inventory/InventoryListener.mapping b/mappings/net/minecraft/inventory/InventoryListener.mapping deleted file mode 100644 index d26847956b..0000000000 --- a/mappings/net/minecraft/inventory/InventoryListener.mapping +++ /dev/null @@ -1,2 +0,0 @@ -CLASS net/minecraft/class_1265 net/minecraft/inventory/InventoryListener - METHOD method_5453 onInvChange (Lnet/minecraft/class_1263;)V diff --git a/mappings/net/minecraft/inventory/SidedInventory.mapping b/mappings/net/minecraft/inventory/SidedInventory.mapping index 2fb1a10330..f7870fad33 100644 --- a/mappings/net/minecraft/inventory/SidedInventory.mapping +++ b/mappings/net/minecraft/inventory/SidedInventory.mapping @@ -1,11 +1,15 @@ CLASS net/minecraft/class_1278 net/minecraft/inventory/SidedInventory - METHOD method_5492 canInsertInvStack (ILnet/minecraft/class_1799;Lnet/minecraft/class_2350;)Z + COMMENT A special inventory interface for inventories that expose different slots for different sides, such as hoppers. + METHOD method_5492 canInsert (ILnet/minecraft/class_1799;Lnet/minecraft/class_2350;)Z + COMMENT Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction. ARG 1 slot ARG 2 stack ARG 3 dir - METHOD method_5493 canExtractInvStack (ILnet/minecraft/class_1799;Lnet/minecraft/class_2350;)Z + METHOD method_5493 canExtract (ILnet/minecraft/class_1799;Lnet/minecraft/class_2350;)Z + COMMENT Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction. ARG 1 slot ARG 2 stack ARG 3 dir - METHOD method_5494 getInvAvailableSlots (Lnet/minecraft/class_2350;)[I + METHOD method_5494 getAvailableSlots (Lnet/minecraft/class_2350;)[I + COMMENT Gets the available slot positions that are reachable from a given side. ARG 1 side diff --git a/mappings/net/minecraft/util/Clearable.mapping b/mappings/net/minecraft/util/Clearable.mapping index 82773d53bc..984bade04a 100644 --- a/mappings/net/minecraft/util/Clearable.mapping +++ b/mappings/net/minecraft/util/Clearable.mapping @@ -1,4 +1,5 @@ CLASS net/minecraft/class_3829 net/minecraft/util/Clearable COMMENT Represents an object which can be cleared. METHOD method_16825 clear (Ljava/lang/Object;)V + ARG 0 o METHOD method_5448 clear ()V