mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-25 14:34:28 +00:00
#567 Improved server start up times when using large EnderIO power networks
This commit is contained in:
1 parent
120b4ec709
commit
1d4e072557
2 files changed
+15
-1
No files matched your search
@@ -3,6 +3,7 @@
|
||||
- #591 Work around to avoid non reproducible crash.
|
||||
- #587 Crash placing Item Conduit between Iron Chest & Basic Project Bench
|
||||
- #582 Dimensional Transceiver cannot be powered locally unless power mode is set to send
|
||||
- #567 Improved server startup times when using large EnderIO power networks
|
||||
|
||||
1.0
|
||||
- #447 Capacitor Bank and Quite Clear Glass causing rendering issues.
|
||||
|
||||
@@ -39,6 +39,8 @@ public class NetworkPowerManager {
|
||||
|
||||
private final List<ReceptorEntry> storageReceptors = new ArrayList<ReceptorEntry>();
|
||||
|
||||
private boolean receptorsDirty = true;
|
||||
|
||||
private boolean lastActiveValue = false;
|
||||
private int ticksWithNoPower = 0;
|
||||
|
||||
@@ -126,6 +128,8 @@ public class NetworkPowerManager {
|
||||
|
||||
trackerStartTick();
|
||||
|
||||
checkReceptors();
|
||||
|
||||
// Update our energy stored based on what's in our conduits
|
||||
updateNetorkStorage();
|
||||
networkPowerTracker.tickStart(energyStored);
|
||||
@@ -381,16 +385,25 @@ public class NetworkPowerManager {
|
||||
}
|
||||
|
||||
public void receptorsChanged() {
|
||||
receptorsDirty = true;
|
||||
}
|
||||
|
||||
private void checkReceptors() {
|
||||
if(!receptorsDirty) {
|
||||
return;
|
||||
}
|
||||
receptors.clear();
|
||||
storageReceptors.clear();
|
||||
for (ReceptorEntry rec : network.getPowerReceptors()) {
|
||||
if(rec.powerInterface.getDelegate() instanceof TileCapacitorBank) {
|
||||
if(rec.powerInterface.getDelegate() != null && rec.powerInterface.getDelegate().getClass() == TileCapacitorBank.class) {
|
||||
storageReceptors.add(rec);
|
||||
} else {
|
||||
receptors.add(rec);
|
||||
}
|
||||
}
|
||||
receptorIterator = receptors.listIterator();
|
||||
|
||||
receptorsDirty = false;
|
||||
}
|
||||
|
||||
void onNetworkDestroyed() {
|
||||
|
||||
Reference in new issue
Block a user