final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 deletions
@@ -22,7 +22,7 @@ package appeng.integration;
public class IntegrationHelper
{
public static void testClassExistence( Object o, Class<?> clz )
public static void testClassExistence( final Object o, final Class<?> clz )
{
clz.isInstance( o );
}
@@ -43,7 +43,7 @@ public final class IntegrationNode
Object instance;
IIntegrationModule mod = null;
public IntegrationNode( String displayName, String modID, IntegrationType shortName, String name )
public IntegrationNode( final String displayName, final String modID, final IntegrationType shortName, final String name )
{
this.displayName = displayName;
this.shortName = shortName;
@@ -67,7 +67,7 @@ public final class IntegrationNode
return this.state != IntegrationStage.FAILED;
}
void call( IntegrationStage stage )
void call( final IntegrationStage stage )
{
if( this.state != IntegrationStage.FAILED )
{
@@ -85,7 +85,7 @@ public final class IntegrationNode
boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ) || apiManager.hasAPI( this.modID );
AEConfig.instance.addCustomCategoryComment( "ModIntegration", "Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." );
String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString();
final String mode = AEConfig.instance.get( "ModIntegration", this.displayName.replace( " ", "" ), "AUTO" ).getString();
if( mode.toUpperCase().equals( "ON" ) )
{
@@ -100,7 +100,7 @@ public final class IntegrationNode
{
this.classValue = this.getClass().getClassLoader().loadClass( this.name );
this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance();
Field f = this.classValue.getField( "instance" );
final Field f = this.classValue.getField( "instance" );
f.set( this.classValue, this.instance = this.mod );
}
else
@@ -126,7 +126,7 @@ public final class IntegrationNode
break;
}
}
catch( Throwable t )
catch( final Throwable t )
{
this.failedStage = stage;
this.exception = t;
@@ -36,7 +36,7 @@ public enum IntegrationRegistry
private final Collection<IntegrationNode> modules = new LinkedList<IntegrationNode>();
public void add( IntegrationType type )
public void add( final IntegrationType type )
{
if( type.side == IntegrationSide.CLIENT && FMLLaunchHandler.side() == Side.SERVER )
{
@@ -53,12 +53,12 @@ public enum IntegrationRegistry
public void init()
{
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
node.call( IntegrationStage.PRE_INIT );
}
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
node.call( IntegrationStage.INIT );
}
@@ -66,7 +66,7 @@ public enum IntegrationRegistry
public void postInit()
{
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
node.call( IntegrationStage.POST_INIT );
}
@@ -76,7 +76,7 @@ public enum IntegrationRegistry
{
final StringBuilder builder = new StringBuilder( this.modules.size() * 3 );
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
if( builder.length() != 0 )
{
@@ -90,9 +90,9 @@ public enum IntegrationRegistry
return builder.toString();
}
public boolean isEnabled( IntegrationType name )
public boolean isEnabled( final IntegrationType name )
{
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
if( node.shortName == name )
{
@@ -103,9 +103,9 @@ public enum IntegrationRegistry
}
@Nonnull
public Object getInstance( IntegrationType name )
public Object getInstance( final IntegrationType name )
{
for( IntegrationNode node : this.modules )
for( final IntegrationNode node : this.modules )
{
if( node.shortName == name && node.isActive() )
{
@@ -71,7 +71,7 @@ public enum IntegrationType
public final String dspName;
public final String modID;
IntegrationType( IntegrationSide side, String name, String modid )
IntegrationType( final IntegrationSide side, final String name, final String modid )
{
this.side = side;
this.dspName = name;
@@ -44,9 +44,9 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
{
@Override
public void rotateLeft( IBuilderContext context )
public void rotateLeft( final IBuilderContext context )
{
CableBusContainer cbc = new CableBusContainer( this );
final CableBusContainer cbc = new CableBusContainer( this );
cbc.readFromNBT( this.tileNBT );
cbc.rotateLeft();
@@ -62,25 +62,25 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
}
@Override
public boolean canAddPart( ItemStack part, ForgeDirection side )
public boolean canAddPart( final ItemStack part, final ForgeDirection side )
{
return false;
}
@Override
public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner )
public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner )
{
return null;
}
@Override
public IPart getPart( ForgeDirection side )
public IPart getPart( final ForgeDirection side )
{
return null;
}
@Override
public void removePart( ForgeDirection side, boolean suppressUpdate )
public void removePart( final ForgeDirection side, final boolean suppressUpdate )
{
}
@@ -116,13 +116,13 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
}
@Override
public boolean isBlocked( ForgeDirection side )
public boolean isBlocked( final ForgeDirection side )
{
return false;
}
@Override
public SelectedPart selectPart( Vec3 pos )
public SelectedPart selectPart( final Vec3 pos )
{
return null;
}
@@ -140,7 +140,7 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
}
@Override
public boolean hasRedstone( ForgeDirection side )
public boolean hasRedstone( final ForgeDirection side )
{
return false;
}
@@ -37,13 +37,13 @@ public class AEGenericSchematicTile extends SchematicTile
{
@Override
public void storeRequirements( IBuilderContext context, int x, int y, int z )
public void storeRequirements( final IBuilderContext context, final int x, final int y, final int z )
{
TileEntity tile = context.world().getTileEntity( x, y, z );
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
final TileEntity tile = context.world().getTileEntity( x, y, z );
final ArrayList<ItemStack> list = new ArrayList<ItemStack>();
if( tile instanceof AEBaseTile )
{
ICommonTile tcb = (ICommonTile) tile;
final ICommonTile tcb = (ICommonTile) tile;
tcb.getDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, list );
}
@@ -51,12 +51,12 @@ public class AEGenericSchematicTile extends SchematicTile
}
@Override
public void rotateLeft( IBuilderContext context )
public void rotateLeft( final IBuilderContext context )
{
if( this.tileNBT.hasKey( "orientation_forward" ) && this.tileNBT.hasKey( "orientation_up" ) )
{
String forward = this.tileNBT.getString( "orientation_forward" );
String up = this.tileNBT.getString( "orientation_up" );
final String forward = this.tileNBT.getString( "orientation_forward" );
final String up = this.tileNBT.getString( "orientation_up" );
if( forward != null && up != null )
{
@@ -71,7 +71,7 @@ public class AEGenericSchematicTile extends SchematicTile
this.tileNBT.setString( "orientation_forward", fdForward.name() );
this.tileNBT.setString( "orientation_up", fdUp.name() );
}
catch( Throwable ignored )
catch( final Throwable ignored )
{
}
@@ -31,11 +31,11 @@ public class AERotatableBlockSchematic extends SchematicBlock
{
@Override
public void rotateLeft( IBuilderContext context )
public void rotateLeft( final IBuilderContext context )
{
if( this.meta < 6 )
{
ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN );
final ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN );
this.meta = d.ordinal();
}
}
@@ -35,7 +35,7 @@ public class BCPipeHandler implements IExternalStorageHandler
{
@Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc )
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
{
@@ -48,7 +48,7 @@ public class BCPipeHandler implements IExternalStorageHandler
}
@Override
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src )
public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src )
{
if( chan == StorageChannel.ITEMS )
{
@@ -39,14 +39,14 @@ public class BCPipeInventory implements IMEInventory<IAEItemStack>
final TileEntity te;
final ForgeDirection direction;
public BCPipeInventory( TileEntity te, ForgeDirection direction )
public BCPipeInventory( final TileEntity te, final ForgeDirection direction )
{
this.te = te;
this.direction = direction;
}
@Override
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src )
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
{
@@ -71,13 +71,13 @@ public class BCPipeInventory implements IMEInventory<IAEItemStack>
}
@Override
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src )
{
return null;
}
@Override
public IItemList<IAEItemStack> getAvailableItems( IItemList<IAEItemStack> out )
public IItemList<IAEItemStack> getAvailableItems( final IItemList<IAEItemStack> out )
{
return out;
}
@@ -44,13 +44,13 @@ public class BetterStorage implements IIntegrationModule, IBetterStorage
}
@Override
public boolean isStorageCrate( Object te )
public boolean isStorageCrate( final Object te )
{
return te instanceof ICrateStorage;
}
@Override
public InventoryAdaptor getAdaptor( Object te, ForgeDirection d )
public InventoryAdaptor getAdaptor( final Object te, final ForgeDirection d )
{
if( te instanceof ICrateStorage )
{
@@ -74,7 +74,7 @@ public class BuildCraftBuilder implements IIntegrationModule
{
this.initBuilderSupport();
}
catch( Exception builderSupport )
catch( final Exception builderSupport )
{
// not supported?
}
@@ -92,7 +92,7 @@ public class BuildCraftBuilder implements IIntegrationModule
final IBlocks blocks = AEApi.instance().definitions().blocks();
final IBlockDefinition maybeMultiPart = blocks.multiPart();
for( Method blockDefinition : blocks.getClass().getMethods() )
for( final Method blockDefinition : blocks.getClass().getMethods() )
{
try
{
@@ -117,11 +117,11 @@ public class BuildCraftBuilder implements IIntegrationModule
schematicRegistry.registerSchematicBlock( block, AEGenericSchematicTile.class );
}
}
catch( InvocationTargetException ignore )
catch( final InvocationTargetException ignore )
{
AELog.warning( "Encountered problems while initializing the BuildCraft Builder support. Can not invoke the method %s", blockDefinition );
}
catch( IllegalAccessException ignore )
catch( final IllegalAccessException ignore )
{
AELog.warning( "Encountered problems while initializing the BuildCraft Builder support. Can not access the method %s", blockDefinition );
}
@@ -51,19 +51,19 @@ public final class BuildCraftCore implements IBuildCraftCore, IIntegrationModule
}
@Override
public boolean isWrench( Item eq )
public boolean isWrench( final Item eq )
{
return eq instanceof IToolWrench;
}
@Override
public boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z )
public boolean canWrench( @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z )
{
return ( (IToolWrench) wrench ).canWrench( wrencher, x, y, z );
}
@Override
public void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z )
public void wrenchUsed( @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z )
{
( (IToolWrench) wrench ).wrenchUsed( wrencher, x, y, z );
}
@@ -77,7 +77,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
@Override
public boolean isFacade( ItemStack is )
public boolean isFacade( final ItemStack is )
{
if( is == null )
{
@@ -89,7 +89,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
@Nullable
@Override
public IFacadePart createFacadePart( Block blk, int meta, @Nonnull ForgeDirection side )
public IFacadePart createFacadePart( final Block blk, final int meta, @Nonnull final ForgeDirection side )
{
try
{
@@ -98,7 +98,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
return new FacadePart( facade, side );
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
@@ -107,14 +107,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
@Override
public IFacadePart createFacadePart( @Nonnull ItemStack fs, @Nonnull ForgeDirection side )
public IFacadePart createFacadePart( @Nonnull final ItemStack fs, @Nonnull final ForgeDirection side )
{
return new FacadePart( fs, side );
}
@Nullable
@Override
public ItemStack getTextureForFacade( @Nonnull ItemStack facade )
public ItemStack getTextureForFacade( @Nonnull final ItemStack facade )
{
final Item maybeFacadeItem = facade.getItem();
@@ -142,7 +142,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
{
return buildcraft.BuildCraftTransport.instance.pipeIconProvider.getIcon( PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal() ); // Structure
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
return null;
@@ -150,7 +150,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
@Override
public boolean isPipe( TileEntity te, @Nonnull ForgeDirection dir )
public boolean isPipe( final TileEntity te, @Nonnull final ForgeDirection dir )
{
if( te instanceof IPipeTile )
{
@@ -162,14 +162,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
@Override
public boolean canAddItemsToPipe( TileEntity te, ItemStack is, ForgeDirection dir )
public boolean canAddItemsToPipe( final TileEntity te, final ItemStack is, final ForgeDirection dir )
{
if( is != null && te != null && te instanceof IInjectable )
{
IInjectable pt = (IInjectable) te;
final IInjectable pt = (IInjectable) te;
if( pt.canInjectItems( dir ) )
{
int amt = pt.injectItem( is, false, dir, null );
final int amt = pt.injectItem( is, false, dir, null );
if( amt == is.stackSize )
{
return true;
@@ -181,14 +181,14 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
@Override
public boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull ForgeDirection dir )
public boolean addItemsToPipe( @Nullable final TileEntity te, @Nullable final ItemStack is, @Nonnull final ForgeDirection dir )
{
if( is != null && te != null && te instanceof IInjectable )
{
IInjectable pt = (IInjectable) te;
final IInjectable pt = (IInjectable) te;
if( pt.canInjectItems( dir ) )
{
int amt = pt.injectItem( is, false, dir, null );
final int amt = pt.injectItem( is, false, dir, null );
if( amt == is.stackSize )
{
pt.injectItem( is, true, dir, null );
@@ -200,7 +200,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
return false;
}
private void addFacade( ItemStack item )
private void addFacade( final ItemStack item )
{
if( item != null )
{
@@ -239,7 +239,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
private void registerLiquidsP2P()
{
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
final IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsCobblestone ), TunnelType.FLUID );
reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsEmerald ), TunnelType.FLUID );
reg.addNewAttunement( new ItemStack( buildcraft.BuildCraftTransport.pipeFluidsGold ), TunnelType.FLUID );
@@ -283,7 +283,7 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
this.addFacadeStack( blocks.quartzChiseled() );
this.addFacadeStack( blocks.quartzPillar() );
for( Block skyStoneBlock : blocks.skyStone().maybeBlock().asSet() )
for( final Block skyStoneBlock : blocks.skyStone().maybeBlock().asSet() )
{
this.addFacade( new ItemStack( skyStoneBlock, 1, 0 ) );
this.addFacade( new ItemStack( skyStoneBlock, 1, 1 ) );
@@ -292,9 +292,9 @@ public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationMo
}
}
private void addFacadeStack( IItemDefinition definition )
private void addFacadeStack( final IItemDefinition definition )
{
for( ItemStack facadeStack : definition.maybeStack( 1 ).asSet() )
for( final ItemStack facadeStack : definition.maybeStack( 1 ).asSet() )
{
this.addFacade( facadeStack );
}
@@ -49,13 +49,13 @@ public class CLApi implements ICLApi, IIntegrationModule
}
@Override
public int colorLight( AEColor color, int light )
public int colorLight( final AEColor color, final int light )
{
int mv = color.mediumVariant;
final int mv = color.mediumVariant;
float r = ( mv >> 16 ) & 0xff;
float g = ( mv >> 8 ) & 0xff;
float b = ( mv ) & 0xff;
final float r = ( mv >> 16 ) & 0xff;
final float g = ( mv >> 8 ) & 0xff;
final float b = ( mv ) & 0xff;
return coloredlightscore.src.api.CLApi.makeRGBLightValue( r / 255.0f, g / 255.0f, b / 255.0f, light / 15.0f );
}
@@ -165,7 +165,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
}
@Override
public void generateRecipes( RecipeGenerator generator )
public void generateRecipes( final RecipeGenerator generator )
{
final RecipeTemplate craftingTemplate;
final RecipeTemplate smallTemplate;
@@ -214,13 +214,13 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return (List<IRecipe>) CraftingManager.getInstance().getRecipeList();
}
private void addCraftingRecipes( RecipeTemplate template, RecipeTemplate templateSmall, RecipeTemplate templateShapeless, RecipeGenerator generator )
private void addCraftingRecipes( final RecipeTemplate template, final RecipeTemplate templateSmall, final RecipeTemplate templateShapeless, final RecipeGenerator generator )
{
final List<IRecipe> recipes = this.getUncheckedRecipes();
int errCount = 0;
for( IRecipe recipe : recipes )
for( final IRecipe recipe : recipes )
{
try
{
@@ -243,7 +243,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
generator.addRecipe( template, items );
}
}
catch( Exception e )
catch( final Exception e )
{
if( errCount >= 5 )
{
@@ -260,12 +260,12 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
}
}
private void addGrinderRecipes( IAppEngApi api, ItemStack grindstone, RecipeGenerator generator )
private void addGrinderRecipes( final IAppEngApi api, final ItemStack grindstone, final RecipeGenerator generator )
{
final ItemStack handle = api.definitions().blocks().crankHandle().maybeStack( 1 ).orNull();
final RecipeTemplate grinderTemplate = generator.createRecipeTemplate( GRINDER_SLOTS, grindstone );
for( IGrinderEntry recipe : api.registries().grinder().getRecipes() )
for( final IGrinderEntry recipe : api.registries().grinder().getRecipes() )
{
generator.addRecipe( grinderTemplate, new Object[] {
recipe.getInput(),
@@ -284,11 +284,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
}
}
private void addInscriberRecipes( IAppEngApi api, ItemStack inscriber, RecipeGenerator generator )
private void addInscriberRecipes( final IAppEngApi api, final ItemStack inscriber, final RecipeGenerator generator )
{
final RecipeTemplate inscriberTemplate = generator.createRecipeTemplate( INSCRIBER_SLOTS, inscriber );
for( IInscriberRecipe recipe : api.registries().inscriber().getRecipes() )
for( final IInscriberRecipe recipe : api.registries().inscriber().getRecipes() )
{
generator.addRecipe( inscriberTemplate, new Object[] {
recipe.getInputs(),
@@ -300,7 +300,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
}
}
private Object[] getCraftingShapelessRecipe( List<?> items, ItemStack recipeOutput )
private Object[] getCraftingShapelessRecipe( final List<?> items, final ItemStack recipeOutput )
{
final Object[] output = new Object[10];
@@ -319,11 +319,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
{
output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() );
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
@@ -335,7 +335,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return output;
}
private Object[] getSmallShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
private Object[] getSmallShapedRecipe( final int width, final int height, final Object[] items, final ItemStack recipeOutput )
{
final Object[] output = new Object[5];
@@ -357,11 +357,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
{
output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() );
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
@@ -374,7 +374,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return output;
}
private Object[] getCraftingShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
private Object[] getCraftingShapedRecipe( final int width, final int height, final Object[] items, final ItemStack recipeOutput )
{
final Object[] output = new Object[10];
@@ -396,11 +396,11 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
{
output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() );
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
@@ -413,7 +413,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
return output;
}
private Object toCG( ItemStack[] itemStackSet )
private Object toCG( final ItemStack[] itemStackSet )
{
final List<ItemStack> list = Arrays.asList( itemStackSet );
@@ -430,7 +430,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
}
@Nullable
private Object[] getCraftingRecipe( IRecipe recipe, boolean allowSmallGrid )
private Object[] getCraftingRecipe( final IRecipe recipe, final boolean allowSmallGrid )
{
if( recipe instanceof ShapelessRecipe )
{
@@ -45,13 +45,13 @@ public class DSU implements IDSU, IIntegrationModule
}
@Override
public IMEInventory getDSU( TileEntity te )
public IMEInventory getDSU( final TileEntity te )
{
return new MinefactoryReloadedDeepStorageUnit( te );
}
@Override
public boolean isDSU( TileEntity te )
public boolean isDSU( final TileEntity te )
{
return te instanceof IDeepStorageUnit;
}
@@ -63,9 +63,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
public static FMP instance;
@Override
public TMultiPart createPart( String name, boolean client )
public TMultiPart createPart( final String name, final boolean client )
{
for( PartRegistry pr : PartRegistry.values() )
for( final PartRegistry pr : PartRegistry.values() )
{
if( pr.getName().equals( name ) )
{
@@ -77,15 +77,15 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
@Override
public TMultiPart convert( World world, BlockCoord pos )
public TMultiPart convert( final World world, final BlockCoord pos )
{
Block blk = world.getBlock( pos.x, pos.y, pos.z );
int meta = world.getBlockMetadata( pos.x, pos.y, pos.z );
final Block blk = world.getBlock( pos.x, pos.y, pos.z );
final int meta = world.getBlockMetadata( pos.x, pos.y, pos.z );
TMultiPart part = PartRegistry.getPartByBlock( blk, meta );
final TMultiPart part = PartRegistry.getPartByBlock( blk, meta );
if( part instanceof CableBusPart )
{
CableBusPart cbp = (CableBusPart) part;
final CableBusPart cbp = (CableBusPart) part;
cbp.convertFromTile( world.getTileEntity( pos.x, pos.y, pos.z ) );
}
@@ -104,9 +104,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
return blockTypes;
}
private void addBlockTypes( Collection<Block> blockTypes, IBlockDefinition definition )
private void addBlockTypes( final Collection<Block> blockTypes, final IBlockDefinition definition )
{
for( Block block : definition.maybeBlock().asSet() )
for( final Block block : definition.maybeBlock().asSet() )
{
blockTypes.add( block );
}
@@ -125,9 +125,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
this.createAndRegister( blocks.skyStone(), 2 );
this.createAndRegister( blocks.skyStone(), 3 );
PartRegistry[] reg = PartRegistry.values();
final PartRegistry[] reg = PartRegistry.values();
String[] data = new String[reg.length];
final String[] data = new String[reg.length];
for( int x = 0; x < data.length; x++ )
{
data[x] = reg[x].getName();
@@ -139,9 +139,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
MultipartGenerator.registerPassThroughInterface( "appeng.helpers.AEMultiTile" );
}
private void createAndRegister( IBlockDefinition definition, int i )
private void createAndRegister( final IBlockDefinition definition, final int i )
{
for( Block block : definition.maybeBlock().asSet() )
for( final Block block : definition.maybeBlock().asSet() )
{
BlockMicroMaterial.createAndRegister( block, i );
}
@@ -154,19 +154,19 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
@Override
public IPartHost getOrCreateHost( TileEntity tile )
public IPartHost getOrCreateHost( final TileEntity tile )
{
try
{
BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord );
final BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord );
TileMultipart mp = TileMultipart.getOrConvertTile( tile.getWorldObj(), loc );
final TileMultipart mp = TileMultipart.getOrConvertTile( tile.getWorldObj(), loc );
if( mp != null )
{
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
final scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
while( i.hasNext() )
{
TMultiPart p = i.next();
final TMultiPart p = i.next();
if( p instanceof CableBusPart )
{
return (IPartHost) p;
@@ -176,7 +176,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
return new FMPPlacementHelper( mp );
}
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.error( t );
}
@@ -184,15 +184,15 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
@Override
public CableBusContainer getCableContainer( TileEntity te )
public CableBusContainer getCableContainer( final TileEntity te )
{
if( te instanceof TileMultipart )
{
TileMultipart mp = (TileMultipart) te;
scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
final TileMultipart mp = (TileMultipart) te;
final scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
while( i.hasNext() )
{
TMultiPart p = i.next();
final TMultiPart p = i.next();
if( p instanceof CableBusPart )
{
return ( (CableBusPart) p ).cb;
@@ -203,13 +203,13 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
@Override
public void registerPassThrough( Class<?> layerInterface )
public void registerPassThrough( final Class<?> layerInterface )
{
try
{
MultipartGenerator.registerPassThroughInterface( layerInterface.getName() );
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.severe( "Failed to register " + layerInterface.getName() + " with FMP, some features may not work with MultiParts." );
AELog.error( t );
@@ -217,7 +217,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
@Override
public Event newFMPPacketEvent( EntityPlayerMP sender )
public Event newFMPPacketEvent( final EntityPlayerMP sender )
{
return new FMPPacketEvent( sender );
}
@@ -51,7 +51,7 @@ public class FZ implements IFZ, IIntegrationModule
private static Field day_item;
@Override
public ItemStack barrelGetItem( TileEntity te )
public ItemStack barrelGetItem( final TileEntity te )
{
try
{
@@ -69,17 +69,17 @@ public class FZ implements IFZ, IIntegrationModule
return i;
}
catch( IllegalArgumentException ignored )
catch( final IllegalArgumentException ignored )
{
}
catch( IllegalAccessException ignored )
catch( final IllegalAccessException ignored )
{
}
return null;
}
@Override
public int barrelGetMaxItemCount( TileEntity te )
public int barrelGetMaxItemCount( final TileEntity te )
{
try
{
@@ -88,20 +88,20 @@ public class FZ implements IFZ, IIntegrationModule
return (Integer) day_getMaxSize.invoke( te );
}
}
catch( IllegalAccessException ignored )
catch( final IllegalAccessException ignored )
{
}
catch( IllegalArgumentException ignored )
catch( final IllegalArgumentException ignored )
{
}
catch( InvocationTargetException ignored )
catch( final InvocationTargetException ignored )
{
}
return 0;
}
@Override
public int barrelGetItemCount( TileEntity te )
public int barrelGetItemCount( final TileEntity te )
{
try
{
@@ -110,20 +110,20 @@ public class FZ implements IFZ, IIntegrationModule
return (Integer) day_getItemCount.invoke( te );
}
}
catch( IllegalAccessException ignored )
catch( final IllegalAccessException ignored )
{
}
catch( IllegalArgumentException ignored )
catch( final IllegalArgumentException ignored )
{
}
catch( InvocationTargetException ignored )
catch( final InvocationTargetException ignored )
{
}
return 0;
}
@Override
public void setItemType( TileEntity te, ItemStack input )
public void setItemType( final TileEntity te, final ItemStack input )
{
try
{
@@ -132,16 +132,16 @@ public class FZ implements IFZ, IIntegrationModule
day_item.set( te, input == null ? null : input.copy() );
}
}
catch( IllegalArgumentException ignored )
catch( final IllegalArgumentException ignored )
{
}
catch( IllegalAccessException ignored )
catch( final IllegalAccessException ignored )
{
}
}
@Override
public void barrelSetCount( TileEntity te, int max )
public void barrelSetCount( final TileEntity te, final int max )
{
try
{
@@ -152,43 +152,43 @@ public class FZ implements IFZ, IIntegrationModule
te.markDirty();
}
catch( IllegalAccessException ignored )
catch( final IllegalAccessException ignored )
{
}
catch( IllegalArgumentException ignored )
catch( final IllegalArgumentException ignored )
{
}
catch( InvocationTargetException ignored )
catch( final InvocationTargetException ignored )
{
}
}
@Override
public IMEInventory getFactorizationBarrel( TileEntity te )
public IMEInventory getFactorizationBarrel( final TileEntity te )
{
return new FactorizationBarrel( this, te );
}
@Override
public boolean isBarrel( TileEntity te )
public boolean isBarrel( final TileEntity te )
{
return day_BarrelClass.isAssignableFrom( te.getClass() );
}
@Override
public void grinderRecipe( ItemStack in, ItemStack out )
public void grinderRecipe( final ItemStack in, final ItemStack out )
{
try
{
Class<?> c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" );
Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class );
final Class<?> c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" );
final Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class );
float amt = out.stackSize;
final float amt = out.stackSize;
out.stackSize = 1;
m.invoke( c, in, out, amt );
}
catch( Throwable t )
catch( final Throwable t )
{
// AELog.info( "" );
// throw new RuntimeException( t );
@@ -67,7 +67,7 @@ public class IC2 implements IIC2, IIntegrationModule
@Override
public void postInit()
{
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
final IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
reg.addNewAttunement( this.getItem( "copperCableItem" ), TunnelType.IC2_POWER );
reg.addNewAttunement( this.getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER );
reg.addNewAttunement( this.getItem( "goldCableItem" ), TunnelType.IC2_POWER );
@@ -85,25 +85,25 @@ public class IC2 implements IIC2, IIntegrationModule
}
@Override
public void addToEnergyNet( TileEntity appEngTile )
public void addToEnergyNet( final TileEntity appEngTile )
{
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) appEngTile ) );
}
@Override
public void removeFromEnergyNet( TileEntity appEngTile )
public void removeFromEnergyNet( final TileEntity appEngTile )
{
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) appEngTile ) );
}
@Override
public ItemStack getItem( String name )
public ItemStack getItem( final String name )
{
return ic2.api.item.IC2Items.getItem( name );
}
@Override
public void maceratorRecipe( ItemStack in, ItemStack out )
public void maceratorRecipe( final ItemStack in, final ItemStack out )
{
ic2.api.recipe.Recipes.macerator.addRecipe( new RecipeInputItemStack( in, in.stackSize ), null, out );
}
@@ -70,7 +70,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu
this.mergeIntoMicroblockContainer = this.MicroblockAPIUtils.getMethod( "mergeIntoMicroblockContainer", ItemStack.class, EntityPlayer.class, World.class, int.class, int.class, int.class, int.class, Block.class, int.class );
this.canConvertTiles = true;
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.error( t );
}
@@ -83,7 +83,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu
}
@Override
public IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te )
public IPartHost getOrCreateHost( final EntityPlayer player, final int side, final TileEntity te )
{
final World w = te.getWorldObj();
final int x = te.xCoord;
@@ -110,7 +110,7 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu
// int.class, int.class, int.class, int.class, Block.class, int.class );
this.mergeIntoMicroblockContainer.invoke( null, multiPartStack, player, w, x, y, z, side, multiPartBlock, 0 );
}
catch( Throwable e )
catch( final Throwable e )
{
this.canConvertTiles = false;
return null;
@@ -128,11 +128,11 @@ public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModu
}
@Override
public boolean leaveParts( TileEntity te )
public boolean leaveParts( final TileEntity te )
{
if( te instanceof IMultipartTile )
{
ICoverSystem ci = ( (IMultipartTile) te ).getCoverSystem();
final ICoverSystem ci = ( (IMultipartTile) te ).getCoverSystem();
if( ci != null )
{
ci.convertToContainerBlock();
@@ -60,7 +60,7 @@ public class InvTweaks implements IInvTweaks, IIntegrationModule
}
@Override
public int compareItems( ItemStack i, ItemStack j )
public int compareItems( final ItemStack i, final ItemStack j )
{
return api.compareItems( i, j );
}
@@ -52,7 +52,7 @@ public final class Mekanism implements IMekanism, IIntegrationModule
}
@Override
public void addCrusherRecipe( ItemStack in, ItemStack out )
public void addCrusherRecipe( final ItemStack in, final ItemStack out )
{
final NBTTagCompound sendTag = this.convertToSimpleRecipe( in, out );
@@ -60,14 +60,14 @@ public final class Mekanism implements IMekanism, IIntegrationModule
}
@Override
public void addEnrichmentChamberRecipe( ItemStack in, ItemStack out )
public void addEnrichmentChamberRecipe( final ItemStack in, final ItemStack out )
{
final NBTTagCompound sendTag = this.convertToSimpleRecipe( in, out );
FMLInterModComms.sendMessage( "mekanism", "EnrichmentChamberRecipe", sendTag );
}
private NBTTagCompound convertToSimpleRecipe( ItemStack in, ItemStack out )
private NBTTagCompound convertToSimpleRecipe( final ItemStack in, final ItemStack out )
{
final NBTTagCompound sendTag = new NBTTagCompound();
final NBTTagCompound inputTagDummy = new NBTTagCompound();
@@ -99,20 +99,20 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule
GuiContainerManager.addTooltipHandler( this );
// crafting terminal...
Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class );
Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" );
final Method registerGuiOverlay = this.apiClass.getDeclaredMethod( "registerGuiOverlay", Class.class, String.class, IStackPositioner.class );
final Class overlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" );
Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class );
final Method registrar = this.apiClass.getDeclaredMethod( "registerGuiOverlayHandler", Class.class, overlayHandler, String.class );
registerGuiOverlay.invoke( this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder() );
registerGuiOverlay.invoke( this.apiClass, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder() );
Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
Constructor defaultConstructor = defaultHandler.getConstructor( int.class, int.class );
final Class<NEICraftingHandler> defaultHandler = NEICraftingHandler.class;
final Constructor defaultConstructor = defaultHandler.getConstructor( int.class, int.class );
registrar.invoke( this.apiClass, GuiCraftingTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" );
registrar.invoke( this.apiClass, GuiPatternTerm.class, defaultConstructor.newInstance( 6, 75 ), "crafting" );
}
public void registerRecipeHandler( Object o ) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
public void registerRecipeHandler( final Object o ) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
{
this.registerRecipeHandler.invoke( this.apiClass, o );
this.registerUsageHandler.invoke( this.apiClass, o );
@@ -125,58 +125,58 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule
}
@Override
public void drawSlot( Slot s )
public void drawSlot( final Slot s )
{
if( s == null )
{
return;
}
ItemStack stack = s.getStack();
final ItemStack stack = s.getStack();
if( stack == null )
{
return;
}
Minecraft mc = Minecraft.getMinecraft();
FontRenderer fontRenderer = mc.fontRenderer;
int x = s.xDisplayPosition;
int y = s.yDisplayPosition;
final Minecraft mc = Minecraft.getMinecraft();
final FontRenderer fontRenderer = mc.fontRenderer;
final int x = s.xDisplayPosition;
final int y = s.yDisplayPosition;
GuiContainerManager.drawItems.renderItemAndEffectIntoGUI( fontRenderer, mc.getTextureManager(), stack, x, y );
GuiContainerManager.drawItems.renderItemOverlayIntoGUI( fontRenderer, mc.getTextureManager(), stack, x, y, String.valueOf( stack.stackSize ) );
}
@Override
public RenderItem setItemRender( RenderItem renderItem )
public RenderItem setItemRender( final RenderItem renderItem )
{
try
{
RenderItem ri = GuiContainerManager.drawItems;
final RenderItem ri = GuiContainerManager.drawItems;
GuiContainerManager.drawItems = renderItem;
return ri;
}
catch( Throwable t )
catch( final Throwable t )
{
throw new IllegalStateException( "Invalid version of NEI, please update", t );
}
}
@Override
public List<String> handleTooltip( GuiContainer arg0, int arg1, int arg2, List<String> current )
public List<String> handleTooltip( final GuiContainer arg0, final int arg1, final int arg2, final List<String> current )
{
return current;
}
@Override
public List<String> handleItemDisplayName( GuiContainer arg0, ItemStack arg1, List<String> current )
public List<String> handleItemDisplayName( final GuiContainer arg0, final ItemStack arg1, final List<String> current )
{
return current;
}
@Override
public List<String> handleItemTooltip( GuiContainer guiScreen, ItemStack stack, int mouseX, int mouseY, List<String> currentToolTip )
public List<String> handleItemTooltip( final GuiContainer guiScreen, final ItemStack stack, final int mouseX, final int mouseY, final List<String> currentToolTip )
{
if( guiScreen instanceof AEBaseMEGui )
{
@@ -58,18 +58,18 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( String outputId, Object... results )
public void loadCraftingRecipes( final String outputId, final Object... results )
{
if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIAEShapedRecipeHandler.class ) )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapedRecipe ) )
{
if( ( (ShapedRecipe) recipe ).isEnabled() )
{
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -83,16 +83,16 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( ItemStack result )
public void loadCraftingRecipes( final ItemStack result )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapedRecipe ) )
{
if( ( (ShapedRecipe) recipe ).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) )
{
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -101,14 +101,14 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadUsageRecipes( ItemStack ingredient )
public void loadUsageRecipes( final ItemStack ingredient )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapedRecipe ) )
{
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
final CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
if( ( (ShapedRecipe) recipe ).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) )
{
@@ -142,21 +142,21 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) );
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
if( renderer != null )
{
return renderer;
}
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
if( positioner == null )
{
return null;
@@ -166,9 +166,9 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
final IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
if( handler != null )
{
return handler;
@@ -177,9 +177,9 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
}
public boolean isRecipe2x2( int recipe )
public boolean isRecipe2x2( final int recipe )
{
for( PositionedStack stack : this.getIngredientStacks( recipe ) )
for( final PositionedStack stack : this.getIngredientStacks( recipe ) )
{
if( ( stack.relx > 43 ) || ( stack.rely > 24 ) )
{
@@ -201,36 +201,36 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapedRecipe( ShapedRecipe recipe )
public CachedShapedRecipe( final ShapedRecipe recipe )
{
this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 );
this.ingredients = new ArrayList<PositionedStack>();
this.setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() );
}
public void setIngredients( int width, int height, Object[] items )
public void setIngredients( final int width, final int height, final Object[] items )
{
boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI();
final boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI();
for( int x = 0; x < width; x++ )
{
for( int y = 0; y < height; y++ )
{
if( items[( y * width + x )] != null )
{
IIngredient ing = (IIngredient) items[( y * width + x )];
final IIngredient ing = (IIngredient) items[( y * width + x )];
try
{
ItemStack[] is = ing.getItemStackSet();
PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : is, 25 + x * 18, 6 + y * 18, false );
final ItemStack[] is = ing.getItemStackSet();
final PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : is, 25 + x * 18, 6 + y * 18, false );
stack.setMaxSize( 1 );
this.ingredients.add( stack );
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
@@ -253,7 +253,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public void computeVisuals()
{
for( PositionedStack p : this.ingredients )
for( final PositionedStack p : this.ingredients )
{
p.generatePermutations();
}
@@ -58,18 +58,18 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( String outputId, Object... results )
public void loadCraftingRecipes( final String outputId, final Object... results )
{
if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIAEShapelessRecipeHandler.class ) )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapelessRecipe ) )
{
if( ( (ShapelessRecipe) recipe ).isEnabled() )
{
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -83,16 +83,16 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( ItemStack result )
public void loadCraftingRecipes( final ItemStack result )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapelessRecipe ) )
{
if( ( (ShapelessRecipe) recipe ).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) )
{
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -101,14 +101,14 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadUsageRecipes( ItemStack ingredient )
public void loadUsageRecipes( final ItemStack ingredient )
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( IRecipe recipe : recipes )
final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for( final IRecipe recipe : recipes )
{
if( ( recipe instanceof ShapelessRecipe ) )
{
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
final CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
if( ( (ShapelessRecipe) recipe ).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) )
{
@@ -142,21 +142,21 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) );
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
if( renderer != null )
{
return renderer;
}
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
if( positioner == null )
{
return null;
@@ -166,9 +166,9 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
final IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
if( handler != null )
{
return handler;
@@ -177,9 +177,9 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
}
public boolean isRecipe2x2( int recipe )
public boolean isRecipe2x2( final int recipe )
{
for( PositionedStack stack : this.getIngredientStacks( recipe ) )
for( final PositionedStack stack : this.getIngredientStacks( recipe ) )
{
if( ( stack.relx > 43 ) || ( stack.rely > 24 ) )
{
@@ -201,7 +201,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapelessRecipe( ShapelessRecipe recipe )
public CachedShapelessRecipe( final ShapelessRecipe recipe )
{
this.result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 );
this.ingredients = new ArrayList<PositionedStack>();
@@ -220,29 +220,29 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
return this.getCycledIngredients( NEIAEShapelessRecipeHandler.this.cycleticks / 20, this.ingredients );
}
public void setIngredients( Object[] items )
public void setIngredients( final Object[] items )
{
boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI();
final boolean useSingleItems = AEConfig.instance.disableColoredCableRecipesInNEI();
for( int x = 0; x < 3; x++ )
{
for( int y = 0; y < 3; y++ )
{
if( items.length > ( y * 3 + x ) )
{
IIngredient ing = (IIngredient) items[( y * 3 + x )];
final IIngredient ing = (IIngredient) items[( y * 3 + x )];
try
{
ItemStack[] is = ing.getItemStackSet();
PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : ing.getItemStackSet(), 25 + x * 18, 6 + y * 18, false );
final ItemStack[] is = ing.getItemStackSet();
final PositionedStack stack = new PositionedStack( useSingleItems ? Platform.findPreferred( is ) : ing.getItemStackSet(), 25 + x * 18, 6 + y * 18, false );
stack.setMaxSize( 1 );
this.ingredients.add( stack );
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
@@ -253,7 +253,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public void computeVisuals()
{
for( PositionedStack p : this.ingredients )
for( final PositionedStack p : this.ingredients )
{
p.generatePermutations();
}
@@ -47,50 +47,50 @@ public class NEICraftingHandler implements IOverlayHandler
final int offsetX;
final int offsetY;
public NEICraftingHandler( int x, int y )
public NEICraftingHandler( final int x, final int y )
{
this.offsetX = x;
this.offsetY = y;
}
@Override
public void overlayRecipe( GuiContainer gui, IRecipeHandler recipe, int recipeIndex, boolean shift )
public void overlayRecipe( final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, final boolean shift )
{
try
{
List ingredients = recipe.getIngredientStacks( recipeIndex );
final List ingredients = recipe.getIngredientStacks( recipeIndex );
this.overlayRecipe( gui, ingredients, shift );
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
catch( Error ignored )
catch( final Error ignored )
{
}
}
public void overlayRecipe( GuiContainer gui, List<PositionedStack> ingredients, boolean shift )
public void overlayRecipe( final GuiContainer gui, final List<PositionedStack> ingredients, final boolean shift )
{
try
{
NBTTagCompound recipe = new NBTTagCompound();
final NBTTagCompound recipe = new NBTTagCompound();
if( gui instanceof GuiCraftingTerm || gui instanceof GuiPatternTerm )
{
for( PositionedStack positionedStack : ingredients )
for( final PositionedStack positionedStack : ingredients )
{
int col = ( positionedStack.relx - 25 ) / 18;
int row = ( positionedStack.rely - 6 ) / 18;
final int col = ( positionedStack.relx - 25 ) / 18;
final int row = ( positionedStack.rely - 6 ) / 18;
if( positionedStack.items != null && positionedStack.items.length > 0 )
{
for( Slot slot : (List<Slot>) gui.inventorySlots.inventorySlots )
for( final Slot slot : (List<Slot>) gui.inventorySlots.inventorySlots )
{
if( slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix )
{
if( slot.getSlotIndex() == col + row * 3 )
{
NBTTagList tags = new NBTTagList();
List<ItemStack> list = new LinkedList<ItemStack>();
final NBTTagList tags = new NBTTagList();
final List<ItemStack> list = new LinkedList<ItemStack>();
// prefer pure crystals.
for( int x = 0; x < positionedStack.items.length; x++ )
@@ -105,9 +105,9 @@ public class NEICraftingHandler implements IOverlayHandler
}
}
for( ItemStack is : list )
for( final ItemStack is : list )
{
NBTTagCompound tag = new NBTTagCompound();
final NBTTagCompound tag = new NBTTagCompound();
is.writeToNBT( tag );
tags.appendTag( tag );
}
@@ -123,10 +123,10 @@ public class NEICraftingHandler implements IOverlayHandler
NetworkHandler.instance.sendToServer( new PacketNEIRecipe( recipe ) );
}
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
catch( Error ignored )
catch( final Error ignored )
{
}
}
@@ -64,16 +64,16 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( String outputId, Object... results )
public void loadCraftingRecipes( final String outputId, final Object... results )
{
if( ( outputId.equals( "crafting" ) ) && ( this.getClass() == NEIFacadeRecipeHandler.class ) )
{
final List<ItemStack> facades = this.facade.getFacades();
for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
{
for( ItemStack is : facades )
for( final ItemStack is : facades )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is );
final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is );
recipe.computeVisuals();
this.arecipes.add( recipe );
}
@@ -86,13 +86,13 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( ItemStack result )
public void loadCraftingRecipes( final ItemStack result )
{
if( result.getItem() == this.facade )
{
for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, result );
final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, result );
recipe.computeVisuals();
this.arecipes.add( recipe );
}
@@ -100,14 +100,14 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadUsageRecipes( ItemStack ingredient )
public void loadUsageRecipes( final ItemStack ingredient )
{
List<ItemStack> facades = this.facade.getFacades();
for( ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
final List<ItemStack> facades = this.facade.getFacades();
for( final ItemStack anchorStack : this.anchorDefinition.maybeStack( 1 ).asSet() )
{
for( ItemStack is : facades )
for( final ItemStack is : facades )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is );
final CachedShapedRecipe recipe = new CachedShapedRecipe( this.facade, anchorStack, is );
if( recipe.contains( recipe.ingredients, ingredient.getItem() ) )
{
@@ -141,21 +141,21 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return ( super.hasOverlay( gui, container, recipe ) ) || ( ( this.isRecipe2x2( recipe ) ) && ( RecipeInfo.hasDefaultOverlay( gui, "crafting2x2" ) ) );
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
final IRecipeOverlayRenderer renderer = super.getOverlayRenderer( gui, recipe );
if( renderer != null )
{
return renderer;
}
IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
final IStackPositioner positioner = RecipeInfo.getStackPositioner( gui, "crafting2x2" );
if( positioner == null )
{
return null;
@@ -165,9 +165,9 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
final IOverlayHandler handler = super.getOverlayHandler( gui, recipe );
if( handler != null )
{
return handler;
@@ -176,9 +176,9 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
return RecipeInfo.getOverlayHandler( gui, "crafting2x2" );
}
public boolean isRecipe2x2( int recipe )
public boolean isRecipe2x2( final int recipe )
{
for( PositionedStack stack : this.getIngredientStacks( recipe ) )
for( final PositionedStack stack : this.getIngredientStacks( recipe ) )
{
if( ( stack.relx > 43 ) || ( stack.rely > 24 ) )
{
@@ -199,16 +199,16 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapedRecipe( IFacadeItem facade, ItemStack anchor, ItemStack output )
public CachedShapedRecipe( final IFacadeItem facade, final ItemStack anchor, final ItemStack output )
{
output.stackSize = 4;
this.result = new PositionedStack( output, 119, 24 );
this.ingredients = new ArrayList<PositionedStack>();
ItemStack in = facade.getTextureItem( output );
final ItemStack in = facade.getTextureItem( output );
this.setIngredients( 3, 3, new Object[] { null, anchor, null, anchor, in, anchor, null, anchor, null } );
}
public void setIngredients( int width, int height, Object[] items )
public void setIngredients( final int width, final int height, final Object[] items )
{
for( int x = 0; x < width; x++ )
{
@@ -216,8 +216,8 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
{
if( items[( y * width + x )] != null )
{
ItemStack is = (ItemStack) items[( y * width + x )];
PositionedStack stack = new PositionedStack( is, 25 + x * 18, 6 + y * 18, false );
final ItemStack is = (ItemStack) items[( y * width + x )];
final PositionedStack stack = new PositionedStack( is, 25 + x * 18, 6 + y * 18, false );
stack.setMaxSize( 1 );
this.ingredients.add( stack );
}
@@ -239,7 +239,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
public void computeVisuals()
{
for( PositionedStack p : this.ingredients )
for( final PositionedStack p : this.ingredients )
{
p.generatePermutations();
}
@@ -55,13 +55,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( String outputId, Object... results )
public void loadCraftingRecipes( final String outputId, final Object... results )
{
if( ( outputId.equals( "grindstone" ) ) && ( this.getClass() == NEIGrinderRecipeHandler.class ) )
{
for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
{
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -73,13 +73,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( ItemStack result )
public void loadCraftingRecipes( final ItemStack result )
{
for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
{
if( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) )
{
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -87,11 +87,11 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadUsageRecipes( ItemStack ingredient )
public void loadUsageRecipes( final ItemStack ingredient )
{
for( IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
for( final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes() )
{
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
if( ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) )
{
@@ -108,7 +108,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
@Override
public String getGuiTexture()
{
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" );
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" );
return loc.toString();
}
@@ -126,7 +126,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public void drawBackground( int recipe )
public void drawBackground( final int recipe )
{
GL11.glColor4f( 1, 1, 1, 1 );
GuiDraw.changeTexture( this.getGuiTexture() );
@@ -134,25 +134,25 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public void drawForeground( int recipe )
public void drawForeground( final int recipe )
{
super.drawForeground( recipe );
if( this.arecipes.size() > recipe )
{
CachedRecipe cr = this.arecipes.get( recipe );
final CachedRecipe cr = this.arecipes.get( recipe );
if( cr instanceof CachedGrindStoneRecipe )
{
CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr;
final CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr;
if( cachedRecipe.hasOptional )
{
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int width = fr.getStringWidth( cachedRecipe.displayChance );
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
final int width = fr.getStringWidth( cachedRecipe.displayChance );
fr.drawString( cachedRecipe.displayChance, ( 168 - width ) / 2, 5, 0 );
}
else
{
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int width = fr.getStringWidth( GuiText.NoSecondOutput.getLocal() );
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
final int width = fr.getStringWidth( GuiText.NoSecondOutput.getLocal() );
fr.drawString( GuiText.NoSecondOutput.getLocal(), ( 168 - width ) / 2, 5, 0 );
}
}
@@ -160,19 +160,19 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return false;
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
return null;
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
return null;
}
@@ -190,7 +190,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
public String displayChance;
boolean hasOptional = false;
public CachedGrindStoneRecipe( IGrinderEntry recipe )
public CachedGrindStoneRecipe( final IGrinderEntry recipe )
{
this.result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 );
this.ingredients = new ArrayList<PositionedStack>();
@@ -233,7 +233,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
public void computeVisuals()
{
for( PositionedStack p : this.ingredients )
for( final PositionedStack p : this.ingredients )
{
p.generatePermutations();
}
@@ -59,13 +59,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( String outputId, Object... results )
public void loadCraftingRecipes( final String outputId, final Object... results )
{
if( ( outputId.equals( "inscriber" ) ) && ( this.getClass() == NEIInscriberRecipeHandler.class ) )
{
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -77,13 +77,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadCraftingRecipes( ItemStack result )
public void loadCraftingRecipes( final ItemStack result )
{
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
@@ -91,11 +91,11 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
}
@Override
public void loadUsageRecipes( ItemStack ingredient )
public void loadUsageRecipes( final ItemStack ingredient )
{
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
if( ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) ) )
{
@@ -112,7 +112,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
@Override
public String getGuiTexture()
{
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/inscriber.png" );
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/inscriber.png" );
return loc.toString();
}
@@ -129,7 +129,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
}
@Override
public void drawBackground( int recipe )
public void drawBackground( final int recipe )
{
GL11.glColor4f( 1, 1, 1, 1 );
GuiDraw.changeTexture( this.getGuiTexture() );
@@ -137,19 +137,19 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return false;
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
return null;
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
return null;
}
@@ -166,19 +166,19 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedInscriberRecipe( IInscriberRecipe recipe )
public CachedInscriberRecipe( final IInscriberRecipe recipe )
{
this.result = new PositionedStack( recipe.getOutput(), 108, 29 );
this.ingredients = new ArrayList<PositionedStack>();
for( ItemStack top : recipe.getTopOptional().asSet() )
for( final ItemStack top : recipe.getTopOptional().asSet() )
{
this.ingredients.add( new PositionedStack( top, 40, 5 ) );
}
this.ingredients.add( new PositionedStack( recipe.getInputs(), 40 + 18, 28 ) );
for( ItemStack bot : recipe.getBottomOptional().asSet() )
for( final ItemStack bot : recipe.getBottomOptional().asSet() )
{
this.ingredients.add( new PositionedStack( bot, 40, 51 ) );
}
@@ -198,7 +198,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public void computeVisuals()
{
for( PositionedStack p : this.ingredients )
for( final PositionedStack p : this.ingredients )
{
p.generatePermutations();
}
@@ -72,38 +72,38 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
@Override
public void drawBackground( int recipe )
public void drawBackground( final int recipe )
{
GL11.glColor4f( 1, 1, 1, 1 );// nothing.
}
@Override
public void drawForeground( int recipe )
public void drawForeground( final int recipe )
{
if( this.outputs.size() > recipe )
{
// PositionedStack cr = this.outputs.get( recipe );
String details = this.details.get( this.offsets.get( recipe ) );
final String details = this.details.get( this.offsets.get( recipe ) );
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
fr.drawSplitString( details, 10, 25, 150, 0 );
}
}
@Override
public List<PositionedStack> getIngredientStacks( int recipeIndex )
public List<PositionedStack> getIngredientStacks( final int recipeIndex )
{
return new ArrayList<PositionedStack>();
}
@Override
public List<PositionedStack> getOtherStacks( int recipeIndex )
public List<PositionedStack> getOtherStacks( final int recipeIndex )
{
return new ArrayList<PositionedStack>();
}
@Override
public PositionedStack getResultStack( int recipe )
public PositionedStack getResultStack( final int recipe )
{
return this.outputs.get( recipe );
}
@@ -115,19 +115,19 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
@Override
public boolean hasOverlay( GuiContainer gui, Container container, int recipe )
public boolean hasOverlay( final GuiContainer gui, final Container container, final int recipe )
{
return false;
}
@Override
public IRecipeOverlayRenderer getOverlayRenderer( GuiContainer gui, int recipe )
public IRecipeOverlayRenderer getOverlayRenderer( final GuiContainer gui, final int recipe )
{
return null;
}
@Override
public IOverlayHandler getOverlayHandler( GuiContainer gui, int recipe )
public IOverlayHandler getOverlayHandler( final GuiContainer gui, final int recipe )
{
return null;
}
@@ -139,39 +139,39 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
@Override
public List<String> handleTooltip( GuiRecipe gui, List<String> currentToolTip, int recipe )
public List<String> handleTooltip( final GuiRecipe gui, final List<String> currentToolTip, final int recipe )
{
return currentToolTip;
}
@Override
public List<String> handleItemTooltip( GuiRecipe gui, ItemStack stack, List<String> currentToolTip, int recipe )
public List<String> handleItemTooltip( final GuiRecipe gui, final ItemStack stack, final List<String> currentToolTip, final int recipe )
{
return currentToolTip;
}
@Override
public boolean keyTyped( GuiRecipe gui, char keyChar, int keyCode, int recipe )
public boolean keyTyped( final GuiRecipe gui, final char keyChar, final int keyCode, final int recipe )
{
return false;
}
@Override
public boolean mouseClicked( GuiRecipe gui, int button, int recipe )
public boolean mouseClicked( final GuiRecipe gui, final int button, final int recipe )
{
return false;
}
@Override
public IUsageHandler getUsageHandler( String inputId, Object... ingredients )
public IUsageHandler getUsageHandler( final String inputId, final Object... ingredients )
{
return this;
}
@Override
public ICraftingHandler getRecipeHandler( String outputId, Object... results )
public ICraftingHandler getRecipeHandler( final String outputId, final Object... results )
{
NEIWorldCraftingHandler g = this.newInstance();
final NEIWorldCraftingHandler g = this.newInstance();
if( results.length > 0 && results[0] instanceof ItemStack )
{
g.target = (ItemStack) results[0];
@@ -187,11 +187,11 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
{
return this.getClass().newInstance();
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
throw new IllegalStateException( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
throw new IllegalStateException( e );
}
@@ -239,9 +239,9 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
}
private void addRecipe( IItemDefinition def, String msg )
private void addRecipe( final IItemDefinition def, final String msg )
{
for( ItemStack definitionStack : def.maybeStack( 1 ).asSet() )
for( final ItemStack definitionStack : def.maybeStack( 1 ).asSet() )
{
if( NEIServerUtils.areStacksSameTypeCrafting( definitionStack, this.target ) )
{
@@ -31,9 +31,9 @@ public class TerminalCraftingSlotFinder implements IStackPositioner
{
@Override
public ArrayList<PositionedStack> positionStacks( ArrayList<PositionedStack> a )
public ArrayList<PositionedStack> positionStacks( final ArrayList<PositionedStack> a )
{
for( PositionedStack ps : a )
for( final PositionedStack ps : a )
{
if( ps != null )
{
@@ -71,7 +71,7 @@ public class PneumaticCraft implements IIntegrationModule
this.registerPressureAttunement( "advancedPressureTube" );
}
private void registerPressureAttunement( String itemID )
private void registerPressureAttunement( final String itemID )
{
final IP2PTunnelRegistry registry = AEApi.instance().registries().p2pTunnel();
final ItemStack modItem = GameRegistry.findItemStack( PNEUMATIC_CRAFT_MOD_ID, itemID, 1 );
@@ -43,9 +43,9 @@ public class RC implements IRC, IIntegrationModule
}
@Override
public void rockCrusher( ItemStack input, ItemStack output )
public void rockCrusher( final ItemStack input, final ItemStack output )
{
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
final IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
re.addOutput( output, 1.0f );
}
@@ -80,7 +80,7 @@ public final class RF implements IIntegrationModule
this.registerRFAttunement( "EnderIO", "blockPowerMonitor", 0 );
}
private void registerRFAttunement( String mod, String name, int dmg )
private void registerRFAttunement( final String mod, final String name, final int dmg )
{
assert mod != null;
assert !mod.isEmpty();
@@ -47,7 +47,7 @@ public class Waila implements IIntegrationModule
IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.ITaggedList.class );
}
public static void register( IWailaRegistrar registrar )
public static void register( final IWailaRegistrar registrar )
{
final IWailaDataProvider partHost = new PartWailaDataProvider();
@@ -37,21 +37,21 @@ public class BSCrate implements IMEInventory<IAEItemStack>
private final ICrateStorage crateStorage;
private final ForgeDirection side;
public BSCrate( Object object, ForgeDirection d )
public BSCrate( final Object object, final ForgeDirection d )
{
this.crateStorage = (ICrateStorage) object;
this.side = d;
}
@Override
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
return null;
}
ItemStack failed = this.crateStorage.insertItems( input.getItemStack() );
final ItemStack failed = this.crateStorage.insertItems( input.getItemStack() );
if( failed == null )
{
return null;
@@ -61,22 +61,22 @@ public class BSCrate implements IMEInventory<IAEItemStack>
}
@Override
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src )
{
if( mode == Actionable.SIMULATE )
{
int howMany = this.crateStorage.getItemCount( request.getItemStack() );
final int howMany = this.crateStorage.getItemCount( request.getItemStack() );
return howMany > request.getStackSize() ? request : request.copy().setStackSize( howMany );
}
ItemStack obtained = this.crateStorage.extractItems( request.getItemStack(), (int) request.getStackSize() );
final ItemStack obtained = this.crateStorage.extractItems( request.getItemStack(), (int) request.getStackSize() );
return AEItemStack.create( obtained );
}
@Override
public IItemList getAvailableItems( IItemList out )
public IItemList getAvailableItems( final IItemList out )
{
for( ItemStack is : this.crateStorage.getContents() )
for( final ItemStack is : this.crateStorage.getContents() )
{
out.add( AEItemStack.create( is ) );
}
@@ -33,13 +33,13 @@ public class BSCrateHandler implements IExternalStorageHandler
{
@Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc )
public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc )
{
return channel == StorageChannel.ITEMS && te instanceof ICrateStorage;
}
@Override
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src )
public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src )
{
if( channel == StorageChannel.ITEMS )
{
@@ -39,18 +39,18 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
final ICrateStorage cs;
final ForgeDirection side;
public BSCrateStorageAdaptor( Object te, ForgeDirection d )
public BSCrateStorageAdaptor( final Object te, final ForgeDirection d )
{
this.cs = (ICrateStorage) te;
this.side = d;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
ItemStack target = null;
for( ItemStack is : this.cs.getContents() )
for( final ItemStack is : this.cs.getContents() )
{
if( is != null )
{
@@ -67,7 +67,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
if( target != null )
{
ItemStack f = Platform.cloneItemStack( target );
final ItemStack f = Platform.cloneItemStack( target );
f.stackSize = amount;
return this.cs.extractItems( f, amount );
}
@@ -76,11 +76,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
ItemStack target = null;
for( ItemStack is : this.cs.getContents() )
for( final ItemStack is : this.cs.getContents() )
{
if( is != null )
{
@@ -106,7 +106,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
{
cnt = amount;
}
ItemStack c = target.copy();
final ItemStack c = target.copy();
c.stackSize = cnt;
return c;
}
@@ -115,11 +115,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
ItemStack target = null;
for( ItemStack is : this.cs.getContents() )
for( final ItemStack is : this.cs.getContents() )
{
if( is != null )
{
@@ -136,7 +136,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
if( target != null )
{
ItemStack f = Platform.cloneItemStack( target );
final ItemStack f = Platform.cloneItemStack( target );
f.stackSize = amount;
return this.cs.extractItems( f, amount );
}
@@ -145,11 +145,11 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
ItemStack target = null;
for( ItemStack is : this.cs.getContents() )
for( final ItemStack is : this.cs.getContents() )
{
if( is != null )
{
@@ -175,7 +175,7 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
{
cnt = amount;
}
ItemStack c = target.copy();
final ItemStack c = target.copy();
c.stackSize = cnt;
return c;
}
@@ -184,16 +184,16 @@ public class BSCrateStorageAdaptor extends InventoryAdaptor
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
public ItemStack addItems( final ItemStack toBeAdded )
{
return this.cs.insertItems( toBeAdded );
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
public ItemStack simulateAdd( final ItemStack toBeSimulated )
{
int items = this.cs.getSpaceForItem( toBeSimulated );
ItemStack cloned = Platform.cloneItemStack( toBeSimulated );
final int items = this.cs.getSpaceForItem( toBeSimulated );
final ItemStack cloned = Platform.cloneItemStack( toBeSimulated );
if( toBeSimulated.stackSize <= items )
{
return null;
@@ -29,7 +29,7 @@ public class FMPPacketEvent extends Event
public final EntityPlayerMP sender;
public FMPPacketEvent( EntityPlayerMP sender )
public FMPPacketEvent( final EntityPlayerMP sender )
{
this.sender = sender;
}
@@ -38,7 +38,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
final IFZ fProxy;
private final TileEntity te;
public FactorizationBarrel( IFZ proxy, TileEntity tile )
public FactorizationBarrel( final IFZ proxy, final TileEntity tile )
{
this.te = tile;
this.fProxy = proxy;
@@ -50,7 +50,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
}
@Override
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src )
{
if( input == null )
{
@@ -61,7 +61,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
return null;
}
ItemStack shared = input.getItemStack();
final ItemStack shared = input.getItemStack();
if( shared.isItemDamaged() )
{
return input;
@@ -77,15 +77,15 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
if( this.containsItemType( input, mode == Actionable.SIMULATE ) )
{
int max = this.fProxy.barrelGetMaxItemCount( this.te );
int newTotal = (int) this.storedItemCount() + (int) input.getStackSize();
final int max = this.fProxy.barrelGetMaxItemCount( this.te );
final int newTotal = (int) this.storedItemCount() + (int) input.getStackSize();
if( newTotal > max )
{
if( mode == Actionable.MODULATE )
{
this.fProxy.barrelSetCount( this.te, max );
}
IAEItemStack result = input.copy();
final IAEItemStack result = input.copy();
result.setStackSize( newTotal - max );
return result;
}
@@ -107,9 +107,9 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
return this.fProxy.barrelGetItem( this.te ) == null ? 1 : 0;
}
public boolean containsItemType( IAEItemStack i, boolean acceptEmpty )
public boolean containsItemType( final IAEItemStack i, final boolean acceptEmpty )
{
ItemStack currentItem = this.fProxy.barrelGetItem( this.te );
final ItemStack currentItem = this.fProxy.barrelGetItem( this.te );
// empty barrels want your love too!
if( acceptEmpty && currentItem == null )
@@ -126,11 +126,11 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
}
@Override
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src )
{
if( this.containsItemType( request, false ) )
{
int howMany = (int) this.storedItemCount();
final int howMany = (int) this.storedItemCount();
if( request.getStackSize() >= howMany )
{
if( mode == Actionable.MODULATE )
@@ -139,7 +139,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
this.fProxy.barrelSetCount( this.te, 0 );
}
IAEItemStack r = request.copy();
final IAEItemStack r = request.copy();
r.setStackSize( howMany );
return r;
}
@@ -156,9 +156,9 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
}
@Override
public IItemList<IAEItemStack> getAvailableItems( IItemList out )
public IItemList<IAEItemStack> getAvailableItems( final IItemList out )
{
ItemStack i = this.fProxy.barrelGetItem( this.te );
final ItemStack i = this.fProxy.barrelGetItem( this.te );
if( i != null )
{
i.stackSize = this.fProxy.barrelGetItemCount( this.te );
@@ -35,13 +35,13 @@ public class FactorizationHandler implements IExternalStorageHandler
{
@Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc )
{
return chan == StorageChannel.ITEMS && FZ.instance.isBarrel( te );
}
@Override
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src )
public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src )
{
if( chan == StorageChannel.ITEMS )
{
@@ -35,13 +35,13 @@ public class MFRDSUHandler implements IExternalStorageHandler
{
@Override
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
public boolean canHandle( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc )
{
return chan == StorageChannel.ITEMS && DSU.instance.isDSU( te );
}
@Override
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src )
public IMEInventory getInventory( final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src )
{
if( chan == StorageChannel.ITEMS )
{
@@ -39,21 +39,21 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory<IAEItemS
final IDeepStorageUnit dsu;
final TileEntity te;
public MinefactoryReloadedDeepStorageUnit( TileEntity ta )
public MinefactoryReloadedDeepStorageUnit( final TileEntity ta )
{
this.te = ta;
this.dsu = (IDeepStorageUnit) ta;
}
@Override
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
public IAEItemStack injectItems( final IAEItemStack input, final Actionable mode, final BaseActionSource src )
{
ItemStack is = this.dsu.getStoredItemType();
final ItemStack is = this.dsu.getStoredItemType();
if( is != null )
{
if( input.equals( is ) )
{
long max = this.dsu.getMaxStoredCount();
final long max = this.dsu.getMaxStoredCount();
long storedItems = is.stackSize;
if( max == storedItems )
{
@@ -63,7 +63,7 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory<IAEItemS
storedItems += input.getStackSize();
if( storedItems > max )
{
IAEItemStack overflow = AEItemStack.create( is );
final IAEItemStack overflow = AEItemStack.create( is );
overflow.setStackSize( (int) ( storedItems - max ) );
if( mode == Actionable.MODULATE )
{
@@ -97,7 +97,7 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory<IAEItemS
}
@Override
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src )
{
ItemStack is = this.dsu.getStoredItemType();
if( request.equals( is ) )
@@ -124,9 +124,9 @@ public class MinefactoryReloadedDeepStorageUnit implements IMEInventory<IAEItemS
}
@Override
public IItemList<IAEItemStack> getAvailableItems( IItemList<IAEItemStack> out )
public IItemList<IAEItemStack> getAvailableItems( final IItemList<IAEItemStack> out )
{
ItemStack is = this.dsu.getStoredItemType();
final ItemStack is = this.dsu.getStoredItemType();
if( is != null )
{
out.add( AEItemStack.create( is ) );
@@ -28,25 +28,25 @@ public class NullRFHandler implements IEnergyReceiver
{
@Override
public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
public int receiveEnergy( final ForgeDirection from, final int maxReceive, final boolean simulate )
{
return 0;
}
@Override
public int getEnergyStored( ForgeDirection from )
public int getEnergyStored( final ForgeDirection from )
{
return 0;
}
@Override
public int getMaxEnergyStored( ForgeDirection from )
public int getMaxEnergyStored( final ForgeDirection from )
{
return 0;
}
@Override
public boolean canConnectEnergy( ForgeDirection from )
public boolean canConnectEnergy( final ForgeDirection from )
{
return true;
}
@@ -42,31 +42,31 @@ import mcp.mobius.waila.api.IWailaDataProvider;
public abstract class BaseWailaDataProvider implements IWailaDataProvider
{
@Override
public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config )
public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return null;
}
@Override
public List<String> getWailaHead( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public List<String> getWailaTail( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
return tag;
}
@@ -83,7 +83,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
}
@Override
public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config )
public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
final MovingObjectPosition mop = accessor.getPosition();
@@ -96,7 +96,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
ItemStack wailaStack = null;
for( IPartWailaDataProvider provider : this.providers )
for( final IPartWailaDataProvider provider : this.providers )
{
wailaStack = provider.getWailaStack( part, config, wailaStack );
}
@@ -107,7 +107,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
}
@Override
public List<String> getWailaHead( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
final MovingObjectPosition mop = accessor.getPosition();
@@ -118,7 +118,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
{
final IPart part = maybePart.get();
for( IPartWailaDataProvider provider : this.providers )
for( final IPartWailaDataProvider provider : this.providers )
{
provider.getWailaHead( part, currentToolTip, accessor, config );
}
@@ -128,7 +128,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
}
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
final MovingObjectPosition mop = accessor.getPosition();
@@ -139,7 +139,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
{
final IPart part = maybePart.get();
for( IPartWailaDataProvider provider : this.providers )
for( final IPartWailaDataProvider provider : this.providers )
{
provider.getWailaBody( part, currentToolTip, accessor, config );
}
@@ -149,7 +149,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
}
@Override
public List<String> getWailaTail( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
final MovingObjectPosition mop = accessor.getPosition();
@@ -160,7 +160,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
{
final IPart part = maybePart.get();
for( IPartWailaDataProvider provider : this.providers )
for( final IPartWailaDataProvider provider : this.providers )
{
provider.getWailaTail( part, currentToolTip, accessor, config );
}
@@ -170,7 +170,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
}
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
final MovingObjectPosition mop = this.tracer.retraceBlock( world, player, x, y, z );
@@ -182,7 +182,7 @@ public final class PartWailaDataProvider implements IWailaDataProvider
{
final IPart part = maybePart.get();
for( IPartWailaDataProvider provider : this.providers )
for( final IPartWailaDataProvider provider : this.providers )
{
provider.getNBTData( player, part, te, tag, world, x, y, z );
}
@@ -67,15 +67,15 @@ public final class TileWailaDataProvider implements IWailaDataProvider
}
@Override
public ItemStack getWailaStack( IWailaDataAccessor accessor, IWailaConfigHandler config )
public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return null;
}
@Override
public List<String> getWailaHead( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
for( IWailaDataProvider provider : this.providers )
for( final IWailaDataProvider provider : this.providers )
{
provider.getWailaHead( itemStack, currentToolTip, accessor, config );
}
@@ -84,9 +84,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider
}
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
for( IWailaDataProvider provider : this.providers )
for( final IWailaDataProvider provider : this.providers )
{
provider.getWailaBody( itemStack, currentToolTip, accessor, config );
}
@@ -95,9 +95,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider
}
@Override
public List<String> getWailaTail( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
for( IWailaDataProvider provider : this.providers )
for( final IWailaDataProvider provider : this.providers )
{
provider.getWailaTail( itemStack, currentToolTip, accessor, config );
}
@@ -106,9 +106,9 @@ public final class TileWailaDataProvider implements IWailaDataProvider
}
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
for( IWailaDataProvider provider : this.providers )
for( final IWailaDataProvider provider : this.providers )
{
provider.getNBTData( player, te, tag, world, x, y, z );
}
@@ -43,31 +43,31 @@ import appeng.api.parts.IPart;
public abstract class BasePartWailaDataProvider implements IPartWailaDataProvider
{
@Override
public ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack )
public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, final ItemStack partStack )
{
return null;
}
@Override
public List<String> getWailaHead( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaHead( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public List<String> getWailaTail( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaTail( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
return currentToolTip;
}
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final IPart part, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
return tag;
}
@@ -72,7 +72,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
* @return modified tool tip
*/
@Override
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
if( part instanceof PartCableSmart || part instanceof PartDenseCable )
{
@@ -100,7 +100,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
*
* @return used channels on the cable
*/
private byte getUsedChannels( IPart part, NBTTagCompound tag, TObjectByteMap<IPart> cache )
private byte getUsedChannels( final IPart part, final NBTTagCompound tag, final TObjectByteMap<IPart> cache )
{
final byte usedChannels;
@@ -139,7 +139,7 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
* @return tag send to the client
*/
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final IPart part, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
if( part instanceof PartCableSmart || part instanceof PartDenseCable )
{
@@ -50,7 +50,7 @@ public final class PartAccessor
*
* @return maybe the looked at {@link appeng.api.parts.IPart}
*/
public Optional<IPart> getMaybePart( TileEntity te, MovingObjectPosition mop )
public Optional<IPart> getMaybePart( final TileEntity te, final MovingObjectPosition mop )
{
if( te instanceof IPartHost )
{
@@ -38,7 +38,7 @@ public class PartStackWailaDataProvider extends BasePartWailaDataProvider
{
@Override
public ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack )
public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, ItemStack partStack )
{
partStack = part.getItemStack( PartItemStack.Pick );
return partStack;
@@ -49,7 +49,7 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider
* @return modified tooltip
*/
@Override
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
if( part instanceof IPowerChannelState )
{
@@ -69,7 +69,7 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider
*
* @return tooltip of the state
*/
private String getToolTip( boolean isActive, boolean isPowered )
private String getToolTip( final boolean isActive, final boolean isPowered )
{
final String result;
@@ -53,7 +53,7 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv
* @return modified tooltip
*/
@Override
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
if( part instanceof IPartStorageMonitor )
{
@@ -64,12 +64,12 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv
if( displayed instanceof IAEItemStack )
{
IAEItemStack ais = (IAEItemStack) displayed;
final IAEItemStack ais = (IAEItemStack) displayed;
currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() );
}
else if( displayed instanceof IAEFluidStack )
{
IAEFluidStack ais = (IAEFluidStack) displayed;
final IAEFluidStack ais = (IAEFluidStack) displayed;
currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) );
}
@@ -48,14 +48,14 @@ public final class Tracer
*
* @return trace movement. Can be null
*/
public MovingObjectPosition retraceBlock( World world, EntityPlayerMP player, int x, int y, int z )
public MovingObjectPosition retraceBlock( final World world, final EntityPlayerMP player, final int x, final int y, final int z )
{
Block block = world.getBlock( x, y, z );
final Block block = world.getBlock( x, y, z );
Vec3 headVec = this.getCorrectedHeadVec( player );
Vec3 lookVec = player.getLook( 1.0F );
double reach = this.getBlockReachDistance_server( player );
Vec3 endVec = headVec.addVector( lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach );
final Vec3 headVec = this.getCorrectedHeadVec( player );
final Vec3 lookVec = player.getLook( 1.0F );
final double reach = this.getBlockReachDistance_server( player );
final Vec3 endVec = headVec.addVector( lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach );
return block.collisionRayTrace( world, x, y, z, headVec, endVec );
}
@@ -67,9 +67,9 @@ public final class Tracer
*
* @return view point of player
*/
private Vec3 getCorrectedHeadVec( EntityPlayer player )
private Vec3 getCorrectedHeadVec( final EntityPlayer player )
{
Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ );
final Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ );
if( player.worldObj.isRemote )
{
// compatibility with eye height changing mods
@@ -91,7 +91,7 @@ public final class Tracer
*
* @return block reach distance of player
*/
private double getBlockReachDistance_server( EntityPlayerMP player )
private double getBlockReachDistance_server( final EntityPlayerMP player )
{
return player.theItemInWorldManager.getBlockReachDistance();
}
@@ -54,7 +54,7 @@ public final class ChargerWailaDataProvider extends BaseWailaDataProvider
* @return modified tooltip
*/
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
if( te instanceof TileCharger )
@@ -53,7 +53,7 @@ public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvide
* @return modified tooltip
*/
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
if( te instanceof TileCraftingMonitorTile )
@@ -52,7 +52,7 @@ public final class PowerStateWailaDataProvider extends BaseWailaDataProvider
* @return modified tooltip
*/
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
final TileEntity te = accessor.getTileEntity();
@@ -75,7 +75,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
* @return modified tool tip
*/
@Override
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
{
// Removes RF tooltip on WAILA 1.5.9+
( (ITaggedList<String, String>) currentToolTip ).removeEntries( "RFEnergyStorage" );
@@ -120,7 +120,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
* @return tag send to the client
*/
@Override
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, final int x, final int y, final int z )
{
if( te instanceof IAEPowerStorage )
{
@@ -148,7 +148,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
*
* @return used channels on the cable
*/
private long getInternalCurrentPower( NBTTagCompound tag, TileEntity te )
private long getInternalCurrentPower( final NBTTagCompound tag, final TileEntity te )
{
final long internalCurrentPower;