diff --git a/src/main/java/org/spongepowered/api/item/inventory/transaction/InventoryTransactionResult.java b/src/main/java/org/spongepowered/api/item/inventory/transaction/InventoryTransactionResult.java index d7d636fb4a..a516faaa56 100644 --- a/src/main/java/org/spongepowered/api/item/inventory/transaction/InventoryTransactionResult.java +++ b/src/main/java/org/spongepowered/api/item/inventory/transaction/InventoryTransactionResult.java @@ -27,6 +27,7 @@ import org.spongepowered.api.Sponge; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.util.CopyableBuilder; @@ -179,31 +180,47 @@ interface Builder extends org.spongepowered.api.util.Builder itemStacks); + Builder reject(Iterable itemStacks); + + /** + * @deprecated Use {@link #poll(ItemStackLike)} instead. + */ + @Deprecated(forRemoval = true) + default Builder.PollBuilder poll(ItemStackSnapshot itemStack) { + return this.poll((ItemStackLike) itemStack); + } /** - * Sets the provided {@link ItemStackSnapshot} as the stack that has been polled from the inventory. + * Sets the provided {@link ItemStackLike} as the stack that has been polled from the inventory. * * @param itemStack The polled itemstack * * @return This builder, for chaining */ - Builder.PollBuilder poll(ItemStackSnapshot itemStack); + Builder.PollBuilder poll(ItemStackLike itemStack); /** * Adds the provided {@link ItemStack itemstacks} as stacks that are diff --git a/src/main/java/org/spongepowered/api/item/inventory/transaction/SlotTransaction.java b/src/main/java/org/spongepowered/api/item/inventory/transaction/SlotTransaction.java index cf25725a58..da31f15953 100644 --- a/src/main/java/org/spongepowered/api/item/inventory/transaction/SlotTransaction.java +++ b/src/main/java/org/spongepowered/api/item/inventory/transaction/SlotTransaction.java @@ -26,6 +26,7 @@ import org.spongepowered.api.data.Transaction; import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.Slot; @@ -51,12 +52,20 @@ public SlotTransaction(Slot slot, ItemStackSnapshot original, ItemStackSnapshot } /** - * Sets the custom {@link ItemStack} output of this + * @deprecated Use {@link #setCustom(ItemStackLike)} instead. + */ + @Deprecated(forRemoval = true) + public void setCustom(ItemStack stack) { + this.setCustom((ItemStackLike) stack); + } + + /** + * Sets the custom {@link ItemStackLike} output of this * {@link SlotTransaction}. * * @param stack The stack */ - public void setCustom(ItemStack stack) { + public void setCustom(ItemStackLike stack) { this.setCustom(Objects.requireNonNull(stack, "ItemStack was null").asImmutable()); }