final variables and parameters
This commit is contained in:
@@ -52,7 +52,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
*/
|
||||
private int amountCrafted;
|
||||
|
||||
public AppEngCraftingSlot( EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6 )
|
||||
public AppEngCraftingSlot( final EntityPlayer par1EntityPlayer, final IInventory par2IInventory, final IInventory par3IInventory, final int par4, final int par5, final int par6 )
|
||||
{
|
||||
super( par3IInventory, par4, par5, par6 );
|
||||
this.thePlayer = par1EntityPlayer;
|
||||
@@ -63,7 +63,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
|
||||
*/
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
public boolean isItemValid( final ItemStack par1ItemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
* internal count then calls onCrafting(item).
|
||||
*/
|
||||
@Override
|
||||
protected void onCrafting( ItemStack par1ItemStack, int par2 )
|
||||
protected void onCrafting( final ItemStack par1ItemStack, final int par2 )
|
||||
{
|
||||
this.amountCrafted += par2;
|
||||
this.onCrafting( par1ItemStack );
|
||||
@@ -83,7 +83,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
* the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
|
||||
*/
|
||||
@Override
|
||||
protected void onCrafting( ItemStack par1ItemStack )
|
||||
protected void onCrafting( final ItemStack par1ItemStack )
|
||||
{
|
||||
par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted );
|
||||
this.amountCrafted = 0;
|
||||
@@ -140,17 +140,17 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot( EntityPlayer playerIn, ItemStack stack )
|
||||
public void onPickupFromSlot( final EntityPlayer playerIn, final ItemStack stack )
|
||||
{
|
||||
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
|
||||
this.onCrafting(stack);
|
||||
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
|
||||
InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
|
||||
final InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
|
||||
|
||||
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
|
||||
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
|
||||
|
||||
ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
|
||||
final ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
|
||||
|
||||
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
|
||||
craftMatrix.setInventorySlotContents( x, ic.getStackInSlot( x ) );
|
||||
@@ -159,8 +159,8 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
|
||||
for (int i = 0; i < aitemstack.length; ++i)
|
||||
{
|
||||
ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
|
||||
ItemStack itemstack2 = aitemstack[i];
|
||||
final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
|
||||
final ItemStack itemstack2 = aitemstack[i];
|
||||
|
||||
if (itemstack1 != null)
|
||||
{
|
||||
@@ -186,7 +186,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
* stack.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack decrStackSize( int par1 )
|
||||
public ItemStack decrStackSize( final int par1 )
|
||||
{
|
||||
if( this.getHasStack() )
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ public class AppEngSlot extends Slot
|
||||
public hasCalculatedValidness isValid;
|
||||
public boolean isDisplay = false;
|
||||
|
||||
public AppEngSlot( IInventory inv, int idx, int x, int y )
|
||||
public AppEngSlot( final IInventory inv, final int idx, final int x, final int y )
|
||||
{
|
||||
super( inv, idx, x, y );
|
||||
this.defX = x;
|
||||
@@ -70,7 +70,7 @@ public class AppEngSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
public boolean isItemValid( final ItemStack par1ItemStack )
|
||||
{
|
||||
if( this.isEnabled() )
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public class AppEngSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack( ItemStack par1ItemStack )
|
||||
public void putStack( final ItemStack par1ItemStack )
|
||||
{
|
||||
if( this.isEnabled() )
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public class AppEngSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
if( this.isEnabled() )
|
||||
{
|
||||
|
||||
@@ -34,19 +34,19 @@ public class NullSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange( ItemStack par1ItemStack, ItemStack par2ItemStack )
|
||||
public void onSlotChange( final ItemStack par1ItemStack, final ItemStack par2ItemStack )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
|
||||
public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
public boolean isItemValid( final ItemStack par1ItemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class NullSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack( ItemStack par1ItemStack )
|
||||
public void putStack( final ItemStack par1ItemStack )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -76,19 +76,19 @@ public class NullSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int par1 )
|
||||
public ItemStack decrStackSize( final int par1 )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHere( IInventory inv, int slotIn )
|
||||
public boolean isHere( final IInventory inv, final int slotIn )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class OptionalSlotFake extends SlotFake
|
||||
final IOptionalSlotHost host;
|
||||
public boolean renderDisabled = true;
|
||||
|
||||
public OptionalSlotFake( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
|
||||
public OptionalSlotFake( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
|
||||
{
|
||||
super( inv, idx, x + offX * 18, y + offY * 18 );
|
||||
this.srcX = x;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack;
|
||||
public class OptionalSlotFakeTypeOnly extends OptionalSlotFake
|
||||
{
|
||||
|
||||
public OptionalSlotFakeTypeOnly( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
|
||||
public OptionalSlotFakeTypeOnly( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
|
||||
{
|
||||
super( inv, containerBus, idx, x, y, offX, offY, groupNum );
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class OptionalSlotNormal extends AppEngSlot
|
||||
final int groupNum;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public OptionalSlotNormal( IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum )
|
||||
public OptionalSlotNormal( final IInventory inv, final IOptionalSlotHost containerBus, final int slot, final int xPos, final int yPos, final int groupNum )
|
||||
{
|
||||
super( inv, slot, xPos, yPos );
|
||||
this.groupNum = groupNum;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput
|
||||
final int groupNum;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public OptionalSlotRestrictedInput( PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum, InventoryPlayer invPlayer )
|
||||
public OptionalSlotRestrictedInput( final PlacableItemType valid, final IInventory i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer )
|
||||
{
|
||||
super( valid, i, slotIndex, x, y, invPlayer );
|
||||
this.groupNum = grpNum;
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class QuartzKnifeOutput extends SlotOutput
|
||||
{
|
||||
|
||||
public QuartzKnifeOutput( IInventory a, int b, int c, int d, int i )
|
||||
public QuartzKnifeOutput( final IInventory a, final int b, final int c, final int d, final int i )
|
||||
{
|
||||
super( a, b, c, d, i );
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SlotCraftingMatrix extends AppEngSlot
|
||||
|
||||
final Container c;
|
||||
|
||||
public SlotCraftingMatrix( Container c, IInventory par1iInventory, int par2, int par3, int par4 )
|
||||
public SlotCraftingMatrix( final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4 )
|
||||
{
|
||||
super( par1iInventory, par2, par3, par4 );
|
||||
this.c = c;
|
||||
@@ -43,7 +43,7 @@ public class SlotCraftingMatrix extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack( ItemStack par1ItemStack )
|
||||
public void putStack( final ItemStack par1ItemStack )
|
||||
{
|
||||
super.putStack( par1ItemStack );
|
||||
this.c.onCraftMatrixChanged( this.inventory );
|
||||
@@ -56,9 +56,9 @@ public class SlotCraftingMatrix extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int par1 )
|
||||
public ItemStack decrStackSize( final int par1 )
|
||||
{
|
||||
ItemStack is = super.decrStackSize( par1 );
|
||||
final ItemStack is = super.decrStackSize( par1 );
|
||||
this.c.onCraftMatrixChanged( this.inventory );
|
||||
return is;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
private final IStorageMonitorable storage;
|
||||
private final IContainerCraftingPacket container;
|
||||
|
||||
public SlotCraftingTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IContainerCraftingPacket ccp )
|
||||
public SlotCraftingTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp )
|
||||
{
|
||||
super( player, cMatrix, output, 0, x, y );
|
||||
this.energySrc = energySrc;
|
||||
@@ -74,17 +74,17 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot( EntityPlayer p, ItemStack is )
|
||||
public void onPickupFromSlot( final EntityPlayer p, final ItemStack is )
|
||||
{
|
||||
}
|
||||
|
||||
public void doClick( InventoryAction action, EntityPlayer who )
|
||||
public void doClick( final InventoryAction action, final EntityPlayer who )
|
||||
{
|
||||
if( this.getStack() == null )
|
||||
{
|
||||
@@ -95,8 +95,8 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
return;
|
||||
}
|
||||
|
||||
IMEMonitor<IAEItemStack> inv = this.storage.getItemInventory();
|
||||
int howManyPerCraft = this.getStack().stackSize;
|
||||
final IMEMonitor<IAEItemStack> inv = this.storage.getItemInventory();
|
||||
final int howManyPerCraft = this.getStack().stackSize;
|
||||
int maxTimesToCraft = 0;
|
||||
|
||||
InventoryAdaptor ia = null;
|
||||
@@ -124,7 +124,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack rs = Platform.cloneItemStack( this.getStack() );
|
||||
final ItemStack rs = Platform.cloneItemStack( this.getStack() );
|
||||
if( rs == null )
|
||||
{
|
||||
return;
|
||||
@@ -134,11 +134,11 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
{
|
||||
if( ia.simulateAdd( rs ) == null )
|
||||
{
|
||||
IItemList<IAEItemStack> all = inv.getStorageList();
|
||||
ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) );
|
||||
final IItemList<IAEItemStack> all = inv.getStorageList();
|
||||
final ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) );
|
||||
if( extra != null )
|
||||
{
|
||||
List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
drops.add( extra );
|
||||
Platform.spawnDrops( who.worldObj, new BlockPos( (int) who.posX, (int) who.posY, (int) who.posZ ), drops );
|
||||
return;
|
||||
@@ -147,40 +147,40 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
}
|
||||
}
|
||||
|
||||
protected int capCraftingAttempts( int maxTimesToCraft )
|
||||
protected int capCraftingAttempts( final int maxTimesToCraft )
|
||||
{
|
||||
return maxTimesToCraft;
|
||||
}
|
||||
|
||||
public ItemStack craftItem( EntityPlayer p, ItemStack request, IMEMonitor<IAEItemStack> inv, IItemList all )
|
||||
public ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor<IAEItemStack> inv, final IItemList all )
|
||||
{
|
||||
// update crafting matrix...
|
||||
ItemStack is = this.getStack();
|
||||
|
||||
if( is != null && Platform.isSameItem( request, is ) )
|
||||
{
|
||||
ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()];
|
||||
final ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()];
|
||||
|
||||
// add one of each item to the items on the board...
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
final 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 );
|
||||
final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
|
||||
|
||||
if( r == null )
|
||||
{
|
||||
Item target = request.getItem();
|
||||
final Item target = request.getItem();
|
||||
if( target.isDamageable() && target.isRepairable() )
|
||||
{
|
||||
boolean isBad = false;
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack pis = ic.getStackInSlot( x );
|
||||
final ItemStack pis = ic.getStackInSlot( x );
|
||||
if( pis == null )
|
||||
{
|
||||
continue;
|
||||
@@ -232,19 +232,19 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean preCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack[] set, ItemStack result )
|
||||
public boolean preCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void makeItem( EntityPlayer p, ItemStack is )
|
||||
public void makeItem( final EntityPlayer p, final ItemStack is )
|
||||
{
|
||||
super.onPickupFromSlot( p, is );
|
||||
}
|
||||
|
||||
public void postCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack[] set, ItemStack result )
|
||||
public void postCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
|
||||
{
|
||||
List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
|
||||
// add one of each item to the items on the board...
|
||||
if( Platform.isServer() )
|
||||
@@ -259,7 +259,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
else if( set[x] != null )
|
||||
{
|
||||
// eek! put it back!
|
||||
IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
|
||||
final IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
|
||||
if( fail != null )
|
||||
{
|
||||
drops.add( fail.getItemStack() );
|
||||
|
||||
@@ -27,19 +27,19 @@ import net.minecraft.item.ItemStack;
|
||||
public class SlotDisabled extends AppEngSlot
|
||||
{
|
||||
|
||||
public SlotDisabled( IInventory par1iInventory, int slotIndex, int x, int y )
|
||||
public SlotDisabled( final IInventory par1iInventory, final int slotIndex, final int x, final int y )
|
||||
{
|
||||
super( par1iInventory, slotIndex, x, y );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
public boolean isItemValid( final ItemStack par1ItemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,25 +29,25 @@ public class SlotFake extends AppEngSlot
|
||||
|
||||
final int invSlot;
|
||||
|
||||
public SlotFake( IInventory inv, int idx, int x, int y )
|
||||
public SlotFake( final IInventory inv, final int idx, final int x, final int y )
|
||||
{
|
||||
super( inv, idx, x, y );
|
||||
this.invSlot = idx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
|
||||
public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int par1 )
|
||||
public ItemStack decrStackSize( final int par1 )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack par1ItemStack )
|
||||
public boolean isItemValid( final ItemStack par1ItemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class SlotFake extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotFakeBlacklist extends SlotFakeTypeOnly
|
||||
{
|
||||
|
||||
public SlotFakeBlacklist( IInventory inv, int idx, int x, int y )
|
||||
public SlotFakeBlacklist( final IInventory inv, final int idx, final int x, final int y )
|
||||
{
|
||||
super( inv, idx, x, y );
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotFakeCraftingMatrix extends SlotFake
|
||||
{
|
||||
|
||||
public SlotFakeCraftingMatrix( IInventory inv, int idx, int x, int y )
|
||||
public SlotFakeCraftingMatrix( final IInventory inv, final int idx, final int x, final int y )
|
||||
{
|
||||
super( inv, idx, x, y );
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack;
|
||||
public class SlotFakeTypeOnly extends SlotFake
|
||||
{
|
||||
|
||||
public SlotFakeTypeOnly( IInventory inv, int idx, int x, int y )
|
||||
public SlotFakeTypeOnly( final IInventory inv, final int idx, final int x, final int y )
|
||||
{
|
||||
super( inv, idx, x, y );
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ public class SlotInaccessible extends AppEngSlot
|
||||
|
||||
ItemStack dspStack = null;
|
||||
|
||||
public SlotInaccessible( IInventory i, int slotIdx, int x, int y )
|
||||
public SlotInaccessible( final IInventory i, final int slotIdx, final int x, final int y )
|
||||
{
|
||||
super( i, slotIdx, x, y );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack i )
|
||||
public boolean isItemValid( final ItemStack i )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class SlotInaccessible extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class SlotInaccessible extends AppEngSlot
|
||||
{
|
||||
if( this.dspStack == null )
|
||||
{
|
||||
ItemStack dsp = super.getDisplayStack();
|
||||
final ItemStack dsp = super.getDisplayStack();
|
||||
if( dsp != null )
|
||||
{
|
||||
this.dspStack = dsp.copy();
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotInaccessibleHD extends SlotInaccessible
|
||||
{
|
||||
|
||||
public SlotInaccessibleHD( IInventory i, int slotIdx, int x, int y )
|
||||
public SlotInaccessibleHD( final IInventory i, final int slotIdx, final int x, final int y )
|
||||
{
|
||||
super( i, slotIdx, x, y );
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ public class SlotMACPattern extends AppEngSlot
|
||||
|
||||
final ContainerMAC mac;
|
||||
|
||||
public SlotMACPattern( ContainerMAC mac, IInventory i, int slotIdx, int x, int y )
|
||||
public SlotMACPattern( final ContainerMAC mac, final IInventory i, final int slotIdx, final int x, final int y )
|
||||
{
|
||||
super( i, slotIdx, x, y );
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack i )
|
||||
public boolean isItemValid( final ItemStack i )
|
||||
{
|
||||
return this.mac.isValidItemForSlot( this.getSlotIndex(), i );
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotNormal extends AppEngSlot
|
||||
{
|
||||
|
||||
public SlotNormal( IInventory inv, int slot, int xPos, int yPos )
|
||||
public SlotNormal( final IInventory inv, final int slot, final int xPos, final int yPos )
|
||||
{
|
||||
super( inv, slot, xPos, yPos );
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ import net.minecraft.item.ItemStack;
|
||||
public class SlotOutput extends AppEngSlot
|
||||
{
|
||||
|
||||
public SlotOutput( IInventory a, int b, int c, int d, int i )
|
||||
public SlotOutput( final IInventory a, final int b, final int c, final int d, final int i )
|
||||
{
|
||||
super( a, b, c, d );
|
||||
this.IIcon = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack i )
|
||||
public boolean isItemValid( final ItemStack i )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotPatternOutputs extends OptionalSlotFake
|
||||
{
|
||||
|
||||
public SlotPatternOutputs( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
|
||||
public SlotPatternOutputs( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
|
||||
{
|
||||
super( inv, containerBus, idx, x, y, offX, offY, groupNum );
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SlotPatternTerm extends SlotCraftingTerm
|
||||
final int groupNum;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public SlotPatternTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int groupNumber, IContainerCraftingPacket c )
|
||||
public SlotPatternTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c )
|
||||
{
|
||||
super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c );
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SlotPatternTerm extends SlotCraftingTerm
|
||||
this.groupNum = groupNumber;
|
||||
}
|
||||
|
||||
public AppEngPacket getRequest( boolean shift ) throws IOException
|
||||
public AppEngPacket getRequest( final boolean shift ) throws IOException
|
||||
{
|
||||
return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( this.getStack() ), shift );
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotPlayerHotBar extends AppEngSlot
|
||||
{
|
||||
|
||||
public SlotPlayerHotBar( IInventory par1iInventory, int par2, int par3, int par4 )
|
||||
public SlotPlayerHotBar( final IInventory par1iInventory, final int par2, final int par3, final int par4 )
|
||||
{
|
||||
super( par1iInventory, par2, par3, par4 );
|
||||
this.isPlayerSide = true;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.inventory.IInventory;
|
||||
public class SlotPlayerInv extends AppEngSlot
|
||||
{
|
||||
|
||||
public SlotPlayerInv( IInventory par1iInventory, int par2, int par3, int par4 )
|
||||
public SlotPlayerInv( final IInventory par1iInventory, final int par2, final int par3, final int par4 )
|
||||
{
|
||||
super( par1iInventory, par2, par3, par4 );
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
public boolean allowEdit = true;
|
||||
public int stackLimit = -1;
|
||||
|
||||
public SlotRestrictedInput( PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p )
|
||||
public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
|
||||
{
|
||||
super( i, slotIndex, x, y );
|
||||
this.which = valid;
|
||||
@@ -76,24 +76,24 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
return super.getSlotStackLimit();
|
||||
}
|
||||
|
||||
public boolean isValid( ItemStack is, World theWorld )
|
||||
public boolean isValid( final ItemStack is, final World theWorld )
|
||||
{
|
||||
if( this.which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT )
|
||||
{
|
||||
ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null;
|
||||
final ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null;
|
||||
return ap != null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Slot setStackLimit( int i )
|
||||
public Slot setStackLimit( final int i )
|
||||
{
|
||||
this.stackLimit = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack i )
|
||||
public boolean isItemValid( final ItemStack i )
|
||||
{
|
||||
if( !this.myContainer.isValidForSlot( this, i ) )
|
||||
{
|
||||
@@ -128,8 +128,8 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
case ENCODED_CRAFTING_PATTERN:
|
||||
if( i.getItem() instanceof ICraftingPatternItem )
|
||||
{
|
||||
ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
|
||||
ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj );
|
||||
final ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
|
||||
final ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj );
|
||||
if( de != null )
|
||||
{
|
||||
return de.isCraftable();
|
||||
@@ -166,7 +166,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
return true;
|
||||
}
|
||||
|
||||
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( optional, i ) )
|
||||
{
|
||||
@@ -230,7 +230,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
|
||||
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
return this.allowEdit;
|
||||
}
|
||||
@@ -240,11 +240,11 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
{
|
||||
if( Platform.isClient() && ( this.which == PlacableItemType.ENCODED_PATTERN ) )
|
||||
{
|
||||
ItemStack is = super.getStack();
|
||||
final ItemStack is = super.getStack();
|
||||
if( is != null && is.getItem() instanceof ItemEncodedPattern )
|
||||
{
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
ItemStack out = iep.getOutput( is );
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
final ItemStack out = iep.getOutput( is );
|
||||
if( out != null )
|
||||
{
|
||||
return out;
|
||||
@@ -254,16 +254,16 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
return super.getStack();
|
||||
}
|
||||
|
||||
public static boolean isMetalIngot( ItemStack i )
|
||||
public static boolean isMetalIngot( final 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( final String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } )
|
||||
{
|
||||
for( ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
|
||||
for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( i, ingot ) )
|
||||
{
|
||||
@@ -291,7 +291,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
|
||||
public final int IIcon;
|
||||
|
||||
PlacableItemType( int o )
|
||||
PlacableItemType( final int o )
|
||||
{
|
||||
this.IIcon = o;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user