Disable level emitter on offline networks
Turns off level emitters if the goes offline because it runs out of power, channels or similar.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package appeng.parts.automation;
|
package appeng.parts.automation;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -77,6 +78,7 @@ import appeng.tile.inventory.AppEngInternalAEInventory;
|
|||||||
import appeng.tile.inventory.InvOperation;
|
import appeng.tile.inventory.InvOperation;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherHost, IStackWatcherHost, ICraftingWatcherHost,
|
public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherHost, IStackWatcherHost, ICraftingWatcherHost,
|
||||||
IMEMonitorHandlerReceiver<IAEItemStack>, ICraftingProvider
|
IMEMonitorHandlerReceiver<IAEItemStack>, ICraftingProvider
|
||||||
{
|
{
|
||||||
@@ -133,8 +135,6 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
|
||||||
if ( this.proxy.isActive() )
|
|
||||||
{
|
{
|
||||||
boolean isOn = this.isLevelEmitterOn();
|
boolean isOn = this.isLevelEmitterOn();
|
||||||
if ( this.prevState != isOn )
|
if ( this.prevState != isOn )
|
||||||
@@ -146,7 +146,6 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
|||||||
Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
|
Platform.notifyBlocksOfNeighbors( te.getWorldObj(), te.xCoord + this.side.offsetX, te.yCoord + this.side.offsetY, te.zCoord + this.side.offsetZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT( NBTTagCompound data )
|
public void writeToNBT( NBTTagCompound data )
|
||||||
@@ -366,7 +365,8 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartLevelEmitter(ItemStack is) {
|
public PartLevelEmitter( ItemStack is )
|
||||||
|
{
|
||||||
super( PartLevelEmitter.class, is );
|
super( PartLevelEmitter.class, is );
|
||||||
this.getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL );
|
this.getConfigManager().registerSetting( Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL );
|
||||||
this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
this.getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||||
@@ -569,7 +569,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
|||||||
private boolean isLevelEmitterOn()
|
private boolean isLevelEmitterOn()
|
||||||
{
|
{
|
||||||
if ( Platform.isClient() )
|
if ( Platform.isClient() )
|
||||||
|
{
|
||||||
return ( this.clientFlags & this.FLAG_ON ) == this.FLAG_ON;
|
return ( this.clientFlags & this.FLAG_ON ) == this.FLAG_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !this.proxy.isActive() )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
|
if ( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user