From 3548fcb9a96f40b0304d32f212985438e8fa31cb Mon Sep 17 00:00:00 2001 From: Eldrinn-Elantey <46845681+Eldrinn-Elantey@users.noreply.github.com> Date: Sun, 26 Apr 2026 08:10:40 +0400 Subject: [PATCH 1/3] Fix smeltery fuel gauge to account for all lava tanks (#273) Co-authored-by: Ruling-0 <47913168+Ruling-0@users.noreply.github.com> --- .../tconstruct/smeltery/gui/SmelteryGui.java | 34 ++--- .../smeltery/logic/LavaTankLogic.java | 4 +- .../smeltery/logic/SmelteryLogic.java | 143 ++++++++++++------ 3 files changed, 110 insertions(+), 71 deletions(-) diff --git a/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java b/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java index c2019fa3..1d1a1d38 100644 --- a/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java +++ b/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java @@ -39,24 +39,17 @@ public class SmelteryGui extends ActiveContainerGui { private final int columns; private final int smelterySize; public static final int maxRows = 8; + private int fuelDisplayTick = 0; public SmelteryGui(InventoryPlayer inventoryplayer, SmelteryLogic smeltery, World world, int x, int y, int z) { super((ActiveContainer) smeltery.getGuiContainer(inventoryplayer, world, x, y, z)); logic = smeltery; smelterySize = smeltery.getBlockCapacity(); - smeltery.updateFuelDisplay(); columns = ((SmelteryContainer) this.inventorySlots).columns; xSize = 254 + (columns - 3) * 22; // Adjust for column count } - @Override - public void initGui() { - super.initGui(); - - if (logic != null) logic.updateFuelDisplay(); - } - @Override public void drawScreen(int mouseX, int mouseY, float par3) { // the smeltery changed. we close the screen because updating the changes in all containers would be way too @@ -66,11 +59,13 @@ public class SmelteryGui extends ActiveContainerGui { return; } + if (fuelDisplayTick++ % 5 == 0) logic.updateFuelDisplay(); + updateScrollbar(mouseX, mouseY); + super.drawScreen(mouseX, mouseY, par3); - updateScrollbar(mouseX, mouseY, par3); } - protected void updateScrollbar(int mouseX, int mouseY, float par3) { + protected void updateScrollbar(int mouseX, int mouseY) { if (smelterySize > columns * maxRows) { boolean mouseDown = Mouse.isButtonDown(0); int lefto = this.guiLeft; @@ -144,13 +139,12 @@ public class SmelteryGui extends ActiveContainerGui { } // lava/fuel - if (logic.fuelGague > 0) { + int fuel = logic.getScaledFuelGague(52); + if (fuel > 0) { int leftX = cornerX + 117; - int topY = (cornerY + 68) - logic.getScaledFuelGague(52); - int sizeX = 12; - int sizeY = logic.getScaledFuelGague(52); - if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY) { - drawFluidStackTooltip(getFuelTooltip(logic.getFuel()), mouseX - cornerX + 36, mouseY - cornerY); + int topY = (cornerY + 68) - fuel; + if (mouseX >= leftX && mouseX <= leftX + 12 && mouseY >= topY && mouseY < topY + fuel) { + drawFluidStackTooltip(getFuelTooltip(), mouseX - cornerX + 36, mouseY - cornerY); } } } @@ -170,11 +164,11 @@ public class SmelteryGui extends ActiveContainerGui { // Fuel - Lava this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - if (logic.fuelGague > 0) { + int fuel = logic.getScaledFuelGague(52); + if (fuel > 0) { FluidStack fuelStack = logic.getFuel(); IIcon lavaIcon = fuelStack.getFluid().getStillIcon(); if (lavaIcon == null) lavaIcon = Blocks.lava.getIcon(0, 0); - int fuel = logic.getScaledFuelGague(52); int count = 0; while (fuel > 0) { int size = Math.min(fuel, 16); @@ -346,10 +340,10 @@ public class SmelteryGui extends ActiveContainerGui { this.zLevel = 0; } - private List getFuelTooltip(FluidStack liquid) { + private List getFuelTooltip() { ArrayList list = new ArrayList<>(); list.add("\u00A7f" + StatCollector.translateToLocal("gui.smeltery.fuel")); - list.add("mB: " + liquid.amount); + list.add(logic.fuelAmount + "/" + logic.fuelCapacity + " mB"); return list; } diff --git a/src/main/java/tconstruct/smeltery/logic/LavaTankLogic.java b/src/main/java/tconstruct/smeltery/logic/LavaTankLogic.java index 758b6369..475c8a81 100644 --- a/src/main/java/tconstruct/smeltery/logic/LavaTankLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/LavaTankLogic.java @@ -29,7 +29,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler { public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { int amount = tank.fill(resource, doFill); if (amount > 0 && doFill) { - renderOffset += resource.amount; + renderOffset += amount; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, this.getBlockType()); } @@ -41,7 +41,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler { public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { FluidStack amount = tank.drain(maxDrain, doDrain); if (amount != null && doDrain) { - renderOffset = -maxDrain; + renderOffset = -amount.amount; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, this.getBlockType()); } diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 5b338e7c..d447b0ca 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -2,6 +2,7 @@ package tconstruct.smeltery.logic; import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.List; import java.util.Random; @@ -75,9 +76,10 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public int useTime; public int fuelGague; public int fuelAmount; + public int fuelCapacity; protected boolean inUse; - protected ArrayList lavaTanks; + protected List lavaTanks; protected ArrayList drains; protected CoordTuple activeLavaTank; @@ -96,7 +98,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public SmelteryLogic() { super(0); - lavaTanks = new ArrayList<>(); + lavaTanks = Collections.synchronizedList(new ArrayList<>()); drains = new ArrayList<>(); activeTemps = new int[0]; meltingTemps = new int[0]; @@ -262,8 +264,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci } public int getScaledFuelGague(int scale) { - int ret = (fuelGague * scale) / 52; - if (ret < 1) ret = 1; + if (fuelCapacity <= 0) return 0; + int ret = (int) ((float) fuelAmount * (float) scale / (float) fuelCapacity); + if (ret < 1 && fuelAmount > 0) ret = 1; return ret; } @@ -502,22 +505,40 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci } public void updateFuelDisplay() { - // ensure our active tank is valid - verifyFuelTank(); - if (activeLavaTank == null) { - fuelAmount = 0; - fuelGague = 0; - return; + int totalAmount = 0; + int totalCapacity = 0; + FluidStack fuelType = null; + + synchronized (lavaTanks) { + Iterator iter = lavaTanks.iterator(); + while (iter.hasNext()) { + CoordTuple coord = iter.next(); + if (!worldObj.blockExists(coord.x, coord.y, coord.z)) continue; + + TileEntity te = worldObj.getTileEntity(coord.x, coord.y, coord.z); + if (!(te instanceof IFluidHandler)) { + iter.remove(); + continue; + } + + FluidTankInfo[] info = ((IFluidHandler) te).getTankInfo(ForgeDirection.DOWN); + if (info.length <= 0) continue; + + totalCapacity += info[0].capacity; + + if (info[0].fluid != null && info[0].fluid.amount > 0) { + if (fuelType == null) { + fuelType = info[0].fluid; + totalAmount += info[0].fluid.amount; + } else if (fuelType.isFluidEqual(info[0].fluid)) { + totalAmount += info[0].fluid.amount; + } + } + } } - // checks are all done before in verifyFuelTank. Don't do this without checks! - IFluidHandler tankContainer = (IFluidHandler) worldObj - .getTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z); - FluidTankInfo[] info = tankContainer.getTankInfo(ForgeDirection.DOWN); - - int capacity = info[0].capacity; - fuelAmount = info[0].fluid.amount; - fuelGague = (int) ((float) fuelAmount * 52f / (float) capacity); + fuelAmount = totalAmount; + fuelCapacity = totalCapacity; } // actually is updateFuel. @@ -566,24 +587,26 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci // our tank got derped or is empty. time to look for a new one! activeLavaTank = null; - for (CoordTuple tank : lavaTanks) { - // does the tank still exist? - if (!worldObj.blockExists(tank.x, tank.y, tank.z)) continue; + synchronized (lavaTanks) { + for (CoordTuple tank : lavaTanks) { + // does the tank still exist? + if (!worldObj.blockExists(tank.x, tank.y, tank.z)) continue; - // yes, it does, but is it a tank? - TileEntity tankContainer = worldObj.getTileEntity(tank.x, tank.y, tank.z); - if (!(tankContainer instanceof IFluidHandler)) continue; + // yes, it does, but is it a tank? + TileEntity tankContainer = worldObj.getTileEntity(tank.x, tank.y, tank.z); + if (!(tankContainer instanceof IFluidHandler)) continue; - // yes it is, but does it contain a liquid? - FluidTankInfo[] info = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN); - if (info.length <= 0 || info[0].fluid == null || info[0].fluid.amount <= 0) continue; + // yes it is, but does it contain a liquid? + FluidTankInfo[] info = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN); + if (info.length <= 0 || info[0].fluid == null || info[0].fluid.amount <= 0) continue; - // is it also a smeltery fuel? - if (!Smeltery.isSmelteryFuel(info[0].fluid.getFluid())) continue; + // is it also a smeltery fuel? + if (!Smeltery.isSmelteryFuel(info[0].fluid.getFluid())) continue; - // we found a tank! :) - activeLavaTank = tank; - return; + // we found a tank! :) + activeLavaTank = tank; + return; + } } // possibly assign default empty tank here (tanks.get(0)) so we don't have a null activeLavaTank if all are @@ -592,15 +615,35 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci @SideOnly(Side.CLIENT) public FluidStack getFuel() { - if (activeLavaTank == null) - // sane default + FluidStack combined = null; + + synchronized (lavaTanks) { + Iterator iter = lavaTanks.iterator(); + while (iter.hasNext()) { + CoordTuple coord = iter.next(); + if (!worldObj.blockExists(coord.x, coord.y, coord.z)) continue; + + TileEntity te = worldObj.getTileEntity(coord.x, coord.y, coord.z); + if (!(te instanceof IFluidHandler)) { + iter.remove(); + continue; + } + + FluidTankInfo[] info = ((IFluidHandler) te).getTankInfo(ForgeDirection.DOWN); + if (info.length <= 0 || info[0].fluid == null || info[0].fluid.amount <= 0) continue; + + if (combined == null) { + combined = info[0].fluid.copy(); + } else if (combined.isFluidEqual(info[0].fluid)) { + combined.amount += info[0].fluid.amount; + } + } + } + + if (combined == null) { return new FluidStack(FluidRegistry.LAVA, 0); - - TileEntity tankContainer = worldObj.getTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z); - if (tankContainer instanceof IFluidHandler) - return ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN)[0].fluid; - - return new FluidStack(FluidRegistry.LAVA, 0); + } + return combined; } public FluidStack getResultFor(ItemStack stack) { @@ -736,17 +779,19 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci if (tempValidStructure) { // try to derive temperature from fueltank activeLavaTank = null; - for (CoordTuple tank : lavaTanks) { - TileEntity tankContainer = worldObj.getTileEntity(tank.x, tank.y, tank.z); - if (!(tankContainer instanceof IFluidHandler)) continue; + synchronized (lavaTanks) { + for (CoordTuple tank : lavaTanks) { + TileEntity tankContainer = worldObj.getTileEntity(tank.x, tank.y, tank.z); + if (!(tankContainer instanceof IFluidHandler)) continue; - FluidStack liquid = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN)[0].fluid; - if (liquid == null) continue; - if (!Smeltery.isSmelteryFuel(liquid.getFluid())) continue; + FluidStack liquid = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN)[0].fluid; + if (liquid == null) continue; + if (!Smeltery.isSmelteryFuel(liquid.getFluid())) continue; - internalTemp = Smeltery.getFuelPower(liquid.getFluid()); - activeLavaTank = tank; - break; + internalTemp = Smeltery.getFuelPower(liquid.getFluid()); + activeLavaTank = tank; + break; + } } // no tank with fuel. we reserve the first found one From 611d84923d9f6246a06eb2fbbae3825d63295f12 Mon Sep 17 00:00:00 2001 From: Pierre Zhang Date: Wed, 29 Apr 2026 01:35:21 +0800 Subject: [PATCH 2/3] Dump button, dumps the grid to linked inventory (#228) --- .../tools/gui/CraftingStationGui.java | 64 ++++++++++++++++++ .../inventory/CraftingStationContainer.java | 17 +++++ .../network/CraftingStationDumpPacket.java | 30 ++++++++ .../util/network/PacketPipeline.java | 2 + .../resources/assets/tinker/lang/en_US.lang | 1 + .../assets/tinker/textures/gui/icons.png | Bin 4785 -> 4194 bytes 6 files changed, 114 insertions(+) create mode 100644 src/main/java/tconstruct/util/network/CraftingStationDumpPacket.java diff --git a/src/main/java/tconstruct/tools/gui/CraftingStationGui.java b/src/main/java/tconstruct/tools/gui/CraftingStationGui.java index 2cb4928d..fd7ed55e 100644 --- a/src/main/java/tconstruct/tools/gui/CraftingStationGui.java +++ b/src/main/java/tconstruct/tools/gui/CraftingStationGui.java @@ -4,6 +4,8 @@ import java.awt.Rectangle; import java.util.Collections; import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; @@ -21,12 +23,14 @@ import codechicken.nei.VisiblityData; import codechicken.nei.api.INEIGuiHandler; import codechicken.nei.api.TaggedInventoryArea; import cpw.mods.fml.common.Optional; +import tconstruct.TConstruct; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.PatternBuilder; import tconstruct.library.modifier.IModifyable; import tconstruct.library.tools.ToolMaterial; import tconstruct.library.util.HarvestLevels; import tconstruct.tools.logic.CraftingStationLogic; +import tconstruct.util.network.CraftingStationDumpPacket; @Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems") public class CraftingStationGui extends GuiContainer implements INEIGuiHandler { @@ -121,6 +125,45 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler { this.craftingTextLeft = this.craftingLeft - this.guiLeft; this.descTextLeft = this.descLeft - this.guiLeft; + + // Add dump button if chest is connected + this.buttonList.clear(); + if (logic.chest != null) { + int bothOffset = 0; + if (logic.slotCount > 54) bothOffset += 12; + bothOffset += 122; + this.buttonList.add(new GuiButtonDump(0, this.guiLeft + bothOffset + 161, this.guiTop + 5)); + } + } + + @Override + protected void actionPerformed(GuiButton button) { + if (button.id == 0 && logic.chest != null) { + TConstruct.packetPipeline.sendToServer(new CraftingStationDumpPacket()); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + drawDumpButtonTooltip(mouseX, mouseY); + } + + private void drawDumpButtonTooltip(int mouseX, int mouseY) { + for (Object obj : this.buttonList) { + if (obj instanceof GuiButtonDump) { + GuiButtonDump button = (GuiButtonDump) obj; + if (button.func_146115_a()) { + this.drawHoveringText( + Collections.singletonList( + StatCollector.translateToLocal("craftingstation.dump_button.tooltip")), + mouseX, + mouseY, + this.fontRendererObj); + return; + } + } + } } @Override @@ -523,6 +566,27 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler { } } + private static class GuiButtonDump extends GuiButton { + + private GuiButtonDump(int id, int x, int y) { + super(id, x, y, 10, 10, ""); + } + + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) { + if (this.visible) { + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition + && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(CraftingStationGui.icons); + int v = this.field_146123_n ? 213 : 223; + drawTexturedModalRect(this.xPosition, this.yPosition, 0, v, this.width, this.height); + } + } + } + /* * Hide the deprecated stuff at the bottom */ diff --git a/src/main/java/tconstruct/tools/inventory/CraftingStationContainer.java b/src/main/java/tconstruct/tools/inventory/CraftingStationContainer.java index 0189cc04..d774dcdc 100644 --- a/src/main/java/tconstruct/tools/inventory/CraftingStationContainer.java +++ b/src/main/java/tconstruct/tools/inventory/CraftingStationContainer.java @@ -434,4 +434,21 @@ public class CraftingStationContainer extends Container { return didSomething; } + + // Dump crafting grid to connected chests + public void dumpCraftingGrid() { + if (logic.slotCount == 0) return; + + // 46 is the first slot index of the attached inventory + for (int i = 0; i < 9; i++) { + ItemStack stack = craftMatrix.getStackInSlot(i); + if (stack != null && stack.stackSize > 0) { + if (mergeItemStack(stack, 46, 46 + logic.slotCount, false)) { + craftMatrix.setInventorySlotContents(i, stack.stackSize > 0 ? stack : null); + } + } + } + + this.onCraftMatrixChanged(this.craftMatrix); + } } diff --git a/src/main/java/tconstruct/util/network/CraftingStationDumpPacket.java b/src/main/java/tconstruct/util/network/CraftingStationDumpPacket.java new file mode 100644 index 00000000..bfd174ed --- /dev/null +++ b/src/main/java/tconstruct/util/network/CraftingStationDumpPacket.java @@ -0,0 +1,30 @@ +package tconstruct.util.network; + +import net.minecraft.entity.player.EntityPlayer; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import mantle.common.network.AbstractPacket; +import tconstruct.tools.inventory.CraftingStationContainer; + +public class CraftingStationDumpPacket extends AbstractPacket { + + public CraftingStationDumpPacket() {} + + @Override + public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {} + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {} + + @Override + public void handleClientSide(EntityPlayer player) {} + + @Override + public void handleServerSide(EntityPlayer player) { + if (player.openContainer instanceof CraftingStationContainer) { + CraftingStationContainer container = (CraftingStationContainer) player.openContainer; + container.dumpCraftingGrid(); + } + } +} diff --git a/src/main/java/tconstruct/util/network/PacketPipeline.java b/src/main/java/tconstruct/util/network/PacketPipeline.java index 1a40fed8..454f19da 100644 --- a/src/main/java/tconstruct/util/network/PacketPipeline.java +++ b/src/main/java/tconstruct/util/network/PacketPipeline.java @@ -135,6 +135,8 @@ public class PacketPipeline extends MessageToMessageCodechz41rvCMaRf4<*ezW>1YdmfMbIM3%f=bn2X=brm|-FxO{2JASDjzeU2NPxHXMI@XLs?DxWs-Fcb6g z@i47Rw9uofgcogtQYs}J8F~=8XB6HmseL;S5{W0dYX$*k2p3qR#;dV z<915WB5QDP(A7xP(NHAdiljYS7^TQ_RZj?_5`$6YCtQ(u{rYv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ovc#SWeO~y#V@tZ$=8Eq9B$_Y7fc)5k@}+fM>8yv8`lE}iU1iy94Iv)w_H?W(t6n8Q}3;Y98{QtP89uh@(P>c{cQEh5LlFdMgplq%F zC|LHz5hIznz4lGPyJx^N!i2PY!aneqe18J(nhTZ!AJu*Dmr%eXBaIkxxMW_fIdufi z3At`JA*|wy<9@7TgxN`Dx=iHLDHCrD5YcQNIhQ(@Y`EiNO1NEImj}1 zn}924f&yN(pdk1N(9PxHEnKG9L=BljUd2rAJ4hp@ Date: Wed, 29 Apr 2026 13:02:08 +0200 Subject: [PATCH 3/3] Fixes the smeltry temperature texture (#277) --- src/main/java/tconstruct/smeltery/gui/SmelteryGui.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java b/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java index 1d1a1d38..a07efd50 100644 --- a/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java +++ b/src/main/java/tconstruct/smeltery/gui/SmelteryGui.java @@ -275,7 +275,7 @@ public class SmelteryGui extends ActiveContainerGui { int slotTemp = logic.getTempForSlot(iter + slotPos * columns) - 20; int maxTemp = logic.getMeltingPointForSlot(iter + slotPos * columns) - 20; if (slotTemp > 0 && maxTemp > 0) { - int size = 16 * slotTemp / maxTemp + 1; + int size = Math.max(1, Math.min(16, 16 * slotTemp / maxTemp)); drawTexturedModalRect( cornerX - xleft + (iter % columns * 22), cornerY + 8 + (iter / columns * 18) + 16 - size,