From 6aba01fb2cdb4ae585798fb5a1f099a034b477ce Mon Sep 17 00:00:00 2001 From: RiggZh Date: Thu, 17 Apr 2025 06:40:43 +0800 Subject: [PATCH] feat: only input slot change need rebuild --- .../tools/logic/ToolStationLogic.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java index 33b2618e..e779fc6b 100644 --- a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java @@ -53,9 +53,25 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory return new ToolStationContainer(inventoryplayer, this); } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + super.setInventorySlotContents(slot, stack); + if (slot != 0) { + buildTool(toolName); + } + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + ItemStack itemstack = super.decrStackSize(slot, amount); + if (slot != 0) { + buildTool(toolName); + } + return itemstack; + } + @Override public void markDirty() { - buildTool(toolName); if (this.worldObj != null) { this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);