From afa0418104e817e972f8062f80410a7bfb1c573a Mon Sep 17 00:00:00 2001 From: abel1502 Date: Mon, 2 Jun 2025 00:11:28 +0300 Subject: [PATCH] Make strand caster timeout refresh on pour Previously, if a caster has been idle for a while, the first time something is poured into it, it would spew out a partial load almost immediately. The original intention behind the timeout was instead to make the strand caster perform incomplete operations if no new material has been poured for a while. This change makes the behaviour closer to intended. Most of the time, persistent use of the caster would consistently reach full fill, and incomplete fill will only be processed at the end. --- .../machine/TileEntityMachineStrandCaster.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineStrandCaster.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineStrandCaster.java index 9ca467285..a3a8b3ded 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineStrandCaster.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineStrandCaster.java @@ -32,7 +32,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase public FluidTank water; public FluidTank steam; - private long lastCastTick = 0; + private long lastProgressTick = 0; public String getName() { return "container.machineStrandCaster"; @@ -77,7 +77,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase int moldsToCast = maxProcessable(); // Makes it flush the buffers after 10 seconds of inactivity, or when they're full - if (moldsToCast > 0 && (moldsToCast >= 9 || worldObj.getWorldTime() >= lastCastTick + 200)) { + if (moldsToCast > 0 && (moldsToCast >= 9 || worldObj.getWorldTime() >= lastProgressTick + 200)) { ItemMold.Mold mold = this.getInstalledMold(); @@ -108,7 +108,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase water.setFill(water.getFill() - getWaterRequired() * moldsToCast); steam.setFill(steam.getFill() + getWaterRequired() * moldsToCast); - lastCastTick = worldObj.getWorldTime(); + lastProgressTick = worldObj.getWorldTime(); } networkPackNT(150); @@ -226,6 +226,8 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase stack.amount -= required; + lastProgressTick = world.getWorldTime(); + return stack; } @@ -272,7 +274,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase super.writeToNBT(nbt); water.writeToNBT(nbt, "w"); steam.writeToNBT(nbt, "s"); - nbt.setLong("t", lastCastTick); + nbt.setLong("t", lastProgressTick); } @Override @@ -280,7 +282,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase super.readFromNBT(nbt); water.readFromNBT(nbt, "w"); steam.readFromNBT(nbt, "s"); - lastCastTick = nbt.getLong("t"); + lastProgressTick = nbt.getLong("t"); } @Override