All Terminals now can be opened in low power / channel state and show dark slots.

This commit is contained in:
AlgorithmX2
2014-03-27 23:31:06 -05:00
parent 5e36754cfd
commit c40c81070c
18 changed files with 204 additions and 38 deletions
@@ -85,6 +85,8 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
@Override
public void updateProgressBar(int key, int value)
{
super.updateProgressBar( key, value );
if ( key == 0 )
security = value;
}
@@ -92,7 +94,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
@Override
public void detectAndSendChanges()
{
verifyPermissions( SecurityPermissions.SECURITY, true );
verifyPermissions( SecurityPermissions.SECURITY, false );
int newSecurity = 0;
@@ -105,6 +107,8 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
newSecurity = newSecurity | (1 << sp.ordinal());
}
updatePowerStatus();
if ( newSecurity != security )
{
if ( Platform.isServer() )
@@ -138,14 +142,14 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
{
ItemStack term = wirelessIn.getStack().copy();
INetworkEncodable netEncodeable = null;
if ( term.getItem() instanceof INetworkEncodable )
netEncodeable = (INetworkEncodable) term.getItem();
IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term );
if ( wTermHandler != null )
netEncodeable = wTermHandler;
if ( netEncodeable != null )
{
netEncodeable.setEncryptionKey( term, "" + securityBox.securityKey, "" );