From 2eef2721b64e9f31f605eecbc68a557e76e25bc4 Mon Sep 17 00:00:00 2001 From: PouffyDev <99536749+pouffy@users.noreply.github.com> Date: Tue, 8 Jul 2025 20:43:02 +0100 Subject: [PATCH] Attachment fix - Changed key/value order in the Vat's machineMap (OLD -> NEW ) to allow for multiple of the same operation. --- .../content/machinery/vat/base/VatBlockEntity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java index 3abd94db..32e9188a 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java @@ -92,7 +92,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor // public LerpedFloat[] fluidLevel = new LerpedFloat[8]; /// / - public Map machineMap = new HashMap<>(); + public Map machineMap = new HashMap<>(); public Map operationalMachinesMap = new HashMap<>(); public boolean areMachinesValid = true; boolean evaluateNextTick = true; @@ -395,7 +395,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor handleRecipe(); if (isController()) { - for (BlockPos machinePos : machineMap.values()) { + for (BlockPos machinePos : machineMap.keySet()) { BlockEntity blockEntity = level.getBlockEntity(machinePos); if (blockEntity instanceof IVatMachine vatMachine) { boolean operational = vatMachine.canOperate(this); @@ -637,7 +637,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor return; } - Map oldMachineMap = machineMap; + Map oldMachineMap = machineMap; machineMap = new HashMap<>(); heatLevel = 0; heatCondition = HeatCondition.NONE; @@ -665,7 +665,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor continue; be.vatUpdated(this); - machineMap.put(be.getOperationId(), pos); + machineMap.put(pos, be.getOperationId()); efficiency *= (be.getWorkPercentage() / 100); } @@ -906,9 +906,9 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor CreateLang.translate("goggles.vat.attachments") .style(ChatFormatting.GRAY) .forGoggles(tooltip); - for (Map.Entry machines : machineMap.entrySet()) { - boolean operational = operationalMachinesMap.getOrDefault(machines.getValue(), true); - addMachineTooltip(machines.getKey(), operational, tooltip); + for (Map.Entry machines : machineMap.entrySet()) { + boolean operational = operationalMachinesMap.getOrDefault(machines.getKey(), true); + addMachineTooltip(machines.getValue(), operational, tooltip); }