final variables and parameters
This commit is contained in:
@@ -40,7 +40,7 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
private final boolean enabled;
|
||||
private final BlockDefinition definition;
|
||||
|
||||
public AEBlockFeatureHandler( EnumSet<AEFeature> features, AEBaseBlock featured, Optional<String> subName )
|
||||
public AEBlockFeatureHandler( final EnumSet<AEFeature> features, final AEBaseBlock featured, final Optional<String> subName )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
|
||||
@@ -64,11 +64,11 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register( Side side )
|
||||
public void register( final Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
final String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class AECableBusFeatureHandler implements IFeatureHandler
|
||||
private final boolean enabled;
|
||||
private final TileDefinition definition;
|
||||
|
||||
public AECableBusFeatureHandler( EnumSet<AEFeature> features, BlockCableBus featured, Optional<String> subName )
|
||||
public AECableBusFeatureHandler( final EnumSet<AEFeature> features, final BlockCableBus featured, final Optional<String> subName )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
|
||||
@@ -69,11 +69,11 @@ public final class AECableBusFeatureHandler implements IFeatureHandler
|
||||
* Registration of the {@link TileEntity} will actually be handled by {@link BlockCableBus#setupTile()}.
|
||||
*/
|
||||
@Override
|
||||
public void register(Side side)
|
||||
public void register( final Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
final String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
@@ -136,12 +136,12 @@ public enum AEFeature
|
||||
public final boolean isVisible;
|
||||
public final boolean defaultValue;
|
||||
|
||||
AEFeature( String cat )
|
||||
AEFeature( final String cat )
|
||||
{
|
||||
this( cat, true );
|
||||
}
|
||||
|
||||
AEFeature( String cat, boolean defaultValue )
|
||||
AEFeature( final String cat, final boolean defaultValue )
|
||||
{
|
||||
this.category = cat;
|
||||
this.isVisible = !this.name().equals( "Core" );
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler
|
||||
private final boolean enabled;
|
||||
private final TileDefinition definition;
|
||||
|
||||
public AETileBlockFeatureHandler( EnumSet<AEFeature> features, AEBaseTileBlock featured, Optional<String> subName )
|
||||
public AETileBlockFeatureHandler( final EnumSet<AEFeature> features, final AEBaseTileBlock featured, final Optional<String> subName )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
|
||||
@@ -65,11 +65,11 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register( Side side )
|
||||
public void register( final Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
final String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
@@ -24,7 +24,7 @@ public enum ActivityState
|
||||
Enabled,
|
||||
Disabled;
|
||||
|
||||
public static ActivityState from( boolean enabled )
|
||||
public static ActivityState from( final boolean enabled )
|
||||
{
|
||||
if( enabled )
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
private static final ItemBlockTransformer ITEMBLOCK_TRANSFORMER = new ItemBlockTransformer();
|
||||
private final Optional<Block> block;
|
||||
|
||||
public BlockDefinition( final String identifier, Block block, ActivityState state )
|
||||
public BlockDefinition( final String identifier, final Block block, final ActivityState state )
|
||||
{
|
||||
super( identifier, constructItemFromBlock( block ), state );
|
||||
|
||||
@@ -66,7 +66,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
*
|
||||
* @return item from block
|
||||
*/
|
||||
private static Item constructItemFromBlock( Block block )
|
||||
private static Item constructItemFromBlock( final Block block )
|
||||
{
|
||||
final Class<? extends ItemBlock> itemclass = getItemBlockConstructor( block );
|
||||
return constructItemBlock( block, itemclass );
|
||||
@@ -82,7 +82,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
*
|
||||
* @return a {@link Class} extending ItemBlock
|
||||
*/
|
||||
private static Class<? extends ItemBlock> getItemBlockConstructor( Block block )
|
||||
private static Class<? extends ItemBlock> getItemBlockConstructor( final Block block )
|
||||
{
|
||||
if( block instanceof AEBaseBlock )
|
||||
{
|
||||
@@ -105,22 +105,22 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
*
|
||||
* @return an {@link Item} for the block. Actually always a sub type of {@link ItemBlock}
|
||||
*/
|
||||
private static Item constructItemBlock( Block block, Class<? extends ItemBlock> itemclass )
|
||||
private static Item constructItemBlock( final Block block, final Class<? extends ItemBlock> itemclass )
|
||||
{
|
||||
try
|
||||
{
|
||||
Object[] itemCtorArgs = {};
|
||||
Class<?>[] ctorArgClasses = new Class<?>[itemCtorArgs.length + 1];
|
||||
final Object[] itemCtorArgs = {};
|
||||
final Class<?>[] ctorArgClasses = new Class<?>[itemCtorArgs.length + 1];
|
||||
ctorArgClasses[0] = Block.class;
|
||||
for( int idx = 1; idx < ctorArgClasses.length; idx++ )
|
||||
{
|
||||
ctorArgClasses[idx] = itemCtorArgs[idx - 1].getClass();
|
||||
}
|
||||
|
||||
Constructor<? extends ItemBlock> itemCtor = itemclass.getConstructor( ctorArgClasses );
|
||||
final Constructor<? extends ItemBlock> itemCtor = itemclass.getConstructor( ctorArgClasses );
|
||||
return itemCtor.newInstance( ObjectArrays.concat( block, itemCtorArgs ) );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -139,13 +139,13 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Optional<ItemStack> maybeStack( int stackSize )
|
||||
public final Optional<ItemStack> maybeStack( final int stackSize )
|
||||
{
|
||||
return this.block.transform( new ItemStackTransformer( stackSize ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isSameAs( IBlockAccess world, BlockPos pos )
|
||||
public final boolean isSameAs( final IBlockAccess world, final BlockPos pos )
|
||||
{
|
||||
return this.isEnabled() && world.getBlockState( pos ).getBlock() == this.block.get();
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
private static class ItemBlockTransformer implements Function<Block, ItemBlock>
|
||||
{
|
||||
@Override
|
||||
public ItemBlock apply( Block input )
|
||||
public ItemBlock apply( final Block input )
|
||||
{
|
||||
return new ItemBlock( input );
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
{
|
||||
private final int stackSize;
|
||||
|
||||
public ItemStackTransformer( int stackSize )
|
||||
public ItemStackTransformer( final int stackSize )
|
||||
{
|
||||
Preconditions.checkArgument( stackSize > 0 );
|
||||
|
||||
@@ -171,7 +171,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack apply( Block input )
|
||||
public ItemStack apply( final Block input )
|
||||
{
|
||||
return new ItemStack( input, this.stackSize );
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BlockStackSrc implements IStackSrc
|
||||
public final int damage;
|
||||
private final boolean enabled;
|
||||
|
||||
public BlockStackSrc( Block block, int damage, ActivityState state )
|
||||
public BlockStackSrc( final Block block, final int damage, final ActivityState state )
|
||||
{
|
||||
Preconditions.checkNotNull( block );
|
||||
Preconditions.checkArgument( damage >= 0 );
|
||||
@@ -49,7 +49,7 @@ public class BlockStackSrc implements IStackSrc
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack stack( int i )
|
||||
public ItemStack stack( final int i )
|
||||
{
|
||||
return new ItemStack( this.block, i, this.damage );
|
||||
}
|
||||
|
||||
@@ -32,21 +32,21 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
|
||||
final ItemStackSrc[] colors = new ItemStackSrc[17];
|
||||
|
||||
public void add( AEColor v, ItemStackSrc is )
|
||||
public void add( final AEColor v, final ItemStackSrc is )
|
||||
{
|
||||
this.colors[v.ordinal()] = is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block block( AEColor color )
|
||||
public Block block( final AEColor color )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item item( AEColor color )
|
||||
public Item item( final AEColor color )
|
||||
{
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
final ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( is == null )
|
||||
{
|
||||
@@ -57,15 +57,15 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends TileEntity> entity( AEColor color )
|
||||
public Class<? extends TileEntity> entity( final AEColor color )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack stack( AEColor color, int stackSize )
|
||||
public ItemStack stack( final AEColor color, final int stackSize )
|
||||
{
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
final ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( is == null )
|
||||
{
|
||||
@@ -76,9 +76,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] allStacks( int stackSize )
|
||||
public ItemStack[] allStacks( final int stackSize )
|
||||
{
|
||||
ItemStack[] is = new ItemStack[this.colors.length];
|
||||
final ItemStack[] is = new ItemStack[this.colors.length];
|
||||
for( int x = 0; x < is.length; x++ )
|
||||
{
|
||||
is[x] = this.colors[x].stack( 1 );
|
||||
@@ -87,9 +87,9 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAs( AEColor color, ItemStack comparableItem )
|
||||
public boolean sameAs( final AEColor color, final ItemStack comparableItem )
|
||||
{
|
||||
ItemStackSrc is = this.colors[color.ordinal()];
|
||||
final ItemStackSrc is = this.colors[color.ordinal()];
|
||||
|
||||
if( comparableItem == null || is == null )
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
private static final ItemTransformer ITEM_TRANSFORMER = new ItemTransformer();
|
||||
private final Optional<IStackSrc> source;
|
||||
|
||||
public DamagedItemDefinition( @Nonnull String identifier, @Nonnull IStackSrc source )
|
||||
public DamagedItemDefinition( @Nonnull final String identifier, @Nonnull final IStackSrc source )
|
||||
{
|
||||
this.identifier = Preconditions.checkNotNull( identifier );
|
||||
Preconditions.checkNotNull( source );
|
||||
@@ -66,7 +66,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ItemStack> maybeStack( int stackSize )
|
||||
public Optional<ItemStack> maybeStack( final int stackSize )
|
||||
{
|
||||
return this.source.transform( new ItemStackTransformer( stackSize ) );
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameAs( ItemStack comparableStack )
|
||||
public boolean isSameAs( final ItemStack comparableStack )
|
||||
{
|
||||
if( comparableStack == null )
|
||||
{
|
||||
@@ -91,7 +91,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
private static class ItemTransformer implements Function<IStackSrc, Item>
|
||||
{
|
||||
@Override
|
||||
public Item apply( IStackSrc input )
|
||||
public Item apply( final IStackSrc input )
|
||||
{
|
||||
return input.getItem();
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
{
|
||||
private final int stackSize;
|
||||
|
||||
public ItemStackTransformer( int stackSize )
|
||||
public ItemStackTransformer( final int stackSize )
|
||||
{
|
||||
Preconditions.checkArgument( stackSize > 0 );
|
||||
|
||||
@@ -109,7 +109,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack apply( IStackSrc input )
|
||||
public ItemStack apply( final IStackSrc input )
|
||||
{
|
||||
return input.stack( this.stackSize );
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class FeatureNameExtractor
|
||||
private final Class<?> clazz;
|
||||
private final Optional<String> subName;
|
||||
|
||||
public FeatureNameExtractor( Class<?> clazz, Optional<String> subName )
|
||||
public FeatureNameExtractor( final Class<?> clazz, final Optional<String> subName )
|
||||
{
|
||||
this.clazz = clazz;
|
||||
this.subName = subName;
|
||||
|
||||
@@ -28,14 +28,14 @@ public final class FeaturedActiveChecker
|
||||
{
|
||||
private final Set<AEFeature> features;
|
||||
|
||||
public FeaturedActiveChecker( Set<AEFeature> features )
|
||||
public FeaturedActiveChecker( final Set<AEFeature> features )
|
||||
{
|
||||
this.features = features;
|
||||
}
|
||||
|
||||
public ActivityState getActivityState()
|
||||
{
|
||||
for( AEFeature f : this.features )
|
||||
for( final AEFeature f : this.features )
|
||||
{
|
||||
if( !AEConfig.instance.isFeatureEnabled( f ) )
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
private final String identifier;
|
||||
private final Optional<Item> item;
|
||||
|
||||
public ItemDefinition( String identifier, Item item, ActivityState state )
|
||||
public ItemDefinition( final String identifier, final Item item, final ActivityState state )
|
||||
{
|
||||
this.identifier = Preconditions.checkNotNull( identifier );
|
||||
Preconditions.checkArgument( !identifier.isEmpty() );
|
||||
@@ -68,7 +68,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ItemStack> maybeStack( int stackSize )
|
||||
public Optional<ItemStack> maybeStack( final int stackSize )
|
||||
{
|
||||
return this.item.transform( new ItemStackTransformer( stackSize ) );
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isSameAs( ItemStack comparableStack )
|
||||
public final boolean isSameAs( final ItemStack comparableStack )
|
||||
{
|
||||
return this.isEnabled() && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() );
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
{
|
||||
private final int stackSize;
|
||||
|
||||
public ItemStackTransformer( int stackSize )
|
||||
public ItemStackTransformer( final int stackSize )
|
||||
{
|
||||
Preconditions.checkArgument( stackSize > 0 );
|
||||
|
||||
@@ -97,7 +97,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack apply( Item input )
|
||||
public ItemStack apply( final Item input )
|
||||
{
|
||||
return new ItemStack( input, this.stackSize );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
private final boolean enabled;
|
||||
private final ItemDefinition definition;
|
||||
|
||||
public ItemFeatureHandler( EnumSet<AEFeature> features, Item item, IAEFeature featured, Optional<String> subName )
|
||||
public ItemFeatureHandler( final EnumSet<AEFeature> features, final Item item, final IAEFeature featured, final Optional<String> subName )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
|
||||
@@ -64,12 +64,12 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register( Side side )
|
||||
public void register( final Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
String itemPhysicalName = name;
|
||||
final String itemPhysicalName = name;
|
||||
|
||||
//this.item.setTextureName( "appliedenergistics2:" + name );
|
||||
this.item.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
@@ -102,7 +102,7 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
}
|
||||
|
||||
private void configureIcon( Item item, int meta, String name )
|
||||
private void configureIcon( final Item item, final int meta, final String name )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ItemStackSrc implements IStackSrc
|
||||
public final int damage;
|
||||
private final boolean enabled;
|
||||
|
||||
public ItemStackSrc( Item item, int damage, ActivityState state )
|
||||
public ItemStackSrc( final Item item, final int damage, final ActivityState state )
|
||||
{
|
||||
Preconditions.checkNotNull( item );
|
||||
Preconditions.checkArgument( damage >= 0 );
|
||||
@@ -48,7 +48,7 @@ public class ItemStackSrc implements IStackSrc
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack stack( int i )
|
||||
public ItemStack stack( final int i )
|
||||
{
|
||||
return new ItemStack( this.item, i, this.damage );
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class MaterialStackSrc implements IStackSrc
|
||||
{
|
||||
private final MaterialType src;
|
||||
|
||||
public MaterialStackSrc( MaterialType src )
|
||||
public MaterialStackSrc( final MaterialType src )
|
||||
{
|
||||
Preconditions.checkNotNull( src );
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MaterialStackSrc implements IStackSrc
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack stack( int stackSize )
|
||||
public ItemStack stack( final int stackSize )
|
||||
{
|
||||
return this.src.stack( stackSize );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class StairBlockFeatureHandler implements IFeatureHandler
|
||||
private final boolean enabled;
|
||||
private final BlockDefinition definition;
|
||||
|
||||
public StairBlockFeatureHandler( EnumSet<AEFeature> features, BlockStairs stairs, Optional<String> subName )
|
||||
public StairBlockFeatureHandler( final EnumSet<AEFeature> features, final BlockStairs stairs, final Optional<String> subName )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
|
||||
@@ -64,11 +64,11 @@ public class StairBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void register( Side side )
|
||||
public final void register( final Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
final String name = this.extractor.get();
|
||||
this.stairs.setCreativeTab( CreativeTab.instance );
|
||||
this.stairs.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini
|
||||
private static final TileEntityTransformer TILEENTITY_TRANSFORMER = new TileEntityTransformer();
|
||||
private final Optional<AEBaseTileBlock> block;
|
||||
|
||||
public TileDefinition( @Nonnull final String identifier, AEBaseTileBlock block, ActivityState state )
|
||||
public TileDefinition( @Nonnull final String identifier, final AEBaseTileBlock block, final ActivityState state )
|
||||
{
|
||||
super( identifier, block, state );
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class TileDefinition extends BlockDefinition implements ITileDefini
|
||||
private static class TileEntityTransformer implements Function<AEBaseTileBlock, Class<? extends TileEntity>>
|
||||
{
|
||||
@Override
|
||||
public Class<? extends TileEntity> apply( AEBaseTileBlock input )
|
||||
public Class<? extends TileEntity> apply( final AEBaseTileBlock input )
|
||||
{
|
||||
final Class<? extends TileEntity> entity = input.getTileEntityClass();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCellHandler( ICellHandler h )
|
||||
public void addCellHandler( final ICellHandler h )
|
||||
{
|
||||
if( h != null )
|
||||
{
|
||||
@@ -50,13 +50,13 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellHandled( ItemStack is )
|
||||
public boolean isCellHandled( final ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
for( final ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
{
|
||||
@@ -67,13 +67,13 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICellHandler getHandler( ItemStack is )
|
||||
public ICellHandler getHandler( final ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
for( final ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
{
|
||||
@@ -84,13 +84,13 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel chan )
|
||||
public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel chan )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for( ICellHandler ch : this.handlers )
|
||||
for( final ICellHandler ch : this.handlers )
|
||||
{
|
||||
if( ch.isCell( is ) )
|
||||
{
|
||||
|
||||
@@ -43,15 +43,15 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addExternalStorageInterface( IExternalStorageHandler ei )
|
||||
public void addExternalStorageInterface( final IExternalStorageHandler ei )
|
||||
{
|
||||
this.Handlers.add( ei );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IExternalStorageHandler getHandler( TileEntity te, EnumFacing d, StorageChannel chan, BaseActionSource mySrc )
|
||||
public IExternalStorageHandler getHandler( final TileEntity te, final EnumFacing d, final StorageChannel chan, final BaseActionSource mySrc )
|
||||
{
|
||||
for( IExternalStorageHandler x : this.Handlers )
|
||||
for( final IExternalStorageHandler x : this.Handlers )
|
||||
{
|
||||
if( x.canHandle( te, d, chan, mySrc ) )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry
|
||||
private final Map<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>>();
|
||||
|
||||
@Override
|
||||
public void registerGridCache( Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation )
|
||||
public void registerGridCache( final Class<? extends IGridCache> iface, final Class<? extends IGridCache> implementation )
|
||||
{
|
||||
if( iface.isAssignableFrom( implementation ) )
|
||||
{
|
||||
@@ -48,33 +48,33 @@ public final class GridCacheRegistry implements IGridCacheRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance( IGrid g )
|
||||
public HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance( final IGrid g )
|
||||
{
|
||||
HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<Class<? extends IGridCache>, IGridCache>();
|
||||
final HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<Class<? extends IGridCache>, IGridCache>();
|
||||
|
||||
for( Class<? extends IGridCache> iface : this.caches.keySet() )
|
||||
for( final Class<? extends IGridCache> iface : this.caches.keySet() )
|
||||
{
|
||||
try
|
||||
{
|
||||
Constructor<? extends IGridCache> c = this.caches.get( iface ).getConstructor( IGrid.class );
|
||||
final Constructor<? extends IGridCache> c = this.caches.get( iface ).getConstructor( IGrid.class );
|
||||
map.put( iface, c.newInstance( g ) );
|
||||
}
|
||||
catch( NoSuchMethodException e )
|
||||
catch( final NoSuchMethodException e )
|
||||
{
|
||||
AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." );
|
||||
throw new IllegalArgumentException( e );
|
||||
}
|
||||
catch( InvocationTargetException e )
|
||||
catch( final InvocationTargetException e )
|
||||
{
|
||||
AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." );
|
||||
throw new IllegalStateException( e );
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
catch( final InstantiationException e )
|
||||
{
|
||||
AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." );
|
||||
throw new IllegalStateException( e );
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
catch( final IllegalAccessException e )
|
||||
{
|
||||
AELog.severe( "Grid Caches must have a constructor with IGrid as the single param." );
|
||||
throw new IllegalStateException( e );
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( ItemStack in, ItemStack out, int cost )
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final int cost )
|
||||
{
|
||||
if( in == null || out == null )
|
||||
{
|
||||
@@ -95,7 +95,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int cost )
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final int cost )
|
||||
{
|
||||
if( in == null || ( optional == null && out == null ) )
|
||||
{
|
||||
@@ -108,7 +108,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int cost )
|
||||
public void addRecipe( final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final ItemStack optional2, final float chance2, final int cost )
|
||||
{
|
||||
if( in == null || ( optional == null && out == null && optional2 == null ) )
|
||||
{
|
||||
@@ -120,9 +120,9 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), this.copy( optional2 ), chance, chance2, cost ) );
|
||||
}
|
||||
|
||||
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
|
||||
private void injectRecipe( final AppEngGrinderRecipe appEngGrinderRecipe )
|
||||
{
|
||||
for( IGrinderEntry gr : this.recipes )
|
||||
for( final IGrinderEntry gr : this.recipes )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
this.recipes.add( appEngGrinderRecipe );
|
||||
}
|
||||
|
||||
private ItemStack copy( ItemStack is )
|
||||
private ItemStack copy( final ItemStack is )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
@@ -143,12 +143,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGrinderEntry getRecipeForInput( ItemStack input )
|
||||
public IGrinderEntry getRecipeForInput( final ItemStack input )
|
||||
{
|
||||
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
|
||||
if( input != null )
|
||||
{
|
||||
for( IGrinderEntry r : this.recipes )
|
||||
for( final IGrinderEntry r : this.recipes )
|
||||
{
|
||||
if( Platform.isSameItem( input, r.getInput() ) )
|
||||
{
|
||||
@@ -163,12 +163,12 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
return null;
|
||||
}
|
||||
|
||||
public void log( String o )
|
||||
public void log( final String o )
|
||||
{
|
||||
AELog.grinder( o );
|
||||
}
|
||||
|
||||
private int getDustToOreRatio( String name )
|
||||
private int getDustToOreRatio( final String name )
|
||||
{
|
||||
if( name.equals( "Obsidian" ) )
|
||||
{
|
||||
@@ -185,7 +185,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
return 2;
|
||||
}
|
||||
|
||||
private void addOre( String name, ItemStack item )
|
||||
private void addOre( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
@@ -197,11 +197,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
|
||||
if( this.dusts.containsKey( name ) )
|
||||
{
|
||||
ItemStack is = this.dusts.get( name ).copy();
|
||||
int ratio = this.getDustToOreRatio( name );
|
||||
final ItemStack is = this.dusts.get( name ).copy();
|
||||
final int ratio = this.getDustToOreRatio( name );
|
||||
if( ratio > 1 )
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
final ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( item, is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
}
|
||||
|
||||
private void addIngot( String name, ItemStack item )
|
||||
private void addIngot( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
}
|
||||
|
||||
private void addDust( String name, ItemStack item )
|
||||
private void addDust( final String name, final ItemStack item )
|
||||
{
|
||||
if( item == null )
|
||||
{
|
||||
@@ -244,16 +244,16 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
|
||||
this.dusts.put( name, item );
|
||||
|
||||
for( Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||
for( final Entry<ItemStack, String> d : this.ores.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
ItemStack is = item.copy();
|
||||
final ItemStack is = item.copy();
|
||||
is.stackSize = 1;
|
||||
int ratio = this.getDustToOreRatio( name );
|
||||
final int ratio = this.getDustToOreRatio( name );
|
||||
if( ratio > 1 )
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
final ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
this.addRecipe( d.getKey(), is, extra, (float) ( AEConfig.instance.oreDoublePercentage / 100.0 ), 8 );
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
}
|
||||
|
||||
for( Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||
for( final Entry<ItemStack, String> d : this.ingots.entrySet() )
|
||||
{
|
||||
if( name.equals( d.getValue() ) )
|
||||
{
|
||||
@@ -274,11 +274,11 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oreRegistered( String name, ItemStack item )
|
||||
public void oreRegistered( final String name, final ItemStack item )
|
||||
{
|
||||
if( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) )
|
||||
{
|
||||
for( String ore : AEConfig.instance.grinderOres )
|
||||
for( final String ore : AEConfig.instance.grinderOres )
|
||||
{
|
||||
if( name.equals( "ore" + ore ) )
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe( IInscriberRecipe recipe )
|
||||
public void addRecipe( final IInscriberRecipe recipe )
|
||||
{
|
||||
if( recipe == null )
|
||||
{
|
||||
@@ -100,7 +100,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRecipe( IInscriberRecipe toBeRemovedRecipe )
|
||||
public void removeRecipe( final IInscriberRecipe toBeRemovedRecipe )
|
||||
{
|
||||
for( final Iterator<IInscriberRecipe> iterator = this.recipes.iterator(); iterator.hasNext(); )
|
||||
{
|
||||
@@ -126,7 +126,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Builder withInputs( @Nonnull Collection<ItemStack> inputs )
|
||||
public Builder withInputs( @Nonnull final Collection<ItemStack> inputs )
|
||||
{
|
||||
this.inputs = new ArrayList<ItemStack>( inputs.size() );
|
||||
this.inputs.addAll( inputs );
|
||||
@@ -136,7 +136,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Builder withOutput( @Nonnull ItemStack output )
|
||||
public Builder withOutput( @Nonnull final ItemStack output )
|
||||
{
|
||||
this.output = output;
|
||||
|
||||
@@ -145,7 +145,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Builder withTopOptional( @Nonnull ItemStack topOptional )
|
||||
public Builder withTopOptional( @Nonnull final ItemStack topOptional )
|
||||
{
|
||||
this.topOptional = topOptional;
|
||||
|
||||
@@ -154,7 +154,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Builder withBottomOptional( @Nonnull ItemStack bottomOptional )
|
||||
public Builder withBottomOptional( @Nonnull final ItemStack bottomOptional )
|
||||
{
|
||||
this.bottomOptional = bottomOptional;
|
||||
|
||||
@@ -163,7 +163,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Builder withProcessType( @Nonnull InscriberProcessType type )
|
||||
public Builder withProcessType( @Nonnull final InscriberProcessType type )
|
||||
{
|
||||
this.type = type;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class LocatableRegistry implements ILocatableRegistry
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void updateLocatable( LocatableEventAnnounce e )
|
||||
public void updateLocatable( final LocatableEventAnnounce e )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -64,13 +64,13 @@ public final class LocatableRegistry implements ILocatableRegistry
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Object findLocatableBySerial( long ser )
|
||||
public Object findLocatableBySerial( final long ser )
|
||||
{
|
||||
return this.set.get( ser );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILocatable getLocatableBy( long serial )
|
||||
public ILocatable getLocatableBy( final long serial )
|
||||
{
|
||||
return this.set.get( serial );
|
||||
}
|
||||
|
||||
@@ -41,15 +41,15 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAmmo( ItemStack ammo, double weight )
|
||||
public void registerAmmo( final ItemStack ammo, final double weight )
|
||||
{
|
||||
this.DamageModifiers.put( ammo, weight );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPenetration( ItemStack is )
|
||||
public float getPenetration( final ItemStack is )
|
||||
{
|
||||
for( ItemStack o : this.DamageModifiers.keySet() )
|
||||
for( final ItemStack o : this.DamageModifiers.keySet() )
|
||||
{
|
||||
if( Platform.isSameItem( o, is ) )
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oreRegistered( String name, ItemStack item )
|
||||
public void oreRegistered( final String name, final ItemStack item )
|
||||
{
|
||||
if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) )
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
this.considerItem( name, item, "Electrum", ( 107.8682 + 196.96655 ) / 2.0 );
|
||||
}
|
||||
|
||||
private void considerItem( String ore, ItemStack item, String name, double weight )
|
||||
private void considerItem( final String ore, final ItemStack item, final String name, final double weight )
|
||||
{
|
||||
if( ore.equals( "berry" + name ) || ore.equals( "nugget" + name ) )
|
||||
{
|
||||
|
||||
@@ -45,13 +45,13 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
private final IMovableHandler nullHandler = new DefaultSpatialHandler();
|
||||
|
||||
@Override
|
||||
public void blacklistBlock( Block blk )
|
||||
public void blacklistBlock( final Block blk )
|
||||
{
|
||||
this.blacklisted.add( blk );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void whiteListTileEntity( Class<? extends TileEntity> c )
|
||||
public void whiteListTileEntity( final Class<? extends TileEntity> c )
|
||||
{
|
||||
if( c.getName().equals( TileEntity.class.getName() ) )
|
||||
{
|
||||
@@ -62,9 +62,9 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean askToMove( TileEntity te )
|
||||
public boolean askToMove( final TileEntity te )
|
||||
{
|
||||
Class myClass = te.getClass();
|
||||
final Class myClass = te.getClass();
|
||||
IMovableHandler canMove = this.Valid.get( myClass );
|
||||
|
||||
if( canMove == null )
|
||||
@@ -86,12 +86,12 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
return false;
|
||||
}
|
||||
|
||||
private IMovableHandler testClass( Class myClass, TileEntity te )
|
||||
private IMovableHandler testClass( final Class myClass, final TileEntity te )
|
||||
{
|
||||
IMovableHandler handler = null;
|
||||
|
||||
// ask handlers...
|
||||
for( IMovableHandler han : this.handlers )
|
||||
for( final IMovableHandler han : this.handlers )
|
||||
{
|
||||
if( han.canHandle( myClass, te ) )
|
||||
{
|
||||
@@ -115,7 +115,7 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
}
|
||||
|
||||
// if you are on the white list your opted in.
|
||||
for( Class<? extends TileEntity> testClass : this.test )
|
||||
for( final Class<? extends TileEntity> testClass : this.test )
|
||||
{
|
||||
if( testClass.isAssignableFrom( myClass ) )
|
||||
{
|
||||
@@ -129,26 +129,26 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doneMoving( TileEntity te )
|
||||
public void doneMoving( final TileEntity te )
|
||||
{
|
||||
if( te instanceof IMovableTile )
|
||||
{
|
||||
IMovableTile mt = (IMovableTile) te;
|
||||
final IMovableTile mt = (IMovableTile) te;
|
||||
mt.doneMoving();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHandler( IMovableHandler han )
|
||||
public void addHandler( final IMovableHandler han )
|
||||
{
|
||||
this.handlers.add( han );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMovableHandler getHandler( TileEntity te )
|
||||
public IMovableHandler getHandler( final TileEntity te )
|
||||
{
|
||||
Class myClass = te.getClass();
|
||||
IMovableHandler h = this.Valid.get( myClass );
|
||||
final Class myClass = te.getClass();
|
||||
final IMovableHandler h = this.Valid.get( myClass );
|
||||
return h == null ? this.dsh : h;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class MovableTileRegistry implements IMovableRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlacklisted( Block blk )
|
||||
public boolean isBlacklisted( final Block blk )
|
||||
{
|
||||
return this.blacklisted.contains( blk );
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
this.addNewAttunement( this.getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
|
||||
this.addNewAttunement( this.getModItem( "ThermalDynamics", "ThermalDynamics_16", 0 ), TunnelType.FLUID );
|
||||
|
||||
for( AEColor c : AEColor.values() )
|
||||
for( final AEColor c : AEColor.values() )
|
||||
{
|
||||
this.addNewAttunement( parts.cableGlass().stack( c, 1 ), TunnelType.ME );
|
||||
this.addNewAttunement( parts.cableCovered().stack( c, 1 ), TunnelType.ME );
|
||||
@@ -117,7 +117,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type )
|
||||
public void addNewAttunement( @Nullable final ItemStack trigger, @Nullable final TunnelType type )
|
||||
{
|
||||
if( type == null || trigger == null )
|
||||
{
|
||||
@@ -129,7 +129,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TunnelType getTunnelTypeByItem( ItemStack trigger )
|
||||
public TunnelType getTunnelTypeByItem( final ItemStack trigger )
|
||||
{
|
||||
if( trigger != null )
|
||||
{
|
||||
@@ -138,7 +138,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
return TunnelType.FLUID;
|
||||
}
|
||||
|
||||
for( ItemStack is : this.tunnels.keySet() )
|
||||
for( final ItemStack is : this.tunnels.keySet() )
|
||||
{
|
||||
if( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE )
|
||||
{
|
||||
@@ -156,22 +156,22 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ItemStack getModItem( String modID, String name, int meta )
|
||||
private ItemStack getModItem( final String modID, final String name, final int meta )
|
||||
{
|
||||
Item item = GameRegistry.findItem( modID, name );
|
||||
final Item item = GameRegistry.findItem( modID, name );
|
||||
|
||||
if( item == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack myItemStack = new ItemStack( item, 1, meta );
|
||||
final ItemStack myItemStack = new ItemStack( item, 1, meta );
|
||||
return myItemStack;
|
||||
}
|
||||
|
||||
private void addNewAttunement( IItemDefinition definition, TunnelType type )
|
||||
private void addNewAttunement( final IItemDefinition definition, final TunnelType type )
|
||||
{
|
||||
for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.addNewAttunement( definitionStack, type );
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PlayerRegistry implements IPlayerRegistry
|
||||
{
|
||||
|
||||
@Override
|
||||
public int getID( GameProfile username )
|
||||
public int getID( final GameProfile username )
|
||||
{
|
||||
if( username == null || !username.isComplete() )
|
||||
{
|
||||
@@ -43,14 +43,14 @@ public class PlayerRegistry implements IPlayerRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID( EntityPlayer player )
|
||||
public int getID( final EntityPlayer player )
|
||||
{
|
||||
return this.getID( player.getGameProfile() );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public EntityPlayer findPlayer( int playerID )
|
||||
public EntityPlayer findPlayer( final int playerID )
|
||||
{
|
||||
return WorldData.instance().playerData().getPlayerFromID( playerID );
|
||||
}
|
||||
|
||||
@@ -46,22 +46,22 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
private final Collection<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
|
||||
|
||||
@Override
|
||||
public void addNewCraftHandler( String name, Class<? extends ICraftHandler> handler )
|
||||
public void addNewCraftHandler( final String name, final Class<? extends ICraftHandler> handler )
|
||||
{
|
||||
this.handlers.put( name.toLowerCase( Locale.ENGLISH ), handler );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNewSubItemResolver( ISubItemResolver sir )
|
||||
public void addNewSubItemResolver( final ISubItemResolver sir )
|
||||
{
|
||||
this.resolvers.add( sir );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICraftHandler getCraftHandlerFor( String name )
|
||||
public ICraftHandler getCraftHandlerFor( final String name )
|
||||
{
|
||||
Class<? extends ICraftHandler> clz = this.handlers.get( name );
|
||||
final Class<? extends ICraftHandler> clz = this.handlers.get( name );
|
||||
if( clz == null )
|
||||
{
|
||||
return null;
|
||||
@@ -70,7 +70,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
{
|
||||
return clz.newInstance();
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.severe( "Error Caused when trying to construct " + clz.getName() );
|
||||
AELog.error( e );
|
||||
@@ -89,9 +89,9 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object resolveItem( String nameSpace, String itemName )
|
||||
public Object resolveItem( final String nameSpace, final String itemName )
|
||||
{
|
||||
for( ISubItemResolver sir : this.resolvers )
|
||||
for( final ISubItemResolver sir : this.resolvers )
|
||||
{
|
||||
Object rr = null;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
{
|
||||
rr = sir.resolveItemByName( nameSpace, itemName );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
AELog.error( t );
|
||||
}
|
||||
|
||||
@@ -39,11 +39,11 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemComparison getSpecialComparison( ItemStack stack )
|
||||
public IItemComparison getSpecialComparison( final ItemStack stack )
|
||||
{
|
||||
for( IItemComparisonProvider i : this.CompRegistry )
|
||||
for( final IItemComparisonProvider i : this.CompRegistry )
|
||||
{
|
||||
IItemComparison comp = i.getComparison( stack );
|
||||
final IItemComparison comp = i.getComparison( stack );
|
||||
if( comp != null )
|
||||
{
|
||||
return comp;
|
||||
@@ -54,7 +54,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addComparisonProvider( IItemComparisonProvider prov )
|
||||
public void addComparisonProvider( final IItemComparisonProvider prov )
|
||||
{
|
||||
this.CompRegistry.add( prov );
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WirelessRangeResult
|
||||
public final float dist;
|
||||
public final TileEntity te;
|
||||
|
||||
public WirelessRangeResult( TileEntity t, float d )
|
||||
public WirelessRangeResult( final TileEntity t, final float d )
|
||||
{
|
||||
this.dist = d;
|
||||
this.te = t;
|
||||
|
||||
@@ -44,7 +44,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerWirelessHandler( IWirelessTermHandler handler )
|
||||
public void registerWirelessHandler( final IWirelessTermHandler handler )
|
||||
{
|
||||
if( handler != null )
|
||||
{
|
||||
@@ -53,9 +53,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWirelessTerminal( ItemStack is )
|
||||
public boolean isWirelessTerminal( final ItemStack is )
|
||||
{
|
||||
for( IWirelessTermHandler h : this.handlers )
|
||||
for( final IWirelessTermHandler h : this.handlers )
|
||||
{
|
||||
if( h.canHandle( is ) )
|
||||
{
|
||||
@@ -66,9 +66,9 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWirelessTermHandler getWirelessTerminalHandler( ItemStack is )
|
||||
public IWirelessTermHandler getWirelessTerminalHandler( final ItemStack is )
|
||||
{
|
||||
for( IWirelessTermHandler h : this.handlers )
|
||||
for( final IWirelessTermHandler h : this.handlers )
|
||||
{
|
||||
if( h.canHandle( is ) )
|
||||
{
|
||||
@@ -79,7 +79,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openWirelessTerminalGui( ItemStack item, World w, EntityPlayer player )
|
||||
public void openWirelessTerminalGui( final ItemStack item, final World w, final EntityPlayer player )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
|
||||
@@ -37,14 +37,14 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
|
||||
this.types = new TypeSet[WorldGenType.values().length];
|
||||
|
||||
for( WorldGenType type : WorldGenType.values() )
|
||||
for( final WorldGenType type : WorldGenType.values() )
|
||||
{
|
||||
this.types[type.ordinal()] = new TypeSet();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableWorldGenForProviderID( WorldGenType type, Class<? extends WorldProvider> provider )
|
||||
public void disableWorldGenForProviderID( final WorldGenType type, final Class<? extends WorldProvider> provider )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableWorldGenForDimension( WorldGenType type, int dimensionID )
|
||||
public void enableWorldGenForDimension( final WorldGenType type, final int dimensionID )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableWorldGenForDimension( WorldGenType type, int dimensionID )
|
||||
public void disableWorldGenForDimension( final WorldGenType type, final int dimensionID )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorldGenEnabled( WorldGenType type, World w )
|
||||
public boolean isWorldGenEnabled( final WorldGenType type, final World w )
|
||||
{
|
||||
if( type == null )
|
||||
{
|
||||
@@ -94,9 +94,9 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
throw new IllegalArgumentException( "Bad Provider Passed" );
|
||||
}
|
||||
|
||||
boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() );
|
||||
boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.getDimensionId() );
|
||||
boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.getDimensionId() );
|
||||
final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() );
|
||||
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.getDimensionId() );
|
||||
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.getDimensionId() );
|
||||
|
||||
if( isBadProvider || isBadDimension )
|
||||
{
|
||||
|
||||
@@ -37,14 +37,14 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
|
||||
private int energy;
|
||||
|
||||
public AppEngGrinderRecipe( ItemStack a, ItemStack b, int cost )
|
||||
public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final int cost )
|
||||
{
|
||||
this.in = a;
|
||||
this.out = b;
|
||||
this.energy = cost;
|
||||
}
|
||||
|
||||
public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, float chance, int cost )
|
||||
public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final float chance, final int cost )
|
||||
{
|
||||
this.in = a;
|
||||
this.out = b;
|
||||
@@ -55,7 +55,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
this.energy = cost;
|
||||
}
|
||||
|
||||
public AppEngGrinderRecipe( ItemStack a, ItemStack b, ItemStack c, ItemStack d, float chance, float chance2, int cost )
|
||||
public AppEngGrinderRecipe( final ItemStack a, final ItemStack b, final ItemStack c, final ItemStack d, final float chance, final float chance2, final int cost )
|
||||
{
|
||||
this.in = a;
|
||||
this.out = b;
|
||||
@@ -76,7 +76,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInput( ItemStack i )
|
||||
public void setInput( final ItemStack i )
|
||||
{
|
||||
this.in = i.copy();
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOutput( ItemStack o )
|
||||
public void setOutput( final ItemStack o )
|
||||
{
|
||||
this.out = o.copy();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOptionalOutput( ItemStack output, float chance )
|
||||
public void setOptionalOutput( final ItemStack output, final float chance )
|
||||
{
|
||||
this.optionalOutput = output.copy();
|
||||
this.optionalChance = chance;
|
||||
@@ -119,7 +119,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSecondOptionalOutput( ItemStack output, float chance )
|
||||
public void setSecondOptionalOutput( final ItemStack output, final float chance )
|
||||
{
|
||||
this.optionalChance2 = chance;
|
||||
this.optionalOutput2 = output.copy();
|
||||
@@ -138,7 +138,7 @@ public class AppEngGrinderRecipe implements IGrinderEntry
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyCost( int c )
|
||||
public void setEnergyCost( final int c )
|
||||
{
|
||||
this.energy = c;
|
||||
}
|
||||
|
||||
@@ -43,13 +43,13 @@ public class BasicCellHandler implements ICellHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean isCell( ItemStack is )
|
||||
public boolean isCell( final ItemStack is )
|
||||
{
|
||||
return CellInventory.isCell( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel )
|
||||
public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS )
|
||||
{
|
||||
@@ -77,26 +77,26 @@ public class BasicCellHandler implements ICellHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan )
|
||||
public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan )
|
||||
{
|
||||
Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusForCell( ItemStack is, IMEInventory handler )
|
||||
public int getStatusForCell( final ItemStack is, final IMEInventory handler )
|
||||
{
|
||||
if( handler instanceof CellInventoryHandler )
|
||||
{
|
||||
CellInventoryHandler ci = (CellInventoryHandler) handler;
|
||||
final CellInventoryHandler ci = (CellInventoryHandler) handler;
|
||||
return ci.getStatusForCell();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double cellIdleDrain( ItemStack is, IMEInventory handler )
|
||||
public double cellIdleDrain( final ItemStack is, final IMEInventory handler )
|
||||
{
|
||||
ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv();
|
||||
final ICellInventory inv = ( (ICellInventoryHandler) handler ).getCellInv();
|
||||
return inv.getIdleDrain();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ public class CreativeCellHandler implements ICellHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean isCell( ItemStack is )
|
||||
public boolean isCell( final ItemStack is )
|
||||
{
|
||||
return is != null && is.getItem() instanceof ItemCreativeStorageCell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider container, StorageChannel channel )
|
||||
public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell )
|
||||
{
|
||||
@@ -75,19 +75,19 @@ public class CreativeCellHandler implements ICellHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan )
|
||||
public void openChestGui( final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan )
|
||||
{
|
||||
Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusForCell( ItemStack is, IMEInventory handler )
|
||||
public int getStatusForCell( final ItemStack is, final IMEInventory handler )
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double cellIdleDrain( ItemStack is, IMEInventory handler )
|
||||
public double cellIdleDrain( final ItemStack is, final IMEInventory handler )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ public class ExternalIInv implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource mySrc )
|
||||
public boolean canHandle( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource mySrc )
|
||||
{
|
||||
return channel == StorageChannel.ITEMS && te instanceof IInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource src )
|
||||
public IMEInventory getInventory( final TileEntity te, final EnumFacing d, final StorageChannel channel, final BaseActionSource src )
|
||||
{
|
||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d );
|
||||
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d );
|
||||
|
||||
if( channel == StorageChannel.ITEMS && ad != null )
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ import appeng.api.features.InscriberProcessType;
|
||||
*/
|
||||
public class InscriberInscribeRecipe extends InscriberRecipe
|
||||
{
|
||||
public InscriberInscribeRecipe( @Nonnull Collection<ItemStack> inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot )
|
||||
public InscriberInscribeRecipe( @Nonnull final Collection<ItemStack> inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot )
|
||||
{
|
||||
super( inputs, output, top, bot, InscriberProcessType.Inscribe );
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class InscriberRecipe implements IInscriberRecipe
|
||||
@Nonnull
|
||||
private final InscriberProcessType type;
|
||||
|
||||
public InscriberRecipe( @Nonnull Collection<ItemStack> inputs, @Nonnull ItemStack output, @Nullable ItemStack top, @Nullable ItemStack bot, @Nonnull InscriberProcessType type )
|
||||
public InscriberRecipe( @Nonnull final Collection<ItemStack> inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot, @Nonnull final InscriberProcessType type )
|
||||
{
|
||||
this.inputs = new ArrayList<ItemStack>( inputs.size() );
|
||||
this.inputs.addAll( inputs );
|
||||
@@ -87,7 +87,7 @@ public class InscriberRecipe implements IInscriberRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o )
|
||||
public boolean equals( final Object o )
|
||||
{
|
||||
if( this == o )
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public class InscriberRecipe implements IInscriberRecipe
|
||||
return false;
|
||||
}
|
||||
|
||||
IInscriberRecipe that = (IInscriberRecipe) o;
|
||||
final IInscriberRecipe that = (IInscriberRecipe) o;
|
||||
|
||||
if( !this.inputs.equals( that.getInputs() ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user