Basic reformat, hit once, hope never again
This commit is contained in:
@@ -36,10 +36,9 @@ import appeng.util.prioitylist.IPartitionList;
|
||||
public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
{
|
||||
|
||||
final StorageChannel channel;
|
||||
final protected IMEMonitor<T> monitor;
|
||||
final protected IMEInventoryHandler<T> internal;
|
||||
|
||||
final StorageChannel channel;
|
||||
private int myPriority;
|
||||
private IncludeExclude myWhitelist;
|
||||
private AccessRestriction myAccess;
|
||||
@@ -53,12 +52,12 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
{
|
||||
this.channel = channel;
|
||||
|
||||
if ( i instanceof IMEInventoryHandler )
|
||||
this.internal = ( IMEInventoryHandler<T> ) i;
|
||||
if( i instanceof IMEInventoryHandler )
|
||||
this.internal = (IMEInventoryHandler<T>) i;
|
||||
else
|
||||
this.internal = new MEPassThrough<T>( i, channel );
|
||||
|
||||
this.monitor = this.internal instanceof IMEMonitor ? ( IMEMonitor<T> ) this.internal : null;
|
||||
this.monitor = this.internal instanceof IMEMonitor ? (IMEMonitor<T>) this.internal : null;
|
||||
|
||||
this.myPriority = 0;
|
||||
this.myWhitelist = IncludeExclude.WHITELIST;
|
||||
@@ -66,17 +65,6 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
this.myPartitionList = new DefaultPriorityList<T>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority()
|
||||
{
|
||||
return this.myPriority;
|
||||
}
|
||||
|
||||
public void setPriority( int myPriority )
|
||||
{
|
||||
this.myPriority = myPriority;
|
||||
}
|
||||
|
||||
public IncludeExclude getWhitelist()
|
||||
{
|
||||
return this.myWhitelist;
|
||||
@@ -113,7 +101,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
@Override
|
||||
public T injectItems( T input, Actionable type, BaseActionSource src )
|
||||
{
|
||||
if ( !this.canAccept( input ) )
|
||||
if( !this.canAccept( input ) )
|
||||
return input;
|
||||
|
||||
return this.internal.injectItems( input, type, src );
|
||||
@@ -122,7 +110,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
@Override
|
||||
public T extractItems( T request, Actionable type, BaseActionSource src )
|
||||
{
|
||||
if ( !this.hasReadAccess )
|
||||
if( !this.hasReadAccess )
|
||||
return null;
|
||||
|
||||
return this.internal.extractItems( request, type, src );
|
||||
@@ -131,7 +119,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
@Override
|
||||
public IItemList<T> getAvailableItems( IItemList<T> out )
|
||||
{
|
||||
if ( !this.hasReadAccess )
|
||||
if( !this.hasReadAccess )
|
||||
return out;
|
||||
|
||||
return this.internal.getAvailableItems( out );
|
||||
@@ -152,7 +140,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
@Override
|
||||
public boolean isPrioritized( T input )
|
||||
{
|
||||
if ( this.myWhitelist == IncludeExclude.WHITELIST )
|
||||
if( this.myWhitelist == IncludeExclude.WHITELIST )
|
||||
return this.myPartitionList.isListed( input ) || this.internal.isPrioritized( input );
|
||||
return false;
|
||||
}
|
||||
@@ -160,31 +148,41 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
@Override
|
||||
public boolean canAccept( T input )
|
||||
{
|
||||
if ( !this.hasWriteAccess )
|
||||
if( !this.hasWriteAccess )
|
||||
return false;
|
||||
|
||||
if ( this.myWhitelist == IncludeExclude.BLACKLIST && this.myPartitionList.isListed( input ) )
|
||||
if( this.myWhitelist == IncludeExclude.BLACKLIST && this.myPartitionList.isListed( input ) )
|
||||
return false;
|
||||
if ( this.myPartitionList.isEmpty() || this.myWhitelist == IncludeExclude.BLACKLIST )
|
||||
if( this.myPartitionList.isEmpty() || this.myWhitelist == IncludeExclude.BLACKLIST )
|
||||
return this.internal.canAccept( input );
|
||||
return this.myPartitionList.isListed( input ) && this.internal.canAccept( input );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority()
|
||||
{
|
||||
return this.myPriority;
|
||||
}
|
||||
|
||||
public void setPriority( int myPriority )
|
||||
{
|
||||
this.myPriority = myPriority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlot()
|
||||
{
|
||||
return this.internal.getSlot();
|
||||
}
|
||||
|
||||
public IMEInventory<T> getInternal()
|
||||
{
|
||||
return this.internal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validForPass( int i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public IMEInventory<T> getInternal()
|
||||
{
|
||||
return this.internal;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user