From 7e5965e1ef2eea04180ca3ef28a233f1e0421b4a Mon Sep 17 00:00:00 2001 From: liach <7806504+liach@users.noreply.github.com> Date: Mon, 8 Feb 2021 13:47:07 -0600 Subject: [PATCH] item slot (#2032) * item slot Signed-off-by: liach * Call this command item slot to prevent unintentional misusages Signed-off-by: liach Co-authored-by: liach --- mappings/net/minecraft/entity/Entity.mapping | 7 +++ .../inventory/CommandItemSlot.mapping | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 mappings/net/minecraft/inventory/CommandItemSlot.mapping diff --git a/mappings/net/minecraft/entity/Entity.mapping b/mappings/net/minecraft/entity/Entity.mapping index 33e3b02aa0..bb43f96bf4 100644 --- a/mappings/net/minecraft/entity/Entity.mapping +++ b/mappings/net/minecraft/entity/Entity.mapping @@ -274,6 +274,13 @@ 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}. + COMMENT + COMMENT @see net.minecraft.command.argument.ItemSlotArgumentType + ARG 1 mappedIndex + COMMENT the mapped index as given by the item slot argument METHOD method_32319 setInPowderSnow (Z)V ARG 1 inPowderSnow METHOD method_32875 emitGameEvent (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;)V diff --git a/mappings/net/minecraft/inventory/CommandItemSlot.mapping b/mappings/net/minecraft/inventory/CommandItemSlot.mapping new file mode 100644 index 0000000000..d51ca11ff7 --- /dev/null +++ b/mappings/net/minecraft/inventory/CommandItemSlot.mapping @@ -0,0 +1,43 @@ +CLASS net/minecraft/class_5630 net/minecraft/inventory/CommandItemSlot + COMMENT Represents an item slot for command access. Usually obtained from entities. + COMMENT + COMMENT

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