diff --git a/src/main/java/tconstruct/tools/gui/StencilTableGui.java b/src/main/java/tconstruct/tools/gui/StencilTableGui.java index b5d9c5fe..54f29c99 100644 --- a/src/main/java/tconstruct/tools/gui/StencilTableGui.java +++ b/src/main/java/tconstruct/tools/gui/StencilTableGui.java @@ -101,6 +101,9 @@ public class StencilTableGui extends GuiContainer activeButton = StencilBuilder.getIndex(logic.getStackInSlot(1)); setActiveButton(activeButton); + ItemStack stack = StencilBuilder.getStencil(((GuiButtonStencil)this.buttonList.get(activeButton)).element.stencilIndex); + logic.setSelectedPattern(stack); + updateServer(stack); } @Override @@ -113,7 +116,7 @@ public class StencilTableGui extends GuiContainer ItemStack stack = StencilBuilder.getStencil(id); if(stack != null) { - logic.setInventorySlotContents(1, stack); + logic.setSelectedPattern(stack); updateServer(stack); } } diff --git a/src/main/java/tconstruct/tools/logic/StencilTableLogic.java b/src/main/java/tconstruct/tools/logic/StencilTableLogic.java index 037499f9..29a5ac29 100644 --- a/src/main/java/tconstruct/tools/logic/StencilTableLogic.java +++ b/src/main/java/tconstruct/tools/logic/StencilTableLogic.java @@ -13,6 +13,8 @@ import tconstruct.tools.inventory.PatternShaperContainer; public class StencilTableLogic extends InventoryLogic implements ISidedInventory { + private ItemStack selectedStack; + public StencilTableLogic() { super(2); @@ -44,13 +46,19 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory super.onInventoryChanged(); }*/ + public void setSelectedPattern(ItemStack stack) + { + selectedStack = stack; + this.setInventorySlotContents(1, stack); + } + @Override public void setInventorySlotContents (int slot, ItemStack itemstack) { super.setInventorySlotContents(slot, itemstack); if (slot == 0 && itemstack != null && StencilBuilder.isBlank(itemstack)) { - setInventorySlotContents(1, new ItemStack(TinkerTools.woodPattern, 1, 1)); + setInventorySlotContents(1, selectedStack); } }