diff --git a/src/main/java/resonantinduction/electrical/multimeter/GuiMultimeter.java b/src/main/java/resonantinduction/electrical/multimeter/GuiMultimeter.java index 7d05f6431..4f5c90a4e 100644 --- a/src/main/java/resonantinduction/electrical/multimeter/GuiMultimeter.java +++ b/src/main/java/resonantinduction/electrical/multimeter/GuiMultimeter.java @@ -75,8 +75,8 @@ public class GuiMultimeter extends GuiContainerBase this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 15, 4210752); this.fontRenderer.drawString(EnumColor.INDIGO + LanguageUtility.getLocal("gui.resonantinduction.multimeter.energy"), 35, 15, 4210752); this.renderUniversalDisplay(35, 25, this.multimeter.getNetwork().graph.get(0), mouseX, mouseY, Unit.JOULES); - this.fontRenderer.drawString(EnumColor.INDIGO + LanguageUtility.getLocal("gui.resonantinduction.multimeter.energy"), 35, 35, 4210752); - this.renderUniversalDisplay(35, 45, this.multimeter.getNetwork().graph.get(0), mouseX, mouseY, Unit.JOULES); + this.fontRenderer.drawString(EnumColor.INDIGO + LanguageUtility.getLocal("gui.resonantinduction.multimeter.capacity"), 35, 35, 4210752); + this.renderUniversalDisplay(35, 45, this.multimeter.getNetwork().graph.getPeak(), mouseX, mouseY, Unit.JOULES); this.fontRenderer.drawString(EnumColor.ORANGE + LanguageUtility.getLocal("gui.resonantinduction.multimeter.redstone"), 35, 58, 4210752); this.fontRenderer.drawString(EnumColor.RED + LanguageUtility.getLocal("gui.resonantinduction.multimeter." + this.multimeter.getMode().display), 35, 68, 4210752); this.fontRenderer.drawString(Unit.JOULES.name + "(s)", 35, 100, 4210752); diff --git a/src/main/java/resonantinduction/electrical/multimeter/MultimeterNetwork.java b/src/main/java/resonantinduction/electrical/multimeter/MultimeterNetwork.java index 6dda7999c..2e281cc54 100644 --- a/src/main/java/resonantinduction/electrical/multimeter/MultimeterNetwork.java +++ b/src/main/java/resonantinduction/electrical/multimeter/MultimeterNetwork.java @@ -1,5 +1,6 @@ package resonantinduction.electrical.multimeter; +import java.util.ArrayList; import java.util.List; import universalelectricity.api.net.IUpdate; @@ -9,7 +10,7 @@ import universalelectricity.core.net.NetworkTickHandler; public class MultimeterNetwork extends Network implements IUpdate { - public List displayInformation; + public final List displayInformation = new ArrayList(); public Graph graph = new Graph(20 * 10); /** @@ -29,6 +30,14 @@ public class MultimeterNetwork extends Network 0) - { - graph.add(queueGraphValue); - queueGraphValue = 0; - } + graph.add(queueGraphValue); + queueGraphValue = 0; + displayInformation.clear(); + doUpdate = false; } @Override public boolean canUpdate() { - return getConnectors().size() > 0; + return doUpdate && continueUpdate(); } @Override public boolean continueUpdate() { - return canUpdate(); + return getConnectors().size() > 0; } public void updateGraph(long detectedValue) { queueGraphValue += detectedValue; + doUpdate = true; } @Override @@ -83,16 +92,16 @@ public class MultimeterNetwork extends Network