From c0e0480d73345d3adcc98f67790061b37c1a1096 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:19:28 -0600 Subject: [PATCH] Trying making the lenses stackable. --- .../actuallyadditions/mod/blocks/BlockAtomicReconstructor.java | 3 +++ .../de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index db3a02908..5d7b13c4b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -72,6 +72,9 @@ public class BlockAtomicReconstructor extends FullyDirectionalBlock.Container im heldItem.shrink(1); } return ItemInteractionResult.CONSUME; + } else if (ItemStack.isSameItem(heldItem, reconstructor.inv.getStackInSlot(0)) && heldItem.getCount() + 1 <= heldItem.getMaxStackSize()) { + reconstructor.inv.setStackInSlot(0, ItemStack.EMPTY); + heldItem.grow(1); } } else { ItemStack slot = reconstructor.inv.getStackInSlot(0); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java index 29a23e049..5c733f60a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java @@ -20,7 +20,7 @@ public class ItemLens extends ItemBase implements ILensItem { private final Lens type; public ItemLens(Lens type) { - super(ActuallyItems.defaultProps().stacksTo(1)); + super(ActuallyItems.defaultProps()); this.type = type; }