Puts everywhere brackets
This commit is contained in:
@@ -74,7 +74,9 @@ public class AppEngSlot extends Slot
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
{
|
||||
if( this.isEnabled() )
|
||||
{
|
||||
return super.isItemValid( par1ItemStack );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,10 +84,14 @@ public class AppEngSlot extends Slot
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if( !this.isEnabled() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if( this.inventory.getSizeInventory() <= this.getSlotIndex() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if( this.isDisplay )
|
||||
{
|
||||
@@ -103,7 +109,9 @@ public class AppEngSlot extends Slot
|
||||
super.putStack( par1ItemStack );
|
||||
|
||||
if( this.myContainer != null )
|
||||
{
|
||||
this.myContainer.onSlotChange( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,9 +119,13 @@ public class AppEngSlot extends Slot
|
||||
public void onSlotChanged()
|
||||
{
|
||||
if( this.inventory instanceof AppEngInternalInventory )
|
||||
{
|
||||
( (AppEngInternalInventory) this.inventory ).markDirty( this.getSlotIndex() );
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onSlotChanged();
|
||||
}
|
||||
|
||||
this.isValid = hasCalculatedValidness.NotAvailable;
|
||||
}
|
||||
@@ -122,7 +134,9 @@ public class AppEngSlot extends Slot
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
if( this.isEnabled() )
|
||||
{
|
||||
return super.canTakeStack( par1EntityPlayer );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ public class OptionalSlotFake extends SlotFake
|
||||
if( !this.isEnabled() )
|
||||
{
|
||||
if( this.getDisplayStack() != null )
|
||||
{
|
||||
this.clearStack();
|
||||
}
|
||||
}
|
||||
|
||||
return super.getStack();
|
||||
@@ -59,7 +61,9 @@ public class OptionalSlotFake extends SlotFake
|
||||
public boolean isEnabled()
|
||||
{
|
||||
if( this.host == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.host.isSlotEnabled( this.groupNum );
|
||||
}
|
||||
|
||||
@@ -38,9 +38,13 @@ public class OptionalSlotFakeTypeOnly extends OptionalSlotFake
|
||||
{
|
||||
is = is.copy();
|
||||
if( is.stackSize > 1 )
|
||||
{
|
||||
is.stackSize = 1;
|
||||
}
|
||||
else if( is.stackSize < -1 )
|
||||
{
|
||||
is.stackSize = -1;
|
||||
}
|
||||
}
|
||||
|
||||
super.putStack( is );
|
||||
|
||||
@@ -39,7 +39,9 @@ public class OptionalSlotNormal extends AppEngSlot
|
||||
public boolean isEnabled()
|
||||
{
|
||||
if( this.host == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.host.isSlotEnabled( this.groupNum );
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput
|
||||
public boolean isEnabled()
|
||||
{
|
||||
if( this.host == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.host.isSlotEnabled( this.groupNum );
|
||||
}
|
||||
|
||||
@@ -87,9 +87,13 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
public void doClick( InventoryAction action, EntityPlayer who )
|
||||
{
|
||||
if( this.getStack() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IMEMonitor<IAEItemStack> inv = this.storage.getItemInventory();
|
||||
int howManyPerCraft = this.getStack().stackSize;
|
||||
@@ -116,11 +120,15 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
maxTimesToCraft = this.CapCraftingAttempts( maxTimesToCraft );
|
||||
|
||||
if( ia == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack rs = Platform.cloneItemStack( this.getStack() );
|
||||
if( rs == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for( int x = 0; x < maxTimesToCraft; x++ )
|
||||
{
|
||||
@@ -158,7 +166,9 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
{
|
||||
InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
for( int x = 0; x < 9; x++ )
|
||||
{
|
||||
ic.setInventorySlotContents( x, this.pattern.getStackInSlot( x ) );
|
||||
}
|
||||
|
||||
IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
|
||||
|
||||
@@ -172,9 +182,13 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
{
|
||||
ItemStack pis = ic.getStackInSlot( x );
|
||||
if( pis == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if( pis.getItem() != target )
|
||||
{
|
||||
isBad = true;
|
||||
}
|
||||
}
|
||||
if( !isBad )
|
||||
{
|
||||
@@ -247,12 +261,16 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
// eek! put it back!
|
||||
IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
|
||||
if( fail != null )
|
||||
{
|
||||
drops.add( fail.getItemStack() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( drops.size() > 0 )
|
||||
{
|
||||
Platform.spawnDrops( p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ, drops );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ public class SlotFake extends AppEngSlot
|
||||
public void putStack( ItemStack is )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
is = is.copy();
|
||||
}
|
||||
|
||||
super.putStack( is );
|
||||
}
|
||||
|
||||
@@ -38,9 +38,13 @@ public class SlotFakeTypeOnly extends SlotFake
|
||||
{
|
||||
is = is.copy();
|
||||
if( is.stackSize > 1 )
|
||||
{
|
||||
is.stackSize = 1;
|
||||
}
|
||||
else if( is.stackSize < -1 )
|
||||
{
|
||||
is.stackSize = -1;
|
||||
}
|
||||
}
|
||||
|
||||
super.putStack( is );
|
||||
|
||||
@@ -60,7 +60,9 @@ public class SlotInaccessible extends AppEngSlot
|
||||
{
|
||||
ItemStack dsp = super.getDisplayStack();
|
||||
if( dsp != null )
|
||||
{
|
||||
this.dspStack = dsp.copy();
|
||||
}
|
||||
}
|
||||
return this.dspStack;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ public class SlotPatternTerm extends SlotCraftingTerm
|
||||
if( !this.isEnabled() )
|
||||
{
|
||||
if( this.getDisplayStack() != null )
|
||||
{
|
||||
this.clearStack();
|
||||
}
|
||||
}
|
||||
|
||||
return super.getStack();
|
||||
@@ -69,7 +71,9 @@ public class SlotPatternTerm extends SlotCraftingTerm
|
||||
public boolean isEnabled()
|
||||
{
|
||||
if( this.host == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.host.isSlotEnabled( this.groupNum );
|
||||
}
|
||||
|
||||
@@ -71,7 +71,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
public int getSlotStackLimit()
|
||||
{
|
||||
if( this.stackLimit != -1 )
|
||||
{
|
||||
return this.stackLimit;
|
||||
}
|
||||
return super.getSlotStackLimit();
|
||||
}
|
||||
|
||||
@@ -95,18 +97,28 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
public boolean isItemValid( ItemStack i )
|
||||
{
|
||||
if( !this.myContainer.isValidForSlot( this, i ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( i == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( i.getItem() == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !this.inventory.isItemValidForSlot( this.getSlotIndex(), i ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !this.allowEdit )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IMaterials materials = definitions.materials();
|
||||
@@ -120,7 +132,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
|
||||
ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj );
|
||||
if( de != null )
|
||||
{
|
||||
return de.isCraftable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case VALID_ENCODED_PATTERN_W_OUTPUT:
|
||||
@@ -128,7 +142,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
case ENCODED_PATTERN:
|
||||
{
|
||||
if( i.getItem() instanceof ICraftingPatternItem )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem)
|
||||
// i.getItem()).getPatternForItem( i ) : null;
|
||||
return false;// pattern != null;
|
||||
@@ -139,7 +155,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
case PATTERN:
|
||||
|
||||
if( i.getItem() instanceof ICraftingPatternItem )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return materials.blankPattern().isSameAs( i );
|
||||
|
||||
@@ -150,8 +168,12 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
}
|
||||
|
||||
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( optional, i ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -190,7 +212,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
return i.getItem() instanceof IStorageComponent && ( (IStorageComponent) i.getItem() ).isStorageComponent( i );
|
||||
case TRASH:
|
||||
if( AEApi.instance().registries().cell().isCellHandled( i ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !( i.getItem() instanceof IStorageComponent && ( (IStorageComponent) i.getItem() ).isStorageComponent( i ) );
|
||||
case ENCODABLE_ITEM:
|
||||
@@ -223,7 +247,9 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
ItemStack out = iep.getOutput( is );
|
||||
if( out != null )
|
||||
{
|
||||
return out;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.getStack();
|
||||
@@ -232,14 +258,18 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
public static boolean isMetalIngot( ItemStack i )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for( String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } )
|
||||
{
|
||||
for( ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( i, ingot ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user