From 1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Tue, 13 Jun 2017 20:58:18 +0300 Subject: enet update --- ihl/flexible_cable/IHLGrid.java | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'ihl/flexible_cable/IHLGrid.java') diff --git a/ihl/flexible_cable/IHLGrid.java b/ihl/flexible_cable/IHLGrid.java index d223e10..92a64c8 100644 --- a/ihl/flexible_cable/IHLGrid.java +++ b/ihl/flexible_cable/IHLGrid.java @@ -21,7 +21,7 @@ public class IHLGrid public double energy=0D; private IEnergyNetNode sink; private IEnergyNetNode source; - private double voltage; + private double voltage=400d; private double lastVoltage; public boolean isGridValid=true; private double total20TicksEU; @@ -139,6 +139,18 @@ public class IHLGrid private void updateGrid() { + Iterator atei2 = telist.iterator(); + while (atei2.hasNext()) { + IEnergyNetNode cte = atei2.next(); + if (cte.isTileEntityBaseInvalid()) { + if (!cte.getCableList().isEmpty()) { + for (IHLCable cable : cte.getCableList()) { + IHLMod.enet.cablesToGrids.remove(cable.chainUID); + } + } + atei2.remove(); + } + } if(this.source!=null && this.sink!=null && this.source!=this.sink && @@ -240,6 +252,8 @@ public class IHLGrid cursor=this.getHasCable(cable, cursor, gridTEList); } this.energyLossSinkMap.put(sink, powerLossPerSquaredEU); + if(voltage1<1d) + voltage1=1d; this.voltageSinkMap.put(sink, voltage1); } this.calculatedSources.add(this.source); @@ -299,4 +313,15 @@ public class IHLGrid } } } + + public void remove(IEnergyNetNode e) { + this.telist.remove(e); + if(!e.getCableList().isEmpty()) + { + for(IHLCable cable:e.getCableList()) + { + IHLMod.enet.cablesToGrids.remove(cable.chainUID); + } + } + } } -- cgit v1.2.3