From 8a2d2b63738bc2c6b0d08e6bf561c93ec8151ac1 Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Tue, 8 Apr 2025 23:27:07 -0400 Subject: [PATCH] Only check for entities to damage if the structure is valid (#161) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 9da553ed..80d31fdc 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -325,7 +325,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci } void detectEntities() { - if (minPos == null || maxPos == null) return; + if (!validStructure || minPos == null || maxPos == null) return; AxisAlignedBB box = AxisAlignedBB .getBoundingBox(minPos.x, minPos.y, minPos.z, maxPos.x + 1, minPos.y + layers, maxPos.z + 1); @@ -334,13 +334,12 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci for (Entity o : list) { if (o.isDead) return; - if (moltenMetal.size() >= 1) { + if (!moltenMetal.isEmpty()) { Fluid fluid = null; int amount = 0; float damage = 5; - if (o instanceof EntityVillager && PHConstruct.meltableVillagers) { - EntityVillager villager = (EntityVillager) o; + if (o instanceof EntityVillager villager && PHConstruct.meltableVillagers) { fluid = TinkerSmeltery.moltenEmeraldFluid; amount = villager.isChild() ? 5 : 40; } else if (o instanceof EntityEnderman) {