Slot.isEnabled and CommandItemSlot -> StackReference (#2452)

* Fix infuriatingly mismapped Slot method

* CommandItemSlot -> StackReference

* Update command name
This commit is contained in:
Emily Rose Alexandra 2021-05-30 16:10:13 -05:00 committed by GitHub
parent 4757c9a8c4
commit 624433f650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 60 additions and 51 deletions

View File

@ -322,9 +322,9 @@ CLASS net/minecraft/class_1297 net/minecraft/entity/Entity
METHOD method_32316 canFreeze ()Z
METHOD method_32317 setFrozenTicks (I)V
ARG 1 frozenTicks
METHOD method_32318 getCommandItemSlot (I)Lnet/minecraft/class_5630;
COMMENT Obtains an item slot for command modification purpose. Used by commands
COMMENT like {@code /loot} or {@code /replaceitem}.
METHOD method_32318 getStackReference (I)Lnet/minecraft/class_5630;
COMMENT Obtains a stack reference to be modified. Used by commands like
COMMENT {@code /loot} or {@code /item}.
COMMENT
COMMENT @see net.minecraft.command.argument.ItemSlotArgumentType
ARG 1 mappedIndex

View File

@ -248,7 +248,7 @@ CLASS net/minecraft/class_1309 net/minecraft/entity/LivingEntity
METHOD method_30129 getEquipment ()Ljava/util/Map;
METHOD method_31079 positionInPortal (Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
ARG 0 pos
METHOD method_32321 getCommandItemSlot (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;
METHOD method_32321 getStackReference (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;
ARG 0 entity
ARG 1 slot
METHOD method_32322 getEquipmentSlot (I)Lnet/minecraft/class_1304;

View File

@ -32,6 +32,13 @@ CLASS net/minecraft/class_1496 net/minecraft/entity/passive/HorseBaseEntity
METHOD method_30009 interactHorse (Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;
ARG 1 player
ARG 2 stack
METHOD method_32335 createInventoryStackReference (ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;
ARG 1 slot
ARG 2 predicate
METHOD method_32336 (Lnet/minecraft/class_1799;)Z
ARG 1 stack
METHOD method_32337 (Lnet/minecraft/class_1799;)Z
ARG 0 stack
METHOD method_6001 initAttributes ()V
METHOD method_6721 onChestedStatusChanged ()V
METHOD method_6722 openInventory (Lnet/minecraft/class_1657;)V

View File

@ -1,43 +0,0 @@
CLASS net/minecraft/class_5630 net/minecraft/inventory/CommandItemSlot
COMMENT Represents an item slot for command access. Usually obtained from entities.
COMMENT
COMMENT <p>Some dispenser behaviors also use this to simulate commands' behavior
COMMENT of equipping items.
COMMENT
COMMENT @see net.minecraft.entity.Entity#getCommandItemSlot(int)
FIELD field_27860 EMPTY Lnet/minecraft/class_5630;
COMMENT An immutable empty slot.
METHOD method_32327 get ()Lnet/minecraft/class_1799;
COMMENT Gets the current item stack in this slot.
METHOD method_32328 of (Lnet/minecraft/class_1263;I)Lnet/minecraft/class_5630;
COMMENT Creates a slot backed by an index within an inventory.
ARG 0 inventory
ARG 1 index
METHOD method_32329 of (Lnet/minecraft/class_1263;ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;
COMMENT Creates a slot backed by an index within an inventory and guarded by
COMMENT a condition for setting stacks into the inventory.
ARG 0 inventory
ARG 1 index
ARG 2 stackFilter
COMMENT the condition to guard stack setting
METHOD method_32330 of (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;
COMMENT Creates a slot backed by an equipment slot of an living entity.
ARG 0 entity
ARG 1 equipmentSlot
METHOD method_32331 of (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;Ljava/util/function/Predicate;)Lnet/minecraft/class_5630;
COMMENT Creates a slot backed by an equipment slot of an living entity and guarded by
COMMENT a condition for setting stacks into the inventory.
ARG 0 entity
ARG 1 equipmentSlot
ARG 2 stackFilter
COMMENT the condition to guard stack setting
METHOD method_32332 set (Lnet/minecraft/class_1799;)Z
COMMENT Sets the {@code stack} to this slot.
COMMENT
COMMENT @return {@code true} if the setting is successful, {@code false} if rejected
ARG 1 stack
COMMENT the item stack to set
METHOD method_32333 (Lnet/minecraft/class_1799;)Z
ARG 0 stack
METHOD method_32334 (Lnet/minecraft/class_1799;)Z
ARG 0 stack

View File

@ -0,0 +1,45 @@
CLASS net/minecraft/class_5630 net/minecraft/inventory/StackReference
COMMENT Represents a reference to a stack that supports getting and setting.
COMMENT Often for command access. Usually obtained from entities.
COMMENT
COMMENT <p>Screen handlers also use stack references to pass a mutable cursor
COMMENT stack to some methods.
COMMENT
COMMENT @see net.minecraft.entity.Entity#getStackReference(int)
FIELD field_27860 EMPTY Lnet/minecraft/class_5630;
COMMENT An immutable empty stack reference.
METHOD method_32327 get ()Lnet/minecraft/class_1799;
COMMENT Gets the current item stack.
METHOD method_32328 of (Lnet/minecraft/class_1263;I)Lnet/minecraft/class_5630;
COMMENT Creates a stack reference backed by an index within an inventory.
ARG 0 inventory
ARG 1 index
METHOD method_32329 of (Lnet/minecraft/class_1263;ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;
COMMENT Creates a stack reference backed by an index within an inventory and guarded
COMMENT by a condition for setting stacks into the inventory.
ARG 0 inventory
ARG 1 index
ARG 2 stackFilter
COMMENT the condition to guard stack setting
METHOD method_32330 of (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;
COMMENT Creates a stack reference backed by an equipment slot of an living entity with
COMMENT no filter, allowing direct manipulation of the equipment slot.
ARG 0 entity
ARG 1 slot
METHOD method_32331 of (Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;Ljava/util/function/Predicate;)Lnet/minecraft/class_5630;
COMMENT Creates a stack reference backed by an equipment slot of an living entity and
COMMENT guarded by a condition for setting stacks into the inventory.
ARG 0 entity
ARG 1 slot
ARG 2 filter
COMMENT the condition to guard stack setting
METHOD method_32332 set (Lnet/minecraft/class_1799;)Z
COMMENT Sets the {@code stack}.
COMMENT
COMMENT @return {@code true} if the setting is successful, {@code false} if rejected
ARG 1 stack
COMMENT the item stack to set
METHOD method_32333 (Lnet/minecraft/class_1799;)Z
ARG 0 stack
METHOD method_32334 (Lnet/minecraft/class_1799;)Z
ARG 0 stack

View File

@ -34,7 +34,7 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item
ARG 3 slot
ARG 4 clickType
ARG 5 player
ARG 6 cursorSlot
ARG 6 cursorStackReference
METHOD method_31567 isItemBarVisible (Lnet/minecraft/class_1799;)Z
ARG 1 stack
METHOD method_31568 canBeNested ()Z

View File

@ -80,7 +80,7 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
ARG 2 slot
ARG 3 clickType
ARG 4 player
ARG 5 cursorSlot
ARG 5 cursorStackReference
METHOD method_31577 canCombine (Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
ARG 0 stack
ARG 1 otherStack

View File

@ -77,7 +77,7 @@ CLASS net/minecraft/class_1703 net/minecraft/screen/ScreenHandler
METHOD method_34256 disableSyncing ()V
METHOD method_34257 enableSyncing ()V
METHOD method_34258 checkCursorStackUpdates ()V
METHOD method_34259 getCursorCommandItemSlot ()Lnet/minecraft/class_5630;
METHOD method_34259 getCursorStackReference ()Lnet/minecraft/class_5630;
METHOD method_34715 checkPropertyUpdates (II)V
ARG 1 id
ARG 2 value

View File

@ -55,4 +55,4 @@ CLASS net/minecraft/class_1735 net/minecraft/screen/slot/Slot
METHOD method_7680 canInsert (Lnet/minecraft/class_1799;)Z
ARG 1 stack
METHOD method_7681 hasStack ()Z
METHOD method_7682 doDrawHoveringEffect ()Z
METHOD method_7682 isEnabled ()Z