Only check for entities to damage if the structure is valid (#161)

Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
This commit is contained in:
koolkrafter5andMaya authored and GitHub committed 2025-04-09 03:27:07 +00:00
1 parent 760594f040
commit 8a2d2b6373
1 file changed
+3 -4
@@ -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) {