From 89c97abbdca4c7a76fde52b5fd04e35c95bae050 Mon Sep 17 00:00:00 2001 From: BallOfEnergy <66693744+BallOfEnergy1@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:59:01 -0500 Subject: [PATCH] i looked back here and nearly had a fucking stroke from this code --- .../machine/rbmk/TileEntityRBMKRod.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java index f67843023..70750e00a 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java @@ -33,6 +33,9 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import java.util.ArrayList; +import java.util.List; + @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent { @@ -464,25 +467,21 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM @Callback(direct = true) @Optional.Method(modid = "OpenComputers") public Object[] getInfo(Context context, Arguments args) { - Object OC_enrich_buf; - Object OC_poison_buf; - Object OC_hull_buf; - Object OC_core_buf; - String OC_type; + List returnValues = new ArrayList<>(); if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) { - OC_enrich_buf = ItemRBMKRod.getEnrichment(slots[0]); - OC_poison_buf = ItemRBMKRod.getPoison(slots[0]); - OC_hull_buf = ItemRBMKRod.getHullHeat(slots[0]); - OC_core_buf = ItemRBMKRod.getCoreHeat(slots[0]); - OC_type = slots[0].getItem().getUnlocalizedName(); - } else { - OC_enrich_buf = "N/A"; - OC_poison_buf = "N/A"; - OC_hull_buf = "N/A"; - OC_core_buf = "N/A"; - OC_type = "N/A"; - } - return new Object[] {heat, OC_hull_buf, OC_core_buf, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf, OC_type, ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord}; + returnValues.add(ItemRBMKRod.getHullHeat(slots[0])); + returnValues.add(ItemRBMKRod.getCoreHeat(slots[0])); + returnValues.add(ItemRBMKRod.getEnrichment(slots[0])); + returnValues.add(ItemRBMKRod.getPoison(slots[0])); + returnValues.add(slots[0].getItem().getUnlocalizedName()); + } else + for (int i = 0; i < 5; i++) + returnValues.add("N/A"); + + return new Object[] { + heat, returnValues.get(0), returnValues.get(1), + fluxSlow, fluxFast, returnValues.get(2), returnValues.get(3), returnValues.get(4), + ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord}; } @Callback(direct = true)