diff --git a/common/mekanism/api/gas/GasNetwork.java b/common/mekanism/api/gas/GasNetwork.java index 39b82f0ad..7747ce568 100644 --- a/common/mekanism/api/gas/GasNetwork.java +++ b/common/mekanism/api/gas/GasNetwork.java @@ -38,6 +38,8 @@ public class GasNetwork extends DynamicNetwork public GasStack gasStored; public int prevStored; + + public int prevTransferAmount = 0; public GasNetwork(IGridTransmitter... varPipes) { @@ -209,6 +211,8 @@ public class GasNetwork extends DynamicNetwork if(FMLCommonHandler.instance().getEffectiveSide().isServer()) { + prevTransferAmount = 0; + if(transferDelay == 0) { didTransfer = false; @@ -236,7 +240,8 @@ public class GasNetwork extends DynamicNetwork if(gasStored != null) { - gasStored.amount -= tickEmit(gasStored); + prevTransferAmount = tickEmit(gasStored); + gasStored.amount -= prevTransferAmount; if(gasStored.amount <= 0) { @@ -459,10 +464,16 @@ public class GasNetwork extends DynamicNetwork { return Integer.toString(getGasNeeded()); } + + @Override + public String getStored() + { + return gasStored != null ? gasStored.getGas().getLocalizedName() + " (" + gasStored.amount + ")" : "None"; + } @Override public String getFlow() { - return gasStored != null ? gasStored.getGas().getLocalizedName() + " (" + gasStored.amount + ")" : "None"; + return Integer.toString(prevTransferAmount) + "/t"; } } diff --git a/common/mekanism/api/transmitters/ITransmitterNetwork.java b/common/mekanism/api/transmitters/ITransmitterNetwork.java index 25589b7b5..2d5138a0f 100644 --- a/common/mekanism/api/transmitters/ITransmitterNetwork.java +++ b/common/mekanism/api/transmitters/ITransmitterNetwork.java @@ -12,6 +12,8 @@ public interface ITransmitterNetwork> public int getAcceptorSize(); public String getNeeded(); + + public String getStored(); public String getFlow(); diff --git a/common/mekanism/common/EnergyNetwork.java b/common/mekanism/common/EnergyNetwork.java index c40eed35a..cddc8260f 100644 --- a/common/mekanism/common/EnergyNetwork.java +++ b/common/mekanism/common/EnergyNetwork.java @@ -34,7 +34,7 @@ public class EnergyNetwork extends DynamicNetwork private double lastPowerScale = 0; private double joulesTransmitted = 0; - private double joulesLastTick = 0; + private double jouleBufferLastTick = 0; public double clientEnergyScale = 0; @@ -63,10 +63,10 @@ public class EnergyNetwork extends DynamicNetwork { if(net != null) { - if(net.joulesLastTick > joulesLastTick || net.clientEnergyScale > clientEnergyScale) + if(net.jouleBufferLastTick > jouleBufferLastTick || net.clientEnergyScale > clientEnergyScale) { clientEnergyScale = net.clientEnergyScale; - joulesLastTick = net.joulesLastTick; + jouleBufferLastTick = net.jouleBufferLastTick; joulesTransmitted = net.joulesTransmitted; lastPowerScale = net.lastPowerScale; } @@ -153,7 +153,8 @@ public class EnergyNetwork extends DynamicNetwork tryAgain = true; } } while(tryAgain); - + + joulesTransmitted = sent; return sent; } @@ -224,8 +225,6 @@ public class EnergyNetwork extends DynamicNetwork } } } - - joulesTransmitted += sent; } return sent; @@ -411,18 +410,18 @@ public class EnergyNetwork extends DynamicNetwork public double getPowerScale() { - return Math.max(joulesLastTick == 0 ? 0 : Math.min(Math.ceil(Math.log10(getPower())*2)/10, 1), getCapacity() == 0 ? 0 : electricityStored/getCapacity()); + return Math.max(jouleBufferLastTick == 0 ? 0 : Math.min(Math.ceil(Math.log10(getPower())*2)/10, 1), getCapacity() == 0 ? 0 : electricityStored/getCapacity()); } public void clearJoulesTransmitted() { - joulesLastTick = joulesTransmitted; + jouleBufferLastTick = electricityStored; joulesTransmitted = 0; } public double getPower() { - return joulesLastTick * 20; + return jouleBufferLastTick * 20; } @Override @@ -430,7 +429,7 @@ public class EnergyNetwork extends DynamicNetwork { EnergyNetwork network = new EnergyNetwork(varTransmitters); network.clientEnergyScale = clientEnergyScale; - network.joulesLastTick = joulesLastTick; + network.jouleBufferLastTick = jouleBufferLastTick; network.joulesTransmitted = joulesTransmitted; network.lastPowerScale = lastPowerScale; network.electricityStored += electricityStored; @@ -442,7 +441,7 @@ public class EnergyNetwork extends DynamicNetwork { EnergyNetwork network = new EnergyNetwork(collection); network.clientEnergyScale = clientEnergyScale; - network.joulesLastTick = joulesLastTick; + network.jouleBufferLastTick = jouleBufferLastTick; network.joulesTransmitted = joulesTransmitted; network.lastPowerScale = lastPowerScale; network.electricityStored += electricityStored; @@ -467,9 +466,15 @@ public class EnergyNetwork extends DynamicNetwork return MekanismUtils.getEnergyDisplay(getEnergyNeeded()); } + @Override + public String getStored() + { + return MekanismUtils.getEnergyDisplay(electricityStored); + } + @Override public String getFlow() { - return MekanismUtils.getPowerDisplay(20*electricityStored); + return MekanismUtils.getPowerDisplay(20*joulesTransmitted); } } diff --git a/common/mekanism/common/FluidNetwork.java b/common/mekanism/common/FluidNetwork.java index a5988239b..5db6d1193 100644 --- a/common/mekanism/common/FluidNetwork.java +++ b/common/mekanism/common/FluidNetwork.java @@ -36,6 +36,8 @@ public class FluidNetwork extends DynamicNetwork public FluidStack fluidStored; public int prevStored; + + public int prevTransferAmount = 0; public FluidNetwork(IGridTransmitter... varPipes) { @@ -456,12 +458,18 @@ public class FluidNetwork extends DynamicNetwork @Override public String getNeeded() { - return "Fluid needed (any type): " + (float)getFluidNeeded()/1000F + " buckets"; + return "Fluid needed: " + (float)getFluidNeeded()/1000F + " buckets"; } + @Override + public String getStored() + { + return fluidStored == null ? "None" : fluidStored.getFluid().getLocalizedName() + ", " + fluidStored.amount + "mB"; + } + @Override public String getFlow() { - return fluidStored == null ? "None" : fluidStored.getFluid().getLocalizedName() + ", " + fluidStored.amount + "mB/tick"; + return Integer.toString(prevTransferAmount); } } diff --git a/common/mekanism/common/item/ItemNetworkReader.java b/common/mekanism/common/item/ItemNetworkReader.java index 86965d28c..d40e9f754 100644 --- a/common/mekanism/common/item/ItemNetworkReader.java +++ b/common/mekanism/common/item/ItemNetworkReader.java @@ -38,8 +38,9 @@ public class ItemNetworkReader extends ItemEnergized player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Transmitters: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getSize())); player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Acceptors: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getAcceptorSize())); player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Needed: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getNeeded())); - player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Power: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getFlow() )); - player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Capacity: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getCapacity() + "/tick" )); + player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Buffer: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getStored())); + player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Throughput: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getFlow())); + player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Capacity: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getCapacity() + "/tick")); player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------")); } }