diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-06-13 20:58:18 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-06-13 20:58:18 +0300 |
| commit | 1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c (patch) | |
| tree | f9de575627405d0c407b2afb442ab18a6fbea01f /ihl/flexible_cable/IHLGrid.java | |
| parent | 50d62a1298f05d6d440a5bc261a0fdf9ffece893 (diff) | |
enet update
Diffstat (limited to 'ihl/flexible_cable/IHLGrid.java')
| -rw-r--r-- | ihl/flexible_cable/IHLGrid.java | 27 |
1 files changed, 26 insertions, 1 deletions
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<IEnergyNetNode> 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);
+ }
+ }
+ }
}
|
