yarn/mappings/net/minecraft/inventory/Inventories.mapping

90 lines
4.5 KiB
Plaintext
Raw Normal View History

2019-06-28 17:55:20 -04:00
CLASS net/minecraft/class_1262 net/minecraft/inventory/Inventories
2023-08-24 19:01:48 -04:00
COMMENT Contains utility methods used by {@link Inventory} implementations or for working
COMMENT with inventories.
2024-03-09 07:57:49 -05:00
FIELD field_49719 ITEMS_NBT_KEY Ljava/lang/String;
METHOD method_29234 remove (Lnet/minecraft/class_1263;Ljava/util/function/Predicate;IZ)I
COMMENT Removes a number, not exceeding {@code maxCount}, of items from an inventory based on a predicate and returns that number.
COMMENT @return the number of items removed
ARG 0 inventory
ARG 1 shouldRemove
ARG 2 maxCount
ARG 3 dryRun
COMMENT whether to return the number of items which would have been removed without actually removing them
METHOD method_29235 remove (Lnet/minecraft/class_1799;Ljava/util/function/Predicate;IZ)I
COMMENT Removes a number, not exceeding {@code maxCount}, of items from an item stack based on a predicate and returns that number.
COMMENT @return the number of items removed
ARG 0 stack
ARG 1 shouldRemove
ARG 2 maxCount
ARG 3 dryRun
COMMENT whether to return the number of items which would have been removed without actually removing them
2024-02-28 14:15:21 -05:00
METHOD method_5426 writeNbt (Lnet/minecraft/class_2487;Lnet/minecraft/class_2371;Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
2023-08-24 19:01:48 -04:00
COMMENT Writes the inventory to {@code nbt}. This method will always write to the NBT,
COMMENT even if {@code stacks} only contains empty stacks.
COMMENT
COMMENT <p>See {@link #writeNbt(NbtCompound, DefaultedList, boolean, RegistryWrapper.WrapperLookup)}
COMMENT for the serialization format.
2023-08-24 19:01:48 -04:00
COMMENT
COMMENT @see #readNbt(NbtCompound, DefaultedList, RegistryWrapper.WrapperLookup)
COMMENT @see #writeNbt(NbtCompound, DefaultedList, boolean, RegistryWrapper.WrapperLookup)
2023-08-24 19:01:48 -04:00
COMMENT @return the passed {@code nbt}
ARG 0 nbt
2017-05-13 02:18:40 -04:00
ARG 1 stacks
ARG 2 registries
2024-02-28 14:15:21 -05:00
METHOD method_5427 writeNbt (Lnet/minecraft/class_2487;Lnet/minecraft/class_2371;ZLnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
2023-08-24 19:01:48 -04:00
COMMENT Writes the inventory to {@code nbt}.
COMMENT
2024-03-09 07:57:49 -05:00
COMMENT <p>The inventory is serialized as a list of non-empty item stacks.
COMMENT In addition, each compound has a byte entry with the key {@code Slot},
2023-08-24 19:01:48 -04:00
COMMENT indicating the slot. The list is then written to {@code nbt} under the key {@code
COMMENT Items}.
COMMENT
COMMENT <p>If {@code setIfEmpty} is {@code false} and each stack in {@code stacks} is empty,
COMMENT then {@code nbt} will not be modified at all. Otherwise, the {@code Items} entry
COMMENT will always be present.
COMMENT
COMMENT @see #readNbt(NbtCompound, DefaultedList, RegistryWrapper.WrapperLookup)
2023-08-24 19:01:48 -04:00
COMMENT @return the passed {@code nbt}
ARG 0 nbt
2017-05-13 02:18:40 -04:00
ARG 1 stacks
ARG 2 setIfEmpty
ARG 3 registries
2019-06-28 17:55:20 -04:00
METHOD method_5428 removeStack (Ljava/util/List;I)Lnet/minecraft/class_1799;
2023-08-24 19:01:48 -04:00
COMMENT Sets the stack at {@code slot} to {@link ItemStack#EMPTY} and returns the old stack.
COMMENT
COMMENT <p>This returns {@link ItemStack#EMPTY} when {@code slot} is out of bounds.
COMMENT
COMMENT @apiNote This is used to implement {@link Inventory#removeStack(int)}.
COMMENT This should not otherwise be used directly.
COMMENT
2023-09-02 09:09:42 -04:00
COMMENT @return the stack previously at {@code slot}
2017-05-13 02:02:51 -04:00
ARG 0 stacks
ARG 1 slot
2024-02-28 14:15:21 -05:00
METHOD method_5429 readNbt (Lnet/minecraft/class_2487;Lnet/minecraft/class_2371;Lnet/minecraft/class_7225$class_7874;)V
2023-08-24 19:01:48 -04:00
COMMENT Reads {@code nbt} and sets the elements of {@code stacks} accordingly.
COMMENT
COMMENT <p>See {@link #writeNbt(NbtCompound, DefaultedList, boolean, RegistryWrapper.WrapperLookup)}
COMMENT for the serialization format. If the slot is out of bounds, it is ignored.
2023-08-24 19:01:48 -04:00
COMMENT
COMMENT @see #writeNbt(NbtCompound, DefaultedList, RegistryWrapper.WrapperLookup)
COMMENT @see #writeNbt(NbtCompound, DefaultedList, boolean, RegistryWrapper.WrapperLookup)
ARG 0 nbt
2019-06-28 17:55:20 -04:00
ARG 1 stacks
ARG 2 registries
2019-06-28 17:55:20 -04:00
METHOD method_5430 splitStack (Ljava/util/List;II)Lnet/minecraft/class_1799;
2023-08-24 19:01:48 -04:00
COMMENT {@return the copy of the stack split from the stack at {@code slot}}
COMMENT
COMMENT <p>This returns {@link ItemStack#EMPTY} when {@code slot} is out of bounds,
COMMENT the stack at the slot is empty, or when {@code amount <= 0}.
COMMENT
COMMENT @apiNote This is used to implement {@link Inventory#removeStack(int, int)}.
COMMENT This should not otherwise be used directly.
COMMENT
COMMENT @see ItemStack#split(int)
2017-05-13 02:02:51 -04:00
ARG 0 stacks
ARG 1 slot
ARG 2 amount
METHOD method_58820 tryAddStack (Lnet/minecraft/class_1263;Lnet/minecraft/class_1799;)I
ARG 0 inventory
ARG 1 stack