From fdcba13369d5010fe982b993bf53ee00777fd15c Mon Sep 17 00:00:00 2001 From: yueh Date: Sun, 2 Sep 2018 14:00:15 +0200 Subject: [PATCH] Power off a network in case it losses its local buffer. (#3703) This better indicates power issue with dynamic consumption like extracting/inserting items into a network. E.g. the terminals will shutdown, no light/channel/etc indicators. Due to the networks trying to extract from the largest possible energy storage first, the network buffer will be used as last option after energy cells or controllers. Potentially needs evaluation in case of adhoc networks with a high transfer rate locally. Increasing the local buffer might be an idea or have it scale with the amount of local gridnodes. As long as it does not invalidates energy cells. --- src/main/java/appeng/me/cache/EnergyGridCache.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index 8f295a8fe..c64459a8e 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -678,6 +678,12 @@ public class EnergyGridCache implements IEnergyGrid { EnergyGridCache.this.myGrid.postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) ); } + + if( this.stored < 0.01 ) + { + EnergyGridCache.this.ticksSinceHasPowerChange = 0; + EnergyGridCache.this.publicPowerState( false, EnergyGridCache.this.myGrid ); + } } } }