Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.me.storage;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -31,21 +32,17 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
|
||||
public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
{
|
||||
|
||||
final IItemList<IAEItemStack> itemListCache = AEApi.instance().storage().createItemList();
|
||||
|
||||
public static IMEInventoryHandler getCell(ItemStack o)
|
||||
{
|
||||
return new CellInventoryHandler( new CreativeCellInventory( o ) );
|
||||
}
|
||||
|
||||
protected CreativeCellInventory(ItemStack o)
|
||||
protected CreativeCellInventory( ItemStack o )
|
||||
{
|
||||
CellConfig cc = new CellConfig( o );
|
||||
for (ItemStack is : cc)
|
||||
if ( is != null )
|
||||
for( ItemStack is : cc )
|
||||
if( is != null )
|
||||
{
|
||||
IAEItemStack i = AEItemStack.create( is );
|
||||
i.setStackSize( Integer.MAX_VALUE );
|
||||
@@ -53,30 +50,35 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
}
|
||||
}
|
||||
|
||||
public static IMEInventoryHandler getCell( ItemStack o )
|
||||
{
|
||||
return new CellInventoryHandler( new CreativeCellInventory( o ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
|
||||
{
|
||||
IAEItemStack local = this.itemListCache.findPrecise( input );
|
||||
if ( local == null )
|
||||
if( local == null )
|
||||
return input;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
|
||||
{
|
||||
IAEItemStack local = this.itemListCache.findPrecise( request );
|
||||
if ( local == null )
|
||||
if( local == null )
|
||||
return null;
|
||||
|
||||
return request.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
||||
public IItemList<IAEItemStack> getAvailableItems( IItemList out )
|
||||
{
|
||||
for (IAEItemStack ais : this.itemListCache)
|
||||
for( IAEItemStack ais : this.itemListCache )
|
||||
out.add( ais );
|
||||
return out;
|
||||
}
|
||||
@@ -94,13 +96,13 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrioritized(IAEItemStack input)
|
||||
public boolean isPrioritized( IAEItemStack input )
|
||||
{
|
||||
return this.itemListCache.findPrecise( input ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAccept(IAEItemStack input)
|
||||
public boolean canAccept( IAEItemStack input )
|
||||
{
|
||||
return this.itemListCache.findPrecise( input ) != null;
|
||||
}
|
||||
@@ -118,9 +120,8 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validForPass(int i)
|
||||
public boolean validForPass( int i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user