From 770a609f7a0a466dea4b29778716c6c80f72287a Mon Sep 17 00:00:00 2001 From: Dennis <47501679+Denostrov@users.noreply.github.com> Date: Tue, 2 May 2023 22:50:49 +0300 Subject: [PATCH] fix smeltery tps lag by clearing drain array before structure check (#82) --- .../java/tconstruct/smeltery/logic/CastingBlockLogic.java | 5 ++++- src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java b/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java index e79ab444..ebd08ef1 100644 --- a/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java @@ -373,7 +373,10 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid tick++; if (tick % 20 == 0) { tick = 0; - if (needsUpdate) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (needsUpdate) { + needsUpdate = false; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } } diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 2d90c278..c0723e55 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -794,6 +794,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public boolean checkSameLevel(int x, int y, int z, int[] sides) { lavaTanks.clear(); + drains.clear(); boolean check = checkBricksOnLevel(x, y, z, sides); return check && lavaTanks.size() > 0; }