final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
+47 -47
View File
@@ -106,7 +106,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
private double WirelessBoosterRangeMultiplier = 1;
private double WirelessBoosterExp = 1.5;
public AEConfig( File configFile )
public AEConfig( final File configFile )
{
super( configFile );
this.configFile = configFile;
@@ -123,7 +123,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
final double DEFAULT_RF_EXCHANGE = 0.5;
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
@@ -167,7 +167,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
this.clientSync();
for( AEFeature feature : AEFeature.values() )
for( final AEFeature feature : AEFeature.values() )
{
if( feature.isVisible )
{
@@ -182,10 +182,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject
}
}
ModContainer imb = net.minecraftforge.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
final ModContainer imb = net.minecraftforge.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
if( imb != null )
{
List<String> version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" );
final List<String> version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" );
if( version.contains( imb.getVersion() ) )
{
this.featureFlags.remove( AEFeature.AlphaPass );
@@ -196,12 +196,12 @@ public final class AEConfig extends Configuration implements IConfigurableObject
{
this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() );
}
catch( Throwable t )
catch( final Throwable t )
{
this.selectedPowerUnit = PowerUnits.AE;
}
for( TickRates tr : TickRates.values() )
for( final TickRates tr : TickRates.values() )
{
tr.Load( this );
}
@@ -232,11 +232,11 @@ public final class AEConfig extends Configuration implements IConfigurableObject
// load buttons..
for( int btnNum = 0; btnNum < 4; btnNum++ )
{
Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] );
Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] );
Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] );
final Property cmb = this.get( "Client", "craftAmtButton" + ( btnNum + 1 ), this.craftByStacks[btnNum] );
final Property pmb = this.get( "Client", "priorityAmtButton" + ( btnNum + 1 ), this.priorityByStacks[btnNum] );
final Property lmb = this.get( "Client", "levelAmtButton" + ( btnNum + 1 ), this.levelByStacks[btnNum] );
int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 );
final int buttonCap = (int) ( Math.pow( 10, btnNum + 1 ) - 1 );
this.craftByStacks[btnNum] = Math.abs( cmb.getInt( this.craftByStacks[btnNum] ) );
this.priorityByStacks[btnNum] = Math.abs( pmb.getInt( this.priorityByStacks[btnNum] ) );
@@ -251,18 +251,18 @@ public final class AEConfig extends Configuration implements IConfigurableObject
this.levelByStacks[btnNum] = Math.min( this.levelByStacks[btnNum], buttonCap );
}
for( Settings e : this.settings.getSettings() )
for( final Settings e : this.settings.getSettings() )
{
String Category = "Client"; // e.getClass().getSimpleName();
final String Category = "Client"; // e.getClass().getSimpleName();
Enum<?> value = this.settings.getSetting( e );
Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) );
final Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) );
try
{
value = Enum.valueOf( value.getClass(), p.getString() );
}
catch( IllegalArgumentException er )
catch( final IllegalArgumentException er )
{
AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" );
}
@@ -271,17 +271,17 @@ public final class AEConfig extends Configuration implements IConfigurableObject
}
}
private String getListComment( Enum value )
private String getListComment( final Enum value )
{
String comment = null;
if( value != null )
{
EnumSet set = EnumSet.allOf( value.getClass() );
final EnumSet set = EnumSet.allOf( value.getClass() );
for( Object Oeg : set )
for( final Object Oeg : set )
{
Enum eg = (Enum) Oeg;
final Enum eg = (Enum) Oeg;
if( comment == null )
{
comment = "Possible Values: " + eg.name();
@@ -296,30 +296,30 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return comment;
}
public boolean isFeatureEnabled( AEFeature f )
public boolean isFeatureEnabled( final AEFeature f )
{
return this.featureFlags.contains( f );
}
public double wireless_getDrainRate( double range )
public double wireless_getDrainRate( final double range )
{
return this.WirelessTerminalDrainMultiplier * range;
}
public double wireless_getMaxRange( int boosters )
public double wireless_getMaxRange( final int boosters )
{
return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp );
}
public double wireless_getPowerDrain( int boosters )
public double wireless_getPowerDrain( final int boosters )
{
return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount );
}
@Override
public Property get( String category, String key, String defaultValue, String comment, Property.Type type )
public Property get( final String category, final String key, final String defaultValue, final String comment, final Property.Type type )
{
Property prop = super.get( category, key, defaultValue, comment, type );
final Property prop = super.get( category, key, defaultValue, comment, type );
if( prop != null )
{
@@ -350,7 +350,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
}
@SubscribeEvent
public void onConfigChanged( ConfigChangedEvent.OnConfigChangedEvent eventArgs )
public void onConfigChanged( final ConfigChangedEvent.OnConfigChangedEvent eventArgs )
{
if( eventArgs.modID.equals( AppEng.MOD_ID ) )
{
@@ -368,7 +368,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return this.configFile.toString();
}
public boolean useAEVersion( MaterialType mt )
public boolean useAEVersion( final MaterialType mt )
{
if( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) )
{
@@ -376,21 +376,21 @@ public final class AEConfig extends Configuration implements IConfigurableObject
}
this.setCategoryComment( "OreCamouflage", "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." );
Property p = this.get( "OreCamouflage", mt.name(), true );
final Property p = this.get( "OreCamouflage", mt.name(), true );
p.comment = "OreDictionary Names: " + mt.getOreName();
return !p.getBoolean( true );
}
@Override
public void updateSetting( IConfigManager manager, Enum setting, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum setting, final Enum newValue )
{
for( Settings e : this.settings.getSettings() )
for( final Settings e : this.settings.getSettings() )
{
if( e == setting )
{
String Category = "Client";
Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) );
final String Category = "Client";
final Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) );
p.set( newValue.name() );
}
}
@@ -401,19 +401,19 @@ public final class AEConfig extends Configuration implements IConfigurableObject
}
}
public int getFreeMaterial( int varID )
public int getFreeMaterial( final int varID )
{
return this.getFreeIDSLot( varID, "materials" );
}
public int getFreeIDSLot( int varID, String category )
public int getFreeIDSLot( final int varID, final String category )
{
boolean alreadyUsed = false;
int min = 0;
for( Property p : this.getCategory( category ).getValues().values() )
for( final Property p : this.getCategory( category ).getValues().values() )
{
int thisInt = p.getInt();
final int thisInt = p.getInt();
if( varID == thisInt )
{
@@ -436,7 +436,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return varID;
}
public int getFreePart( int varID )
public int getFreePart( final int varID )
{
return this.getFreeIDSLot( varID, "parts" );
}
@@ -452,31 +452,31 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return this.useLargeFonts;
}
public int craftItemsByStackAmounts( int i )
public int craftItemsByStackAmounts( final int i )
{
return this.craftByStacks[i];
}
public int priorityByStacksAmounts( int i )
public int priorityByStacksAmounts( final int i )
{
return this.priorityByStacks[i];
}
public int levelByStackAmounts( int i )
public int levelByStackAmounts( final int i )
{
return this.levelByStacks[i];
}
public Enum getSetting( String category, Class<? extends Enum> class1, Enum myDefault )
public Enum getSetting( final String category, final Class<? extends Enum> class1, final Enum myDefault )
{
String name = class1.getSimpleName();
Property p = this.get( category, name, myDefault.name() );
final String name = class1.getSimpleName();
final Property p = this.get( category, name, myDefault.name() );
try
{
return (Enum) class1.getField( p.toString() ).get( class1 );
}
catch( Throwable t )
catch( final Throwable t )
{
// :{
}
@@ -484,9 +484,9 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return myDefault;
}
public void setSetting( String category, Enum s )
public void setSetting( final String category, final Enum s )
{
String name = s.getClass().getSimpleName();
final String name = s.getClass().getSimpleName();
this.get( category, name, s.name() ).set( s.name() );
this.save();
}
@@ -496,7 +496,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
return this.selectedPowerUnit;
}
public void nextPowerUnit( boolean backwards )
public void nextPowerUnit( final boolean backwards )
{
this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() );
this.save();
+9 -9
View File
@@ -39,12 +39,12 @@ public final class AELog
{
}
public static void warning( String format, Object... data )
public static void warning( final String format, final Object... data )
{
log( Level.WARN, format, data );
}
private static void log( Level level, String format, Object... data )
private static void log( final Level level, final String format, final Object... data )
{
if( AEConfig.instance == null || AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) )
{
@@ -59,7 +59,7 @@ public final class AELog
}
}
public static void grinder( String o )
public static void grinder( final String o )
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.GrinderLogging ) )
{
@@ -67,7 +67,7 @@ public final class AELog
}
}
public static void integration( Throwable exception )
public static void integration( final Throwable exception )
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.IntegrationLogging ) )
{
@@ -75,7 +75,7 @@ public final class AELog
}
}
public static void error( Throwable e )
public static void error( final Throwable e )
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) )
{
@@ -84,12 +84,12 @@ public final class AELog
}
}
public static void severe( String format, Object... data )
public static void severe( final String format, final Object... data )
{
log( Level.ERROR, format, data );
}
public static void blockUpdate( BlockPos pos, AEBaseTile aeBaseTile )
public static void blockUpdate( final BlockPos pos, final AEBaseTile aeBaseTile )
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.UpdateLogging ) )
{
@@ -97,12 +97,12 @@ public final class AELog
}
}
public static void info( String format, Object... data )
public static void info( final String format, final Object... data )
{
log( Level.INFO, format, data );
}
public static void crafting( String format, Object... data )
public static void crafting( final String format, final Object... data )
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog ) )
{
+2 -2
View File
@@ -79,7 +79,7 @@ public final class Api implements IAppEngApi
}
@Override
public IGridNode createGridNode( IGridBlock blk )
public IGridNode createGridNode( final IGridBlock blk )
{
if ( Platform.isClient() )
{
@@ -90,7 +90,7 @@ public final class Api implements IAppEngApi
}
@Override
public IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection
public IGridConnection createGridConnection( final IGridNode a, final IGridNode b ) throws FailedConnection
{
return new GridConnection( a, b, AEPartLocation.INTERNAL );
}
@@ -40,7 +40,7 @@ public final class ApiDefinitions implements IDefinitions
private final FeatureHandlerRegistry handlers;
private final FeatureRegistry features;
public ApiDefinitions( IPartHelper partHelper )
public ApiDefinitions( final IPartHelper partHelper )
{
this.features = new FeatureRegistry();
this.handlers = new FeatureHandlerRegistry();
+11 -11
View File
@@ -101,14 +101,14 @@ public final class AppEng
}
@EventHandler
private void preInit( FMLPreInitializationEvent event )
private void preInit( final FMLPreInitializationEvent event )
{
if( !Loader.isModLoaded( "appliedenergistics2-core" ) )
{
CommonHelper.proxy.missingCoreMod();
}
Stopwatch watch = Stopwatch.createStarted();
final Stopwatch watch = Stopwatch.createStarted();
this.configDirectory = new File( event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2" );
final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg" );
@@ -145,7 +145,7 @@ public final class AppEng
AELog.info( "Pre Initialization ( ended after " + watch.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
}
private void startService( String serviceName, Thread thread )
private void startService( final String serviceName, final Thread thread )
{
thread.setName( serviceName );
thread.setPriority( Thread.MIN_PRIORITY );
@@ -155,9 +155,9 @@ public final class AppEng
}
@EventHandler
private void init( FMLInitializationEvent event )
private void init( final FMLInitializationEvent event )
{
Stopwatch star = Stopwatch.createStarted();
final Stopwatch star = Stopwatch.createStarted();
AELog.info( "Initialization ( started )" );
Registration.INSTANCE.initialize( event );
@@ -168,9 +168,9 @@ public final class AppEng
}
@EventHandler
private void postInit( FMLPostInitializationEvent event )
private void postInit( final FMLPostInitializationEvent event )
{
Stopwatch star = Stopwatch.createStarted();
final Stopwatch star = Stopwatch.createStarted();
AELog.info( "Post Initialization ( started )" );
Registration.INSTANCE.postInit( event );
@@ -193,26 +193,26 @@ public final class AppEng
}
@EventHandler
private void handleIMCEvent( FMLInterModComms.IMCEvent event )
private void handleIMCEvent( final FMLInterModComms.IMCEvent event )
{
this.imcHandler.handleIMCEvent( event );
}
@EventHandler
private void serverAboutToStart( FMLServerAboutToStartEvent evt )
private void serverAboutToStart( final FMLServerAboutToStartEvent evt )
{
WorldData.onServerAboutToStart();
}
@EventHandler
private void serverStopping( FMLServerStoppingEvent event )
private void serverStopping( final FMLServerStoppingEvent event )
{
WorldData.instance().onServerStopping();
TickHandler.INSTANCE.shutdown();
}
@EventHandler
private void serverStarting( FMLServerStartingEvent evt )
private void serverStarting( final FMLServerStartingEvent evt )
{
evt.registerServerCommand( new AECommand( evt.getServer() ) );
}
+3 -3
View File
@@ -62,11 +62,11 @@ public final class CreativeTab extends CreativeTabs
return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluix(), items.cell1k(), items.networkTool(), materials.fluixCrystal(), materials.certusQuartzCrystal() );
}
private ItemStack findFirst( IItemDefinition... choices )
private ItemStack findFirst( final IItemDefinition... choices )
{
for( IItemDefinition definition : choices )
for( final IItemDefinition definition : choices )
{
for( ItemStack definitionStack : definition.maybeStack( 1 ).asSet() )
for( final ItemStack definitionStack : definition.maybeStack( 1 ).asSet() )
{
return definitionStack;
}
+7 -7
View File
@@ -36,23 +36,23 @@ public class FacadeConfig extends Configuration
public static FacadeConfig instance;
final Pattern replacementPattern;
public FacadeConfig( File facadeFile )
public FacadeConfig( final File facadeFile )
{
super( facadeFile );
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
}
public boolean checkEnabled( Block id, int metadata, boolean automatic )
public boolean checkEnabled( final Block id, final int metadata, final boolean automatic )
{
if( id == null )
{
return false;
}
UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id );
final UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id );
if( blk == null )
{
for( Field f : Block.class.getFields() )
for( final Field f : Block.class.getFields() )
{
try
{
@@ -61,7 +61,7 @@ public class FacadeConfig extends Configuration
return this.get( "minecraft", f.getName() + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic );
}
}
catch( Throwable e )
catch( final Throwable e )
{
// :P
}
@@ -69,8 +69,8 @@ public class FacadeConfig extends Configuration
}
else
{
Matcher mod = this.replacementPattern.matcher( blk.modId );
Matcher name = this.replacementPattern.matcher( blk.name );
final Matcher mod = this.replacementPattern.matcher( blk.modId );
final Matcher name = this.replacementPattern.matcher( blk.name );
return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic );
}
@@ -29,7 +29,7 @@ public final class FeatureHandlerRegistry
{
private final Set<IFeatureHandler> registry = new LinkedHashSet<IFeatureHandler>();
public void addFeatureHandler( IFeatureHandler feature )
public void addFeatureHandler( final IFeatureHandler feature )
{
this.registry.add( feature );
}
@@ -29,7 +29,7 @@ public final class FeatureRegistry
{
private final Set<IAEFeature> registry = new LinkedHashSet<IAEFeature>();
public void addFeature( IAEFeature feature )
public void addFeature( final IAEFeature feature )
{
this.registry.add( feature );
}
+4 -4
View File
@@ -63,7 +63,7 @@ public class IMCHandler
this.processors.put( "add-grindable", new IMCGrinder() );
this.processors.put( "add-mattercannon-ammo", new IMCMatterCannon() );
for( TunnelType type : TunnelType.values() )
for( final TunnelType type : TunnelType.values() )
{
this.processors.put( "add-p2p-attunement-" + type.name().replace( '_', '-' ).toLowerCase( Locale.ENGLISH ), new IMCP2PAttunement() );
}
@@ -74,9 +74,9 @@ public class IMCHandler
*
* @param event Event carrying the identifier and message for the handlers
*/
public void handleIMCEvent( FMLInterModComms.IMCEvent event )
public void handleIMCEvent( final FMLInterModComms.IMCEvent event )
{
for( FMLInterModComms.IMCMessage message : event.getMessages() )
for( final FMLInterModComms.IMCMessage message : event.getMessages() )
{
final String key = message.key;
@@ -92,7 +92,7 @@ public class IMCHandler
throw new IllegalStateException( "Invalid IMC Called: " + key );
}
}
catch( Exception t )
catch( final Exception t )
{
AELog.warning( "Problem detected when processing IMC " + key + " from " + message.getSender() );
AELog.error( t );
+3 -3
View File
@@ -51,7 +51,7 @@ public class RecipeLoader implements Runnable
*
* @throws NullPointerException if handler is <tt>null</tt>
*/
public RecipeLoader( @Nonnull IRecipeHandler handler )
public RecipeLoader( @Nonnull final IRecipeHandler handler )
{
Preconditions.checkNotNull( handler );
@@ -86,12 +86,12 @@ public class RecipeLoader implements Runnable
this.handler.parseRecipes( new ConfigLoader( generatedRecipesDir, userRecipesDir ), "index.recipe" );
}
// on failure use jar parsing
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
}
catch( URISyntaxException e )
catch( final URISyntaxException e )
{
AELog.error( e );
this.handler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
+20 -20
View File
@@ -119,12 +119,12 @@ public final class Registration
this.recipeHandler = new RecipeHandler();
}
public void preInitialize( FMLPreInitializationEvent event )
public void preInitialize( final FMLPreInitializationEvent event )
{
this.registerSpatial( false );
final Api api = Api.INSTANCE;
IRecipeHandlerRegistry recipeRegistry = api.registries().recipes();
final IRecipeHandlerRegistry recipeRegistry = api.registries().recipes();
this.registerCraftHandlers( recipeRegistry );
RecipeSorter.register( "AE2-Facade", FacadeRecipe.class, Category.SHAPED, "" );
@@ -136,25 +136,25 @@ public final class Registration
final ApiDefinitions definitions = api.definitions();
// Register all detected handlers and features (items, blocks) in pre-init
for( IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() )
for( final IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() )
{
handler.register(event.getSide() );
}
for( IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() )
for( final IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() )
{
feature.postInit();
}
}
private void registerSpatial( boolean force )
private void registerSpatial( final boolean force )
{
if( !AEConfig.instance.isFeatureEnabled( AEFeature.SpatialIO ) )
{
return;
}
AEConfig config = AEConfig.instance;
final AEConfig config = AEConfig.instance;
if( this.storageBiome == null )
{
@@ -194,7 +194,7 @@ public final class Registration
}
}
private void registerCraftHandlers( IRecipeHandlerRegistry registry )
private void registerCraftHandlers( final IRecipeHandlerRegistry registry )
{
registry.addNewSubItemResolver( new AEItemResolver() );
@@ -215,7 +215,7 @@ public final class Registration
registry.addNewCraftHandler( "shapeless", Shapeless.class );
}
public void initialize( FMLInitializationEvent event )
public void initialize( final FMLInitializationEvent event )
{
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
@@ -251,11 +251,11 @@ public final class Registration
FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE );
MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE );
PartPlacement pp = new PartPlacement();
final PartPlacement pp = new PartPlacement();
MinecraftForge.EVENT_BUS.register( pp );
FMLCommonHandler.instance().bus().register( pp );
IGridCacheRegistry gcr = registries.gridCache();
final IGridCacheRegistry gcr = registries.gridCache();
gcr.registerGridCache( ITickManager.class, TickManagerCache.class );
gcr.registerGridCache( IEnergyGrid.class, EnergyGridCache.class );
gcr.registerGridCache( IPathingGrid.class, PathGridCache.class );
@@ -270,7 +270,7 @@ public final class Registration
registries.cell().addCellHandler( new BasicCellHandler() );
registries.cell().addCellHandler( new CreativeCellHandler() );
for( ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() )
for( final ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack( 1 ).asSet() )
{
final double weight = 32;
@@ -296,7 +296,7 @@ public final class Registration
}
}
public void postInit( FMLPostInitializationEvent event )
public void postInit( final FMLPostInitializationEvent event )
{
this.registerSpatial( true );
@@ -315,7 +315,7 @@ public final class Registration
GuiText.values();
Api.INSTANCE.partHelper().initFMPSupport();
for( Block block : blocks.multiPart().maybeBlock().asSet() )
for( final Block block : blocks.multiPart().maybeBlock().asSet() )
{
( (BlockCableBus) block ).setupTile();
}
@@ -385,22 +385,22 @@ public final class Registration
// Inscriber
Upgrades.SPEED.registerItem( blocks.inscriber(), 3 );
for( Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() )
for( final Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet() )
{
registries.wireless().registerWirelessHandler( (IWirelessTermHandler) wirelessTerminalItem );
}
if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
{
ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
final ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
final IMaterials materials = definitions.materials();
for( ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() )
for( final ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() )
{
d.addItem( new WeightedRandomChestContent( crystal, 1, 4, 2 ) );
}
for( ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() )
for( final ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() )
{
d.addItem( new WeightedRandomChestContent( dust, 1, 4, 2 ) );
}
@@ -423,7 +423,7 @@ public final class Registration
GameRegistry.registerWorldGenerator( new MeteoriteWorldGen(), 0 );
}
IMovableRegistry mr = registries.movable();
final IMovableRegistry mr = registries.movable();
/**
* You can't move bed rock.
@@ -461,7 +461,7 @@ public final class Registration
/**
* world gen
*/
for( WorldGenType type : WorldGenType.values() )
for( final WorldGenType type : WorldGenType.values() )
{
registries.worldgen().disableWorldGenForProviderID( type, StorageWorldProvider.class );
@@ -473,7 +473,7 @@ public final class Registration
}
// whitelist from config
for( int dimension : AEConfig.instance.meteoriteDimensionWhitelist )
for( final int dimension : AEConfig.instance.meteoriteDimensionWhitelist )
{
registries.worldgen().enableWorldGenForDimension( WorldGenType.Meteorites, dimension );
}
+46 -46
View File
@@ -71,7 +71,7 @@ public class ApiPart implements IPartHelper
public void initFMPSupport()
{
for( Class layerInterface : this.interfaces2Layer.keySet() )
for( final Class layerInterface : this.interfaces2Layer.keySet() )
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{
@@ -80,7 +80,7 @@ public class ApiPart implements IPartHelper
}
}
public Class getCombinedInstance( String base )
public Class getCombinedInstance( final String base )
{
if( this.desc.isEmpty() )
{
@@ -88,13 +88,13 @@ public class ApiPart implements IPartHelper
{
return Class.forName( base );
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
throw new IllegalStateException( e );
}
}
String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() );
final String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() );
if( this.tileImplementations.get( description ) != null )
{
@@ -107,7 +107,7 @@ public class ApiPart implements IPartHelper
{
Addendum = Class.forName( base ).getSimpleName();
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
AELog.error( e );
}
@@ -117,22 +117,22 @@ public class ApiPart implements IPartHelper
{
myCLass = Class.forName( f );
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
throw new IllegalStateException( e );
}
String path = f;
for( String name : this.desc )
for( final String name : this.desc )
{
try
{
String newPath = path + ';' + name;
final String newPath = path + ';' + name;
myCLass = this.getClassByDesc( Addendum, newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) );
path = newPath;
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.warning( "Error loading " + name );
AELog.error( t );
@@ -146,51 +146,51 @@ public class ApiPart implements IPartHelper
return myCLass;
}
public Class getClassByDesc( String addendum, String fullPath, String root, String next )
public Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next )
{
if( this.roots.get( fullPath ) != null )
{
return this.roots.get( fullPath );
}
ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
ClassNode n = this.getReader( next );
String originalName = n.name;
final ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
final ClassNode n = this.getReader( next );
final String originalName = n.name;
try
{
n.name = n.name + '_' + addendum;
n.superName = Class.forName( root ).getName().replace( ".", "/" );
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.error( t );
}
for( MethodNode mn : n.methods )
for( final MethodNode mn : n.methods )
{
Iterator<AbstractInsnNode> i = mn.instructions.iterator();
final Iterator<AbstractInsnNode> i = mn.instructions.iterator();
while( i.hasNext() )
{
this.processNode( i.next(), n.superName );
}
}
DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper();
final DefaultPackageClassNameRemapper remapper = new DefaultPackageClassNameRemapper();
remapper.inputOutput.put( "appeng/api/parts/LayerBase", n.superName );
remapper.inputOutput.put( originalName, n.name );
n.accept( new RemappingClassAdapter( cw, remapper ) );
// n.accept( cw );
// n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) );
byte[] byteArray = cw.toByteArray();
int size = byteArray.length;
Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray );
final byte[] byteArray = cw.toByteArray();
final int size = byteArray.length;
final Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray );
try
{
Object fish = clazz.newInstance();
Class rootC = Class.forName( root );
final Object fish = clazz.newInstance();
final Class rootC = Class.forName( root );
boolean hasError = false;
@@ -226,7 +226,7 @@ public class ApiPart implements IPartHelper
AELog.info( "Layer: " + n.name + " loaded successfully - " + size + " bytes" );
}
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.severe( "Layer: " + n.name + " Failed." );
AELog.error( t );
@@ -236,30 +236,30 @@ public class ApiPart implements IPartHelper
return clazz;
}
public ClassNode getReader( String name )
public ClassNode getReader( final String name )
{
String path = '/' + name.replace( ".", "/" ) + ".class";
InputStream is = this.getClass().getResourceAsStream( path );
final String path = '/' + name.replace( ".", "/" ) + ".class";
final InputStream is = this.getClass().getResourceAsStream( path );
try
{
ClassReader cr = new ClassReader( is );
final ClassReader cr = new ClassReader( is );
ClassNode cn = new ClassNode();
final ClassNode cn = new ClassNode();
cr.accept( cn, ClassReader.EXPAND_FRAMES );
return cn;
}
catch( IOException e )
catch( final IOException e )
{
throw new IllegalStateException( "Error loading " + name, e );
}
}
private void processNode( AbstractInsnNode next, String nePar )
private void processNode( final AbstractInsnNode next, final String nePar )
{
if( next instanceof MethodInsnNode )
{
MethodInsnNode min = (MethodInsnNode) next;
final MethodInsnNode min = (MethodInsnNode) next;
if( min.owner.equals( "appeng/api/parts/LayerBase" ) )
{
min.owner = nePar;
@@ -267,26 +267,26 @@ public class ApiPart implements IPartHelper
}
}
private Class loadClass( String name, byte[] b )
private Class loadClass( final String name, byte[] b )
{
// override classDefine (as it is protected) and define the class.
Class clazz = null;
try
{
ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader();
Class<ClassLoader> root = ClassLoader.class;
Class<? extends ClassLoader> cls = loader.getClass();
Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class );
Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class );
final ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader();
final Class<ClassLoader> root = ClassLoader.class;
final Class<? extends ClassLoader> cls = loader.getClass();
final Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class );
final Method runTransformersMethod = cls.getDeclaredMethod( "runTransformers", String.class, String.class, byte[].class );
runTransformersMethod.setAccessible( true );
defineClassMethod.setAccessible( true );
try
{
Object[] argsA = { name, name, b };
final Object[] argsA = { name, name, b };
b = (byte[]) runTransformersMethod.invoke( loader, argsA );
Object[] args = { name, b, 0, b.length };
final Object[] args = { name, b, 0, b.length };
clazz = (Class) defineClassMethod.invoke( loader, args );
}
finally
@@ -295,7 +295,7 @@ public class ApiPart implements IPartHelper
defineClassMethod.setAccessible( false );
}
}
catch( Exception e )
catch( final Exception e )
{
AELog.error( e );
throw new IllegalStateException( "Unable to manage part API.", e );
@@ -304,7 +304,7 @@ public class ApiPart implements IPartHelper
}
@Override
public boolean registerNewLayer( String layer, String layerInterface )
public boolean registerNewLayer( final String layer, final String layerInterface )
{
try
{
@@ -320,7 +320,7 @@ public class ApiPart implements IPartHelper
AELog.info( "Layer " + layer + " not registered, " + layerInterface + " already has a layer." );
}
}
catch( Throwable ignored )
catch( final Throwable ignored )
{
}
@@ -328,7 +328,7 @@ public class ApiPart implements IPartHelper
}
@Override
public void setItemBusRenderer( IPartItem i )
public void setItemBusRenderer( final IPartItem i )
{
if( Platform.isClient() && i instanceof Item )
{
@@ -338,7 +338,7 @@ public class ApiPart implements IPartHelper
}
@Override
public boolean placeBus( ItemStack is, BlockPos pos, EnumFacing side, EntityPlayer player, World w )
public boolean placeBus( final ItemStack is, final BlockPos pos, final EnumFacing side, final EntityPlayer player, final World w )
{
return PartPlacement.place( is, pos, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 );
}
@@ -355,9 +355,9 @@ public class ApiPart implements IPartHelper
public final HashMap<String, String> inputOutput = new HashMap<String, String>();
@Override
public String map( String typeName )
public String map( final String typeName )
{
String o = this.inputOutput.get( typeName );
final String o = this.inputOutput.get( typeName );
if( o == null )
{
return typeName;
@@ -47,19 +47,19 @@ public class ApiStorage implements IStorageHelper
{
@Override
public ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req )
public ICraftingLink loadCraftingLink( final NBTTagCompound data, final ICraftingRequester req )
{
return new CraftingLink( data, req );
}
@Override
public IAEItemStack createItemStack( ItemStack is )
public IAEItemStack createItemStack( final ItemStack is )
{
return AEItemStack.create( is );
}
@Override
public IAEFluidStack createFluidStack( FluidStack is )
public IAEFluidStack createFluidStack( final FluidStack is )
{
return AEFluidStack.create( is );
}
@@ -77,25 +77,25 @@ public class ApiStorage implements IStorageHelper
}
@Override
public IAEItemStack readItemFromPacket( ByteBuf input ) throws IOException
public IAEItemStack readItemFromPacket( final ByteBuf input ) throws IOException
{
return AEItemStack.loadItemStackFromPacket( input );
}
@Override
public IAEFluidStack readFluidFromPacket( ByteBuf input ) throws IOException
public IAEFluidStack readFluidFromPacket( final ByteBuf input ) throws IOException
{
return AEFluidStack.loadFluidStackFromPacket( input );
}
@Override
public IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack request, BaseActionSource src )
public IAEItemStack poweredExtraction( final IEnergySource energy, final IMEInventory<IAEItemStack> cell, final IAEItemStack request, final BaseActionSource src )
{
return Platform.poweredExtraction( energy, cell, request, src );
}
@Override
public IAEItemStack poweredInsert( IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack input, BaseActionSource src )
public IAEItemStack poweredInsert( final IEnergySource energy, final IMEInventory<IAEItemStack> cell, final IAEItemStack input, final BaseActionSource src )
{
return Platform.poweredInsert( energy, cell, input, src );
}
@@ -159,7 +159,7 @@ public final class ApiBlocks implements IBlocks
private final IBlockDefinition phantomNode;
private final IBlockDefinition cubeGenerator;
public ApiBlocks( DefinitionConstructor constructor )
public ApiBlocks( final DefinitionConstructor constructor )
{
// this.quartzOre = new BlockDefinition( "ore.quartz", new OreQuartz() );
this.quartzOre = constructor.registerBlockDefinition( new QuartzOreBlock() );
@@ -242,9 +242,9 @@ public final class ApiBlocks implements IBlocks
this.cubeGenerator = constructor.registerBlockDefinition( new BlockCubeGenerator() );
}
private IBlockDefinition makeStairs( DefinitionConstructor constructor, IBlockDefinition definition, String name )
private IBlockDefinition makeStairs( final DefinitionConstructor constructor, final IBlockDefinition definition, final String name )
{
for( Block block : definition.maybeBlock().asSet() )
for( final Block block : definition.maybeBlock().asSet() )
{
return constructor.registerBlockDefinition( new BlockStairCommon( block, name ) );
}
@@ -113,7 +113,7 @@ public final class ApiItems implements IItems
private final IItemDefinition toolDebugCard;
private final IItemDefinition toolReplicatorCard;
public ApiItems( DefinitionConstructor constructor )
public ApiItems( final DefinitionConstructor constructor )
{
this.certusQuartzAxe = constructor.registerItemDefinition( new ToolQuartzAxe( AEFeature.CertusQuartzTools ) );
this.certusQuartzHoe = constructor.registerItemDefinition( new ToolQuartzHoe( AEFeature.CertusQuartzTools ) );
@@ -103,7 +103,7 @@ public final class ApiMaterials implements IMaterials
private final IItemDefinition qESingularity;
private final IItemDefinition blankPattern;
public ApiMaterials( DefinitionConstructor constructor )
public ApiMaterials( final DefinitionConstructor constructor )
{
final MultiItem materials = new MultiItem();
constructor.registerItemDefinition( materials );
@@ -73,7 +73,7 @@ public final class ApiParts implements IParts
private final IItemDefinition storageMonitor;
private final IItemDefinition conversionMonitor;
public ApiParts( DefinitionConstructor constructor, IPartHelper partHelper )
public ApiParts( final DefinitionConstructor constructor, final IPartHelper partHelper )
{
final ItemMultiPart itemMultiPart = new ItemMultiPart( partHelper );
constructor.registerItemDefinition( itemMultiPart );
@@ -41,13 +41,13 @@ public class DefinitionConstructor
private final FeatureRegistry features;
private final FeatureHandlerRegistry handlers;
public DefinitionConstructor( FeatureRegistry features, FeatureHandlerRegistry handlers )
public DefinitionConstructor( final FeatureRegistry features, final FeatureHandlerRegistry handlers )
{
this.features = features;
this.handlers = handlers;
}
public final ITileDefinition registerTileDefinition( IAEFeature feature )
public final ITileDefinition registerTileDefinition( final IAEFeature feature )
{
final IBlockDefinition definition = this.registerBlockDefinition( feature );
@@ -59,7 +59,7 @@ public class DefinitionConstructor
throw new IllegalStateException( "No tile definition for " + feature );
}
public final IBlockDefinition registerBlockDefinition( IAEFeature feature )
public final IBlockDefinition registerBlockDefinition( final IAEFeature feature )
{
final IItemDefinition definition = this.registerItemDefinition( feature );
@@ -71,7 +71,7 @@ public class DefinitionConstructor
throw new IllegalStateException( "No block definition for " + feature );
}
public final IItemDefinition registerItemDefinition( IAEFeature feature )
public final IItemDefinition registerItemDefinition( final IAEFeature feature )
{
final IFeatureHandler handler = feature.handler();
@@ -86,13 +86,13 @@ public class DefinitionConstructor
return definition;
}
public final AEColoredItemDefinition constructColoredDefinition( IItemDefinition target, int offset )
public final AEColoredItemDefinition constructColoredDefinition( final IItemDefinition target, final int offset )
{
final ColoredItemDefinition definition = new ColoredItemDefinition();
for( Item targetItem : target.maybeItem().asSet() )
for( final Item targetItem : target.maybeItem().asSet() )
{
for( AEColor color : AEColor.VALID_COLORS )
for( final AEColor color : AEColor.VALID_COLORS )
{
final ActivityState state = ActivityState.from( target.isEnabled() );
@@ -103,11 +103,11 @@ public class DefinitionConstructor
return definition;
}
public final AEColoredItemDefinition constructColoredDefinition( ItemMultiPart target, PartType type )
public final AEColoredItemDefinition constructColoredDefinition( final ItemMultiPart target, final PartType type )
{
final ColoredItemDefinition definition = new ColoredItemDefinition();
for( AEColor color : AEColor.values() )
for( final AEColor color : AEColor.values() )
{
final ItemStackSrc multiPartSource = target.createPart( type, color );
@@ -31,13 +31,13 @@ public class IMCBlackListSpatial implements IIMCProcessor
{
@Override
public void process( IMCMessage m )
public void process( final IMCMessage m )
{
ItemStack is = m.getItemStackValue();
final ItemStack is = m.getItemStackValue();
if( is != null )
{
Block blk = Block.getBlockFromItem( is.getItem() );
final Block blk = Block.getBlockFromItem( is.getItem() );
if( blk != null )
{
AEApi.instance().registries().movable().blacklistBlock( blk );
@@ -63,16 +63,16 @@ import appeng.core.api.IIMCProcessor;
public class IMCGrinder implements IIMCProcessor
{
@Override
public void process( IMCMessage m )
public void process( final IMCMessage m )
{
NBTTagCompound msg = m.getNBTValue();
NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" );
NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" );
final NBTTagCompound msg = m.getNBTValue();
final NBTTagCompound inTag = (NBTTagCompound) msg.getTag( "in" );
final NBTTagCompound outTag = (NBTTagCompound) msg.getTag( "out" );
ItemStack in = ItemStack.loadItemStackFromNBT( inTag );
ItemStack out = ItemStack.loadItemStackFromNBT( outTag );
final ItemStack in = ItemStack.loadItemStackFromNBT( inTag );
final ItemStack out = ItemStack.loadItemStackFromNBT( outTag );
int turns = msg.getInteger( "turns" );
final int turns = msg.getInteger( "turns" );
if( in == null )
{
@@ -86,15 +86,15 @@ public class IMCGrinder implements IIMCProcessor
if( msg.hasKey( "optional" ) )
{
NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" );
ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag );
final NBTTagCompound optionalTag = (NBTTagCompound) msg.getTag( "optional" );
final ItemStack optional = ItemStack.loadItemStackFromNBT( optionalTag );
if( optional == null )
{
throw new IllegalStateException( "invalid optional" );
}
float chance = msg.getFloat( "chance" );
final float chance = msg.getFloat( "chance" );
AEApi.instance().registries().grinder().addRecipe( in, out, optional, chance, turns );
}
@@ -43,13 +43,13 @@ public class IMCMatterCannon implements IIMCProcessor
{
@Override
public void process( IMCMessage m )
public void process( final IMCMessage m )
{
NBTTagCompound msg = m.getNBTValue();
NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" );
final NBTTagCompound msg = m.getNBTValue();
final NBTTagCompound item = (NBTTagCompound) msg.getTag( "item" );
ItemStack ammo = ItemStack.loadItemStackFromNBT( item );
double weight = msg.getDouble( "weight" );
final ItemStack ammo = ItemStack.loadItemStackFromNBT( item );
final double weight = msg.getDouble( "weight" );
if( ammo == null )
{
@@ -44,15 +44,15 @@ public class IMCP2PAttunement implements IIMCProcessor
{
@Override
public void process( IMCMessage m )
public void process( final IMCMessage m )
{
String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH );
final String key = m.key.substring( "add-p2p-attunement-".length() ).replace( '-', '_' ).toUpperCase( Locale.ENGLISH );
TunnelType type = TunnelType.valueOf( key );
final TunnelType type = TunnelType.valueOf( key );
if( type != null )
{
ItemStack is = m.getItemStackValue();
final ItemStack is = m.getItemStackValue();
if( is != null )
{
AEApi.instance().registries().p2pTunnel().addNewAttunement( is, type );
@@ -35,15 +35,15 @@ public class IMCSpatial implements IIMCProcessor
{
@Override
public void process( IMCMessage m )
public void process( final IMCMessage m )
{
try
{
Class classInstance = Class.forName( m.getStringValue() );
final Class classInstance = Class.forName( m.getStringValue() );
AEApi.instance().registries().movable().whiteListTileEntity( classInstance );
}
catch( ClassNotFoundException e )
catch( final ClassNotFoundException e )
{
AELog.info( "Bad Class Registered: " + m.getStringValue() + " by " + m.getSender() );
}
@@ -27,7 +27,7 @@ abstract class BaseCrashEnhancement implements ICrashCallable
private final String name;
private final String value;
public BaseCrashEnhancement( String name, String value )
public BaseCrashEnhancement( final String name, final String value )
{
this.name = name;
this.value = value;
@@ -12,7 +12,7 @@ public class ModCrashEnhancement extends BaseCrashEnhancement
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion;
public ModCrashEnhancement( CrashInfo output )
public ModCrashEnhancement( final CrashInfo output )
{
super( "AE2 Version", MOD_VERSION );
}
@@ -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() ) )
{
@@ -72,7 +72,7 @@ public enum ButtonToolTips
this.root = "gui.tooltips.appliedenergistics2";
}
ButtonToolTips( String r )
ButtonToolTips( final String r )
{
this.root = r;
}
@@ -90,7 +90,7 @@ public enum GuiText
this.root = "gui.appliedenergistics2";
}
GuiText( String r )
GuiText( final String r )
{
this.root = r;
}
@@ -39,7 +39,7 @@ public enum WailaText
this.root = "waila.appliedenergistics2";
}
WailaText( String r )
WailaText( final String r )
{
this.root = r;
}
@@ -54,13 +54,13 @@ public enum TickRates
public int min;
public int max;
TickRates( int min, int max )
TickRates( final int min, final int max )
{
this.min = min;
this.max = max;
}
public void Load( AEConfig config )
public void Load( final AEConfig config )
{
config.addCustomCategoryComment( "TickRates", " Min / Max Tickrates for dynamic ticking, most of these components also use sleeping, to prevent constant ticking, adjust with care, non standard rates are not supported or tested." );
this.min = config.get( "TickRates", this.name() + ".min", this.min ).getInt( this.min );
@@ -35,20 +35,20 @@ public class AchievementCraftingHandler
{
private final PlayerDifferentiator differentiator;
public AchievementCraftingHandler( PlayerDifferentiator differentiator )
public AchievementCraftingHandler( final PlayerDifferentiator differentiator )
{
this.differentiator = differentiator;
}
@SubscribeEvent
public void onPlayerCraftingEvent( PlayerEvent.ItemCraftedEvent event )
public void onPlayerCraftingEvent( final PlayerEvent.ItemCraftedEvent event )
{
if( this.differentiator.isNoPlayer( event.player ) || event.crafting == null )
{
return;
}
for( Achievements achievement : Achievements.values() )
for( final Achievements achievement : Achievements.values() )
{
switch( achievement.type )
{
@@ -36,22 +36,22 @@ public class AchievementPickupHandler
{
private final PlayerDifferentiator differentiator;
public AchievementPickupHandler( PlayerDifferentiator differentiator )
public AchievementPickupHandler( final PlayerDifferentiator differentiator )
{
this.differentiator = differentiator;
}
@SubscribeEvent
public void onItemPickUp( PlayerEvent.ItemPickupEvent event )
public void onItemPickUp( final PlayerEvent.ItemPickupEvent event )
{
if( this.differentiator.isNoPlayer( event.player ) || event.pickedUp == null || event.pickedUp.getEntityItem() == null )
{
return;
}
ItemStack is = event.pickedUp.getEntityItem();
final ItemStack is = event.pickedUp.getEntityItem();
for( Achievements achievement : Achievements.values() )
for( final Achievements achievement : Achievements.values() )
{
if( achievement.type == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.stack, is ) )
{
@@ -113,7 +113,7 @@ public enum Achievements
private Achievement parent;
private Achievement stat;
Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type )
Achievements( final int x, final int y, final AEColoredItemDefinition which, final AchievementType type )
{
this.stack = ( which != null ) ? which.stack( AEColor.Transparent, 1 ) : null;
this.type = type;
@@ -121,7 +121,7 @@ public enum Achievements
this.y = y;
}
Achievements( int x, int y, IItemDefinition which, AchievementType type )
Achievements( final int x, final int y, final IItemDefinition which, final AchievementType type )
{
this.stack = which.maybeStack( 1 ).orNull();
this.type = type;
@@ -129,7 +129,7 @@ public enum Achievements
this.y = y;
}
Achievements( int x, int y, ItemStack which, AchievementType type )
Achievements( final int x, final int y, final ItemStack which, final AchievementType type )
{
this.stack = which;
this.type = type;
@@ -137,7 +137,7 @@ public enum Achievements
this.y = y;
}
public void setParent( Achievements parent )
public void setParent( final Achievements parent )
{
this.parent = parent.getAchievement();
}
@@ -153,7 +153,7 @@ public enum Achievements
return this.stat;
}
public void addToPlayer( EntityPlayer player )
public void addToPlayer( final EntityPlayer player )
{
player.addStat( this.getAchievement(), 1 );
}
@@ -42,7 +42,7 @@ public class PlayerDifferentiator
*
* @return true if {@param player} is not a real player
*/
public boolean isNoPlayer( EntityPlayer player )
public boolean isNoPlayer( final EntityPlayer player )
{
return player == null || player.isDead || player instanceof FakePlayer;
}
@@ -51,7 +51,7 @@ public class PlayerStatsRegistration
* @param bus {@see #bus}
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
*/
public PlayerStatsRegistration( EventBus bus, AEConfig config )
public PlayerStatsRegistration( final EventBus bus, final AEConfig config )
{
this.bus = bus;
this.isAchievementFeatureEnabled = config.isFeatureEnabled( AEFeature.Achievements );
@@ -83,7 +83,7 @@ public class PlayerStatsRegistration
final AchievementHierarchy hierarchy = new AchievementHierarchy();
hierarchy.registerAchievementHierarchy();
for( Stats s : Stats.values() )
for( final Stats s : Stats.values() )
{
s.getStat();
}
@@ -91,18 +91,18 @@ public class PlayerStatsRegistration
/**
* register
*/
ArrayList<Achievement> list = new ArrayList<Achievement>();
final ArrayList<Achievement> list = new ArrayList<Achievement>();
for( Achievements a : Achievements.values() )
for( final Achievements a : Achievements.values() )
{
Achievement ach = a.getAchievement();
final Achievement ach = a.getAchievement();
if( ach != null )
{
list.add( ach );
}
}
AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) );
final AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) );
AchievementPage.registerAchievementPage( ae2AchievementPage );
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ public enum Stats
{
}
public void addToPlayer( EntityPlayer player, int howMany )
public void addToPlayer( final EntityPlayer player, final int howMany )
{
player.addStat( this.getStat(), howMany );
}
@@ -41,7 +41,7 @@ public abstract class AppEngPacket implements Packet
AppEngPacketHandlerBase.PacketTypes id;
private PacketBuffer p;
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
}
@@ -51,12 +51,12 @@ public abstract class AppEngPacket implements Packet
return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal();
}
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." );
}
protected void configureWrite( ByteBuf data )
protected void configureWrite( final ByteBuf data )
{
data.capacity( data.readableBytes() );
this.p = new PacketBuffer(data);
@@ -69,7 +69,7 @@ public abstract class AppEngPacket implements Packet
throw new IllegalArgumentException( "Sorry AE2 made a " + this.p.array().length + " byte packet by accident!" );
}
FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() );
final FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() );
if( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) )
{
@@ -80,23 +80,23 @@ public abstract class AppEngPacket implements Packet
}
@Override
public void readPacketData(PacketBuffer buf) throws IOException
public void readPacketData( final PacketBuffer buf) throws IOException
{
throw new RuntimeException( "Not Implemented" );
}
@Override
public void writePacketData(PacketBuffer buf) throws IOException
public void writePacketData( final PacketBuffer buf) throws IOException
{
throw new RuntimeException( "Not Implemented" );
}
PacketCallState caller;
public void setCallParam( PacketCallState call ){caller = call;}
public void setCallParam( final PacketCallState call ){caller = call;}
@Override
public void processPacket(INetHandler handler)
public void processPacket( final INetHandler handler)
{
caller.call(this);
}
@@ -110,7 +110,7 @@ public class AppEngPacketHandlerBase
private final Class<? extends AppEngPacket> packetClass;
private final Constructor<? extends AppEngPacket> packetConstructor;
PacketTypes( Class<? extends AppEngPacket> c )
PacketTypes( final Class<? extends AppEngPacket> c )
{
this.packetClass = c;
@@ -119,10 +119,10 @@ public class AppEngPacketHandlerBase
{
x = this.packetClass.getConstructor( ByteBuf.class );
}
catch( NoSuchMethodException ignored )
catch( final NoSuchMethodException ignored )
{
}
catch( SecurityException ignored )
catch( final SecurityException ignored )
{
}
@@ -135,17 +135,17 @@ public class AppEngPacketHandlerBase
}
}
public static PacketTypes getPacket( int id )
public static PacketTypes getPacket( final int id )
{
return ( values() )[id];
}
public static PacketTypes getID( Class<? extends AppEngPacket> c )
public static PacketTypes getID( final Class<? extends AppEngPacket> c )
{
return REVERSE_LOOKUP.get( c );
}
public AppEngPacket parsePacket( ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
public AppEngPacket parsePacket( final ByteBuf in ) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
{
return this.packetConstructor.newInstance( in );
}
+53 -53
View File
@@ -203,7 +203,7 @@ public enum GuiBridge implements IGuiHandler
this.containerClass = null;
}
GuiBridge( Class containerClass, SecurityPermissions requiredPermission )
GuiBridge( final Class containerClass, final SecurityPermissions requiredPermission )
{
this.requiredPermission = requiredPermission;
this.containerClass = containerClass;
@@ -220,7 +220,7 @@ public enum GuiBridge implements IGuiHandler
if( Platform.isClient() )
{
final String start = this.containerClass.getName();
String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
final String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
if( start.equals( guiClass ) )
{
@@ -234,7 +234,7 @@ public enum GuiBridge implements IGuiHandler
}
}
GuiBridge( Class containerClass, Class tileClass, GuiHostType type, SecurityPermissions requiredPermission )
GuiBridge( final Class containerClass, final Class tileClass, final GuiHostType type, final SecurityPermissions requiredPermission )
{
this.requiredPermission = requiredPermission;
this.containerClass = containerClass;
@@ -244,11 +244,11 @@ public enum GuiBridge implements IGuiHandler
}
@Override
public Object getServerGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z )
public Object getServerGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
{
AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
GuiBridge ID = values()[ordinal >> 4];
boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
final GuiBridge ID = values()[ordinal >> 4];
final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
if( ID.type.isItem() )
{
ItemStack it = null;
@@ -260,7 +260,7 @@ public enum GuiBridge implements IGuiHandler
{
it = player.inventory.getStackInSlot( x );
}
Object myItem = this.getGuiObject( it, player, w, x, y, z );
final Object myItem = this.getGuiObject( it, player, w, x, y, z );
if( myItem != null && ID.CorrectTileOrPart( myItem ) )
{
return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem );
@@ -268,11 +268,11 @@ public enum GuiBridge implements IGuiHandler
}
if( ID.type.isTile() )
{
TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
if( TE instanceof IPartHost )
{
( (IPartHost) TE ).getPart( side );
IPart part = ( (IPartHost) TE ).getPart( side );
final IPart part = ( (IPartHost) TE ).getPart( side );
if( ID.CorrectTileOrPart( part ) )
{
return this.updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part );
@@ -289,7 +289,7 @@ public enum GuiBridge implements IGuiHandler
return new ContainerNull();
}
private Object getGuiObject( ItemStack it, EntityPlayer player, World w, int x, int y, int z )
private Object getGuiObject( final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, final int z )
{
if( it != null )
{
@@ -298,7 +298,7 @@ public enum GuiBridge implements IGuiHandler
return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, new BlockPos(x,y,z) );
}
IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it );
final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it );
if( wh != null )
{
return new WirelessTerminalGuiObject( wh, it, player, w, x, y, z );
@@ -308,7 +308,7 @@ public enum GuiBridge implements IGuiHandler
return null;
}
public boolean CorrectTileOrPart( Object tE )
public boolean CorrectTileOrPart( final Object tE )
{
if( this.tileClass == null )
{
@@ -318,11 +318,11 @@ public enum GuiBridge implements IGuiHandler
return this.tileClass.isInstance( tE );
}
private Object updateGui( Object newContainer, World w, int x, int y, int z, AEPartLocation side, Object myItem )
private Object updateGui( final Object newContainer, final World w, final int x, final int y, final int z, final AEPartLocation side, final Object myItem )
{
if( newContainer instanceof AEBaseContainer )
{
AEBaseContainer bc = (AEBaseContainer) newContainer;
final AEBaseContainer bc = (AEBaseContainer) newContainer;
bc.openContext = new ContainerOpenContext( myItem );
bc.openContext.w = w;
bc.openContext.x = x;
@@ -334,36 +334,36 @@ public enum GuiBridge implements IGuiHandler
return newContainer;
}
public Object ConstructContainer( InventoryPlayer inventory, AEPartLocation side, Object tE )
public Object ConstructContainer( final InventoryPlayer inventory, final AEPartLocation side, final Object tE )
{
try
{
Constructor[] c = this.containerClass.getConstructors();
final Constructor[] c = this.containerClass.getConstructors();
if( c.length == 0 )
{
throw new AppEngException( "Invalid Gui Class" );
}
Constructor target = this.findConstructor( c, inventory, tE );
final Constructor target = this.findConstructor( c, inventory, tE );
if( target == null )
{
throw new IllegalStateException( "Cannot find " + this.containerClass.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
}
Object o = target.newInstance( inventory, tE );
final Object o = target.newInstance( inventory, tE );
/**
* triggers achievement when the player sees presses.
*/
if( o instanceof AEBaseContainer )
{
AEBaseContainer bc = (AEBaseContainer) o;
for( Object so : bc.inventorySlots )
final AEBaseContainer bc = (AEBaseContainer) o;
for( final Object so : bc.inventorySlots )
{
if( so instanceof Slot )
{
ItemStack is = ( (Slot) so ).getStack();
final ItemStack is = ( (Slot) so ).getStack();
final IMaterials materials = AEApi.instance().definitions().materials();
this.addPressAchievementToPlayer( is, materials, inventory.player );
@@ -373,17 +373,17 @@ public enum GuiBridge implements IGuiHandler
return o;
}
catch( Throwable t )
catch( final Throwable t )
{
throw new IllegalStateException( t );
}
}
private Constructor findConstructor( Constructor[] c, InventoryPlayer inventory, Object tE )
private Constructor findConstructor( final Constructor[] c, final InventoryPlayer inventory, final Object tE )
{
for( Constructor con : c )
for( final Constructor con : c )
{
Class[] types = con.getParameterTypes();
final Class[] types = con.getParameterTypes();
if( types.length == 2 )
{
if( types[0].isAssignableFrom( inventory.getClass() ) && types[1].isAssignableFrom( tE.getClass() ) )
@@ -395,7 +395,7 @@ public enum GuiBridge implements IGuiHandler
return null;
}
private String typeName( Object inventory )
private String typeName( final Object inventory )
{
if( inventory == null )
{
@@ -405,7 +405,7 @@ public enum GuiBridge implements IGuiHandler
return inventory.getClass().getName();
}
private void addPressAchievementToPlayer( ItemStack newItem, IMaterials possibleMaterials, EntityPlayer player )
private void addPressAchievementToPlayer( final ItemStack newItem, final IMaterials possibleMaterials, final EntityPlayer player )
{
final IComparableDefinition logic = possibleMaterials.logicProcessorPress();
final IComparableDefinition eng = possibleMaterials.engProcessorPress();
@@ -414,7 +414,7 @@ public enum GuiBridge implements IGuiHandler
final List<IComparableDefinition> presses = Lists.newArrayList( logic, eng, calc, silicon );
for( IComparableDefinition press : presses )
for( final IComparableDefinition press : presses )
{
if( press.isSameAs( newItem ) )
{
@@ -426,11 +426,11 @@ public enum GuiBridge implements IGuiHandler
}
@Override
public Object getClientGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z )
public Object getClientGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
{
AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
GuiBridge ID = values()[ordinal >> 4];
boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
final GuiBridge ID = values()[ordinal >> 4];
final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
if( ID.type.isItem() )
{
ItemStack it = null;
@@ -442,7 +442,7 @@ public enum GuiBridge implements IGuiHandler
{
it = player.inventory.getStackInSlot( x );
}
Object myItem = this.getGuiObject( it, player, w, x, y, z );
final Object myItem = this.getGuiObject( it, player, w, x, y, z );
if( myItem != null && ID.CorrectTileOrPart( myItem ) )
{
return ID.ConstructGui( player.inventory, side, myItem );
@@ -450,11 +450,11 @@ public enum GuiBridge implements IGuiHandler
}
if( ID.type.isTile() )
{
TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
if( TE instanceof IPartHost )
{
( (IPartHost) TE ).getPart( side );
IPart part = ( (IPartHost) TE ).getPart( side );
final IPart part = ( (IPartHost) TE ).getPart( side );
if( ID.CorrectTileOrPart( part ) )
{
return ID.ConstructGui( player.inventory, side, part );
@@ -471,17 +471,17 @@ public enum GuiBridge implements IGuiHandler
return new GuiNull( new ContainerNull() );
}
public Object ConstructGui( InventoryPlayer inventory, AEPartLocation side, Object tE )
public Object ConstructGui( final InventoryPlayer inventory, final AEPartLocation side, final Object tE )
{
try
{
Constructor[] c = this.guiClass.getConstructors();
final Constructor[] c = this.guiClass.getConstructors();
if( c.length == 0 )
{
throw new AppEngException( "Invalid Gui Class" );
}
Constructor target = this.findConstructor( c, inventory, tE );
final Constructor target = this.findConstructor( c, inventory, tE );
if( target == null )
{
@@ -490,25 +490,25 @@ public enum GuiBridge implements IGuiHandler
return target.newInstance( inventory, tE );
}
catch( Throwable t )
catch( final Throwable t )
{
throw new IllegalStateException( t );
}
}
public boolean hasPermissions( TileEntity te, int x, int y, int z, AEPartLocation side, EntityPlayer player )
public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final EntityPlayer player )
{
World w = player.getEntityWorld();
BlockPos pos = new BlockPos(x,y,z);
final World w = player.getEntityWorld();
final BlockPos pos = new BlockPos(x,y,z);
if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, pos ), player ) )
{
if( this.type.isItem() )
{
ItemStack it = player.inventory.getCurrentItem();
final ItemStack it = player.inventory.getCurrentItem();
if( it != null && it.getItem() instanceof IGuiItem )
{
Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, pos );
final Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, pos );
if( this.CorrectTileOrPart( myItem ) )
{
return true;
@@ -518,11 +518,11 @@ public enum GuiBridge implements IGuiHandler
if( this.type.isTile() )
{
TileEntity TE = w.getTileEntity( pos );
final TileEntity TE = w.getTileEntity( pos );
if( TE instanceof IPartHost )
{
( (IPartHost) TE ).getPart( side );
IPart part = ( (IPartHost) TE ).getPart( side );
final IPart part = ( (IPartHost) TE ).getPart( side );
if( this.CorrectTileOrPart( part ) )
{
return this.securityCheck( part, player );
@@ -540,28 +540,28 @@ public enum GuiBridge implements IGuiHandler
return false;
}
private boolean securityCheck( Object te, EntityPlayer player )
private boolean securityCheck( final Object te, final EntityPlayer player )
{
if( te instanceof IActionHost && this.requiredPermission != null )
{
IGridNode gn = ( (IActionHost) te ).getActionableNode();
final IGridNode gn = ( (IActionHost) te ).getActionableNode();
if( gn != null )
{
IGrid g = gn.getGrid();
final IGrid g = gn.getGrid();
if( g != null )
{
boolean requirePower = false;
final boolean requirePower = false;
if( requirePower )
{
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
if( !eg.isNetworkPowered() )
{
return false;
}
}
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
if( sg.hasPermission( player, this.requiredPermission ) )
{
return true;
@@ -40,23 +40,23 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
@Override
public void onPacketData(
final INetworkInfo manager,
INetHandler handler,
FMLProxyPacket packet,
final INetHandler handler,
final FMLProxyPacket packet,
final EntityPlayer player )
{
ByteBuf stream = packet.payload();
final ByteBuf stream = packet.payload();
try
{
int packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
final int packetType = stream.readInt();
final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
PacketCallState callState =
final PacketCallState callState =
new PacketCallState(){
@Override
public void call(
AppEngPacket appEngPacket )
final AppEngPacket appEngPacket )
{
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().thePlayer );
}
@@ -66,19 +66,19 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getMinecraft() );
callState.call( pack );
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( InvocationTargetException e )
catch( final InvocationTargetException e )
{
AELog.error( e );
}
@@ -38,22 +38,21 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
{
@Override
public void onPacketData( final INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, final EntityPlayer player )
public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final EntityPlayer player )
{
ByteBuf stream = packet.payload();
int packetType = -1;
final ByteBuf stream = packet.payload();
try
{
packetType = stream.readInt();
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
final int packetType = stream.readInt();
final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
PacketCallState callState =
final PacketCallState callState =
new PacketCallState(){
@Override
public void call(
AppEngPacket appEngPacket )
final AppEngPacket appEngPacket )
{
appEngPacket.serverPacketData( manager, appEngPacket, player);
}
@@ -63,19 +62,19 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ((EntityPlayerMP)player).getServerForPlayer() );
callState.call( pack );
}
catch( InstantiationException e )
catch( final InstantiationException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( InvocationTargetException e )
catch( final InvocationTargetException e )
{
AELog.error( e );
}
@@ -44,7 +44,7 @@ public class NetworkHandler
final IPacketHandler clientHandler;
final IPacketHandler serveHandler;
public NetworkHandler( String channelName )
public NetworkHandler( final String channelName )
{
FMLCommonHandler.instance().bus().register( this );
this.ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( this.myChannelName = channelName );
@@ -60,7 +60,7 @@ public class NetworkHandler
{
return new AppEngClientPacketHandler();
}
catch( Throwable t )
catch( final Throwable t )
{
return null;
}
@@ -72,20 +72,20 @@ public class NetworkHandler
{
return new AppEngServerPacketHandler();
}
catch( Throwable t )
catch( final Throwable t )
{
return null;
}
}
@SubscribeEvent
public void newConnection( ServerConnectionFromClientEvent ev )
public void newConnection( final ServerConnectionFromClientEvent ev )
{
WorldData.instance().dimensionData().sendToPlayer( ev.manager );
}
@SubscribeEvent
public void newConnection( PlayerLoggedInEvent loginEvent )
public void newConnection( final PlayerLoggedInEvent loginEvent )
{
if( loginEvent.player instanceof EntityPlayerMP )
{
@@ -94,9 +94,9 @@ public class NetworkHandler
}
@SubscribeEvent
public void serverPacket( ServerCustomPacketEvent ev )
public void serverPacket( final ServerCustomPacketEvent ev )
{
NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler();
final NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler();
if( this.serveHandler != null )
{
try
@@ -111,7 +111,7 @@ public class NetworkHandler
}
@SubscribeEvent
public void clientPacket( ClientCustomPacketEvent ev )
public void clientPacket( final ClientCustomPacketEvent ev )
{
if( this.clientHandler != null )
{
@@ -131,27 +131,27 @@ public class NetworkHandler
return this.myChannelName;
}
public void sendToAll( AppEngPacket message )
public void sendToAll( final AppEngPacket message )
{
this.ec.sendToAll( message.getProxy() );
}
public void sendTo( AppEngPacket message, EntityPlayerMP player )
public void sendTo( final AppEngPacket message, final EntityPlayerMP player )
{
this.ec.sendTo( message.getProxy(), player );
}
public void sendToAllAround( AppEngPacket message, NetworkRegistry.TargetPoint point )
public void sendToAllAround( final AppEngPacket message, final NetworkRegistry.TargetPoint point )
{
this.ec.sendToAllAround( message.getProxy(), point );
}
public void sendToDimension( AppEngPacket message, int dimensionId )
public void sendToDimension( final AppEngPacket message, final int dimensionId )
{
this.ec.sendToDimension( message.getProxy(), dimensionId );
}
public void sendToServer( AppEngPacket message )
public void sendToServer( final AppEngPacket message )
{
this.ec.sendToServer( message.getProxy() );
}
@@ -46,7 +46,7 @@ public class PacketAssemblerAnimation extends AppEngPacket
public final IAEItemStack is;
// automatic.
public PacketAssemblerAnimation( ByteBuf stream ) throws IOException
public PacketAssemblerAnimation( final ByteBuf stream ) throws IOException
{
this.x = stream.readInt();
this.y = stream.readInt();
@@ -56,10 +56,10 @@ public class PacketAssemblerAnimation extends AppEngPacket
}
// api
public PacketAssemblerAnimation( BlockPos pos, byte rate, IAEItemStack is ) throws IOException
public PacketAssemblerAnimation( final BlockPos pos, final byte rate, final IAEItemStack is ) throws IOException
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( this.x = pos.getX() );
@@ -74,11 +74,11 @@ public class PacketAssemblerAnimation extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
final double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
final double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
final double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this );
}
@@ -48,7 +48,7 @@ public class PacketClick extends AppEngPacket
final float hitZ;
// automatic.
public PacketClick( ByteBuf stream )
public PacketClick( final ByteBuf stream )
{
this.x = stream.readInt();
this.y = stream.readInt();
@@ -60,10 +60,10 @@ public class PacketClick extends AppEngPacket
}
// api
public PacketClick( BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ )
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( this.x = pos.getX() );
@@ -78,9 +78,9 @@ public class PacketClick extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
ItemStack is = player.inventory.getCurrentItem();
final ItemStack is = player.inventory.getCurrentItem();
final IItems items = AEApi.instance().definitions().items();
final IComparableDefinition maybeMemoryCard = items.memoryCard();
final IComparableDefinition maybeColorApplicator = items.colorApplicator();
@@ -89,20 +89,20 @@ public class PacketClick extends AppEngPacket
{
if( is.getItem() instanceof ToolNetworkTool )
{
ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z), EnumFacing.VALUES[ this.side ], this.hitX, this.hitY, this.hitZ );
}
else if( maybeMemoryCard.isSameAs( is ) )
{
IMemoryCard mem = (IMemoryCard) is.getItem();
final IMemoryCard mem = (IMemoryCard) is.getItem();
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
is.setTagCompound( null );
}
else if( maybeColorApplicator.isSameAs( is ) )
{
ToolColorApplicator mem = (ToolColorApplicator) is.getItem();
final ToolColorApplicator mem = (ToolColorApplicator) is.getItem();
mem.cycleColors( is, mem.getColor( is ), 1 );
}
}
@@ -42,7 +42,7 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
EntityPlayer talkBackTo;
// automatic.
public PacketCompassRequest( ByteBuf stream )
public PacketCompassRequest( final ByteBuf stream )
{
this.attunement = stream.readLong();
this.cx = stream.readInt();
@@ -51,10 +51,10 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
}
// api
public PacketCompassRequest( long attunement, int cx, int cz, int cdy )
public PacketCompassRequest( final long attunement, final int cx, final int cz, final int cdy )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeLong( this.attunement = attunement );
@@ -66,17 +66,17 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
}
@Override
public void calculatedDirection( boolean hasResult, boolean spin, double radians, double dist )
public void calculatedDirection( final boolean hasResult, final boolean spin, final double radians, final double dist )
{
NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo );
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
this.talkBackTo = player;
DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
final DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
WorldData.instance().compassData().service().getCompassDirection( loc, 174, this );
}
}
@@ -39,7 +39,7 @@ public class PacketCompassResponse extends AppEngPacket
public CompassResult cr;
// automatic.
public PacketCompassResponse( ByteBuf stream )
public PacketCompassResponse( final ByteBuf stream )
{
this.attunement = stream.readLong();
this.cx = stream.readInt();
@@ -50,10 +50,10 @@ public class PacketCompassResponse extends AppEngPacket
}
// api
public PacketCompassResponse( PacketCompassRequest req, boolean hasResult, boolean spin, double radians )
public PacketCompassResponse( final PacketCompassRequest req, final boolean hasResult, final boolean spin, final double radians )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeLong( this.attunement = req.attunement );
@@ -69,7 +69,7 @@ public class PacketCompassResponse extends AppEngPacket
}
@Override
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
CompassManager.INSTANCE.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr );
}
@@ -59,7 +59,7 @@ public class PacketCompressedNBT extends AppEngPacket
this.data = null;
this.compressFrame = null;
GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
final GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
{
@Override
@@ -74,13 +74,13 @@ public class PacketCompressedNBT extends AppEngPacket
}
} );
DataInputStream inStream = new DataInputStream( gzReader );
final DataInputStream inStream = new DataInputStream( gzReader );
this.in = CompressedStreamTools.read( inStream );
inStream.close();
}
// api
public PacketCompressedNBT( NBTTagCompound din ) throws IOException
public PacketCompressedNBT( final NBTTagCompound din ) throws IOException
{
this.data = Unpooled.buffer( 2048 );
@@ -92,7 +92,7 @@ public class PacketCompressedNBT extends AppEngPacket
{
@Override
public void write( int value ) throws IOException
public void write( final int value ) throws IOException
{
PacketCompressedNBT.this.data.writeByte( value );
}
@@ -106,9 +106,9 @@ public class PacketCompressedNBT extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if( gs instanceof GuiInterfaceTerminal )
{
@@ -40,19 +40,19 @@ public final class PacketConfigButton extends AppEngPacket
// automatic.
@Reflected
public PacketConfigButton( ByteBuf stream )
public PacketConfigButton( final ByteBuf stream )
{
this.option = Settings.values()[stream.readInt()];
this.rotationDirection = stream.readBoolean();
}
// api
public PacketConfigButton( Settings option, boolean rotationDirection )
public PacketConfigButton( final Settings option, final boolean rotationDirection )
{
this.option = option;
this.rotationDirection = rotationDirection;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( option.ordinal() );
@@ -62,16 +62,16 @@ public final class PacketConfigButton extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
final EntityPlayerMP sender = (EntityPlayerMP) player;
if ( sender.openContainer instanceof AEBaseContainer )
{
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if( baseContainer.getTarget() instanceof IConfigurableObject )
{
IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager();
Enum<?> newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() );
final IConfigManager cm = ( (IConfigurableObject) baseContainer.getTarget() ).getConfigManager();
final Enum<?> newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() );
cm.putSetting( this.option, newState );
}
}
@@ -49,18 +49,18 @@ public class PacketCraftRequest extends AppEngPacket
public final boolean heldShift;
// automatic.
public PacketCraftRequest( ByteBuf stream )
public PacketCraftRequest( final ByteBuf stream )
{
this.heldShift = stream.readBoolean();
this.amount = stream.readLong();
}
public PacketCraftRequest( int craftAmt, boolean shift )
public PacketCraftRequest( final int craftAmt, final boolean shift )
{
this.amount = craftAmt;
this.heldShift = shift;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeBoolean( shift );
@@ -70,22 +70,22 @@ public class PacketCraftRequest extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
if( player.openContainer instanceof ContainerCraftAmount )
{
ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer;
Object target = cca.getTarget();
final ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer;
final Object target = cca.getTarget();
if( target instanceof IGridHost )
{
IGridHost gh = (IGridHost) target;
IGridNode gn = gh.getGridNode( AEPartLocation.INTERNAL );
final IGridHost gh = (IGridHost) target;
final IGridNode gn = gh.getGridNode( AEPartLocation.INTERNAL );
if( gn == null )
{
return;
}
IGrid g = gn.getGrid();
final IGrid g = gn.getGrid();
if( g == null || cca.whatToMake == null )
{
return;
@@ -96,25 +96,25 @@ public class PacketCraftRequest extends AppEngPacket
Future<ICraftingJob> futureJob = null;
try
{
ICraftingGrid cg = g.getCache( ICraftingGrid.class );
final ICraftingGrid cg = g.getCache( ICraftingGrid.class );
futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.whatToMake, null );
ContainerOpenContext context = cca.openContext;
final ContainerOpenContext context = cca.openContext;
if( context != null )
{
TileEntity te = context.getTile();
final TileEntity te = context.getTile();
Platform.openGUI( player, te, cca.openContext.side, GuiBridge.GUI_CRAFTING_CONFIRM );
if( player.openContainer instanceof ContainerCraftConfirm )
{
ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
ccc.autoStart = this.heldShift;
ccc.job = futureJob;
cca.detectAndSendChanges();
}
}
}
catch( Throwable e )
catch( final Throwable e )
{
if( futureJob != null )
{
@@ -49,12 +49,12 @@ public class PacketInventoryAction extends AppEngPacket
public final IAEItemStack slotItem;
// automatic.
public PacketInventoryAction( ByteBuf stream ) throws IOException
public PacketInventoryAction( final ByteBuf stream ) throws IOException
{
this.action = InventoryAction.values()[stream.readInt()];
this.slot = stream.readInt();
this.id = stream.readLong();
boolean hasItem = stream.readBoolean();
final boolean hasItem = stream.readBoolean();
if( hasItem )
{
this.slotItem = AEItemStack.loadItemStackFromPacket( stream );
@@ -66,7 +66,7 @@ public class PacketInventoryAction extends AppEngPacket
}
// api
public PacketInventoryAction( InventoryAction action, int slot, IAEItemStack slotItem ) throws IOException
public PacketInventoryAction( final InventoryAction action, final int slot, final IAEItemStack slotItem ) throws IOException
{
if( Platform.isClient() )
@@ -79,7 +79,7 @@ public class PacketInventoryAction extends AppEngPacket
this.id = 0;
this.slotItem = slotItem;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( action.ordinal() );
@@ -100,14 +100,14 @@ public class PacketInventoryAction extends AppEngPacket
}
// api
public PacketInventoryAction( InventoryAction action, int slot, long id )
public PacketInventoryAction( final InventoryAction action, final int slot, final long id )
{
this.action = action;
this.slot = slot;
this.id = id;
this.slotItem = null;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( action.ordinal() );
@@ -119,23 +119,23 @@ public class PacketInventoryAction extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
final EntityPlayerMP sender = (EntityPlayerMP) player;
if( sender.openContainer instanceof AEBaseContainer )
{
AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if( this.action == InventoryAction.AUTO_CRAFT )
{
ContainerOpenContext context = baseContainer.openContext;
final ContainerOpenContext context = baseContainer.openContext;
if( context != null )
{
TileEntity te = context.getTile();
final TileEntity te = context.getTile();
Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT );
if( sender.openContainer instanceof ContainerCraftAmount )
{
ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer;
final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer;
if( baseContainer.getTargetStack() != null )
{
@@ -155,7 +155,7 @@ public class PacketInventoryAction extends AppEngPacket
}
@Override
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
if( this.action == InventoryAction.UPDATE_HAND )
{
@@ -41,7 +41,7 @@ public class PacketLightning extends AppEngPacket
final double z;
// automatic.
public PacketLightning( ByteBuf stream )
public PacketLightning( final ByteBuf stream )
{
this.x = stream.readFloat();
this.y = stream.readFloat();
@@ -49,13 +49,13 @@ public class PacketLightning extends AppEngPacket
}
// api
public PacketLightning( double x, double y, double z )
public PacketLightning( final double x, final double y, final double z )
{
this.x = x;
this.y = y;
this.z = z;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeFloat( (float) x );
@@ -67,17 +67,17 @@ public class PacketLightning extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
try
{
if( Platform.isClient() && AEConfig.instance.enableEffects )
{
LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f );
final LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
}
@@ -81,7 +81,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
// int originalBytes = stream.readableBytes();
GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
final GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
{
@Override
public int read() throws IOException
@@ -95,11 +95,11 @@ public class PacketMEInventoryUpdate extends AppEngPacket
}
} );
ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() );
byte[] tmp = new byte[TEMP_BUFFER_SIZE];
final ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() );
final byte[] tmp = new byte[TEMP_BUFFER_SIZE];
while( gzReader.available() != 0 )
{
int bytes = gzReader.read( tmp );
final int bytes = gzReader.read( tmp );
if( bytes > 0 )
{
uncompressed.writeBytes( tmp, 0, bytes );
@@ -125,7 +125,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
}
// api
public PacketMEInventoryUpdate( byte ref ) throws IOException
public PacketMEInventoryUpdate( final byte ref ) throws IOException
{
this.ref = ref;
this.data = Unpooled.buffer( OPERATION_BYTE_LIMIT );
@@ -135,7 +135,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
this.compressFrame = new GZIPOutputStream( new OutputStream()
{
@Override
public void write( int value ) throws IOException
public void write( final int value ) throws IOException
{
PacketMEInventoryUpdate.this.data.writeByte( value );
}
@@ -146,9 +146,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if( gs instanceof GuiCraftConfirm )
{
@@ -182,7 +182,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
this.configureWrite( this.data );
return super.getProxy();
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -190,9 +190,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
return null;
}
public void appendItem( IAEItemStack is ) throws IOException, BufferOverflowException
public void appendItem( final IAEItemStack is ) throws IOException, BufferOverflowException
{
ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT );
final ByteBuf tmp = Unpooled.buffer( OPERATION_BYTE_LIMIT );
is.writeToPacket( tmp );
this.compressFrame.flush();
@@ -45,7 +45,7 @@ public class PacketMatterCannon extends AppEngPacket
final byte len;
// automatic.
public PacketMatterCannon( ByteBuf stream )
public PacketMatterCannon( final ByteBuf stream )
{
this.x = stream.readFloat();
this.y = stream.readFloat();
@@ -57,10 +57,10 @@ public class PacketMatterCannon extends AppEngPacket
}
// api
public PacketMatterCannon( double x, double y, double z, float dx, float dy, float dz, byte len )
public PacketMatterCannon( final double x, final double y, final double z, final float dx, final float dy, final float dz, final byte len )
{
float dl = dx * dx + dy * dy + dz * dz;
float dlz = (float) Math.sqrt( dl );
final float dl = dx * dx + dy * dy + dz * dz;
final float dlz = (float) Math.sqrt( dl );
this.x = x;
this.y = y;
@@ -70,7 +70,7 @@ public class PacketMatterCannon extends AppEngPacket
this.dz = dz / dlz;
this.len = len;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeFloat( (float) x );
@@ -86,20 +86,20 @@ public class PacketMatterCannon extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
try
{
World world = FMLClientHandler.instance().getClient().theWorld;
final World world = FMLClientHandler.instance().getClient().theWorld;
for( int a = 1; a < this.len; a++ )
{
MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond );
final MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
catch( Exception ignored )
catch( final Exception ignored )
{
}
}
@@ -39,7 +39,7 @@ public class PacketMockExplosion extends AppEngPacket
public final double z;
// automatic.
public PacketMockExplosion( ByteBuf stream )
public PacketMockExplosion( final ByteBuf stream )
{
this.x = stream.readDouble();
this.y = stream.readDouble();
@@ -47,13 +47,13 @@ public class PacketMockExplosion extends AppEngPacket
}
// api
public PacketMockExplosion( double x, double y, double z )
public PacketMockExplosion( final double x, final double y, final double z )
{
this.x = x;
this.y = y;
this.z = z;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeDouble( x );
@@ -65,9 +65,9 @@ public class PacketMockExplosion extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
World world = CommonHelper.proxy.getWorld();
final World world = CommonHelper.proxy.getWorld();
world.spawnParticle( EnumParticleTypes.EXPLOSION_LARGE, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D, new int[0] );
}
}
@@ -35,14 +35,14 @@ public class PacketMultiPart extends AppEngPacket
{
// automatic.
public PacketMultiPart( ByteBuf stream )
public PacketMultiPart( final ByteBuf stream )
{
}
// api
public PacketMultiPart()
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
@@ -50,12 +50,12 @@ public class PacketMultiPart extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP );
final IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP );
if( fmp != null )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
final EntityPlayerMP sender = (EntityPlayerMP) player;
MinecraftForge.EVENT_BUS.post( fmp.newFMPPacketEvent( sender ) ); // when received it just posts this event.
}
}
@@ -67,17 +67,17 @@ public class PacketNEIRecipe extends AppEngPacket
ItemStack[][] recipe;
// automatic.
public PacketNEIRecipe( ByteBuf stream ) throws IOException
public PacketNEIRecipe( final ByteBuf stream ) throws IOException
{
ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() );
final ByteArrayInputStream bytes = new ByteArrayInputStream( stream.array() );
bytes.skip( stream.readerIndex() );
NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes );
final NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes );
if( comp != null )
{
this.recipe = new ItemStack[9][];
for( int x = 0; x < this.recipe.length; x++ )
{
NBTTagList list = comp.getTagList( "#" + x, 10 );
final NBTTagList list = comp.getTagList( "#" + x, 10 );
if( list.tagCount() > 0 )
{
this.recipe[x] = new ItemStack[list.tagCount()];
@@ -91,12 +91,12 @@ public class PacketNEIRecipe extends AppEngPacket
}
// api
public PacketNEIRecipe( NBTTagCompound recipe ) throws IOException
public PacketNEIRecipe( final NBTTagCompound recipe ) throws IOException
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream outputStream = new DataOutputStream( bytes );
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
final DataOutputStream outputStream = new DataOutputStream( bytes );
data.writeInt( this.getPacketID() );
@@ -107,34 +107,34 @@ public class PacketNEIRecipe extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
EntityPlayerMP pmp = (EntityPlayerMP) player;
Container con = pmp.openContainer;
final EntityPlayerMP pmp = (EntityPlayerMP) player;
final Container con = pmp.openContainer;
if( con instanceof IContainerCraftingPacket )
{
IContainerCraftingPacket cct = (IContainerCraftingPacket) con;
IGridNode node = cct.getNetworkNode();
final IContainerCraftingPacket cct = (IContainerCraftingPacket) con;
final IGridNode node = cct.getNetworkNode();
if( node != null )
{
IGrid grid = node.getGrid();
final IGrid grid = node.getGrid();
if( grid == null )
{
return;
}
IStorageGrid inv = grid.getCache( IStorageGrid.class );
IEnergyGrid energy = grid.getCache( IEnergyGrid.class );
ISecurityGrid security = grid.getCache( ISecurityGrid.class );
IInventory craftMatrix = cct.getInventoryByName( "crafting" );
IInventory playerInventory = cct.getInventoryByName( "player" );
final IStorageGrid inv = grid.getCache( IStorageGrid.class );
final IEnergyGrid energy = grid.getCache( IEnergyGrid.class );
final ISecurityGrid security = grid.getCache( ISecurityGrid.class );
final IInventory craftMatrix = cct.getInventoryByName( "crafting" );
final IInventory playerInventory = cct.getInventoryByName( "player" );
Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE;
final Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE;
if( inv != null && this.recipe != null && security != null )
{
InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 );
final InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 );
for( int x = 0; x < 9; x++ )
{
if( this.recipe[x] != null && this.recipe[x].length > 0 )
@@ -143,35 +143,35 @@ public class PacketNEIRecipe extends AppEngPacket
}
}
IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj );
final IRecipe r = Platform.findMatchingRecipe( testInv, pmp.worldObj );
if( r != null && security.hasPermission( player, SecurityPermissions.EXTRACT ) )
{
ItemStack is = r.getCraftingResult( testInv );
final ItemStack is = r.getCraftingResult( testInv );
if( is != null )
{
IMEMonitor<IAEItemStack> storage = inv.getItemInventory();
IItemList all = storage.getStorageList();
IPartitionList<IAEItemStack> filter = ItemViewCell.createFilter( cct.getViewCells() );
final IMEMonitor<IAEItemStack> storage = inv.getItemInventory();
final IItemList all = storage.getStorageList();
final IPartitionList<IAEItemStack> filter = ItemViewCell.createFilter( cct.getViewCells() );
for( int x = 0; x < craftMatrix.getSizeInventory(); x++ )
{
ItemStack patternItem = testInv.getStackInSlot( x );
final ItemStack patternItem = testInv.getStackInSlot( x );
ItemStack currentItem = craftMatrix.getStackInSlot( x );
if( currentItem != null )
{
testInv.setInventorySlotContents( x, currentItem );
ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null;
final ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null;
testInv.setInventorySlotContents( x, patternItem );
if( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) )
{
IAEItemStack in = AEItemStack.create( currentItem );
final IAEItemStack in = AEItemStack.create( currentItem );
if( in != null )
{
IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() );
final IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() );
if( out != null )
{
craftMatrix.setInventorySlotContents( x, out.getItemStack() );
@@ -198,13 +198,13 @@ public class PacketNEIRecipe extends AppEngPacket
{
for( int y = 0; y < this.recipe[x].length; y++ )
{
IAEItemStack request = AEItemStack.create( this.recipe[x][y] );
final IAEItemStack request = AEItemStack.create( this.recipe[x][y] );
if( request != null )
{
if( filter == null || filter.isListed( request ) )
{
request.setStackSize( 1 );
IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() );
final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() );
if( out != null )
{
whichItem = out.getItemStack();
@@ -240,7 +240,7 @@ public class PacketNEIRecipe extends AppEngPacket
* @param patternItem which {@link ItemStack} to extract
* @return null or a found {@link ItemStack}
*/
private ItemStack extractItemFromPlayerInventory( EntityPlayer player, Actionable mode, ItemStack patternItem )
private ItemStack extractItemFromPlayerInventory( final EntityPlayer player, final Actionable mode, final ItemStack patternItem )
{
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
final AEItemStack request = AEItemStack.create( patternItem );
@@ -36,17 +36,17 @@ public class PacketNewStorageDimension extends AppEngPacket
final int newDim;
// automatic.
public PacketNewStorageDimension( ByteBuf stream )
public PacketNewStorageDimension( final ByteBuf stream )
{
this.newDim = stream.readInt();
}
// api
public PacketNewStorageDimension( int newDim )
public PacketNewStorageDimension( final int newDim )
{
this.newDim = newDim;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( newDim );
@@ -56,13 +56,13 @@ public class PacketNewStorageDimension extends AppEngPacket
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
try
{
DimensionManager.registerDimension( this.newDim, AEConfig.instance.storageProviderID );
}
catch( IllegalArgumentException iae )
catch( final IllegalArgumentException iae )
{
// ok!
}
@@ -37,7 +37,7 @@ public class PacketPaintedEntity extends AppEngPacket
private int ticks;
// automatic.
public PacketPaintedEntity( ByteBuf stream )
public PacketPaintedEntity( final ByteBuf stream )
{
this.entityId = stream.readInt();
this.myColor = AEColor.values()[stream.readByte()];
@@ -45,10 +45,10 @@ public class PacketPaintedEntity extends AppEngPacket
}
// api
public PacketPaintedEntity( int myEntity, AEColor myColor, int ticksLeft )
public PacketPaintedEntity( final int myEntity, final AEColor myColor, final int ticksLeft )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( this.entityId = myEntity );
@@ -59,9 +59,9 @@ public class PacketPaintedEntity extends AppEngPacket
}
@Override
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks );
final PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks );
TickHandler.INSTANCE.getPlayerColors().put( this.entityId, pc );
}
}
@@ -41,7 +41,7 @@ public class PacketPartPlacement extends AppEngPacket
float eyeHeight;
// automatic.
public PacketPartPlacement( ByteBuf stream )
public PacketPartPlacement( final ByteBuf stream )
{
this.x = stream.readInt();
this.y = stream.readInt();
@@ -51,9 +51,9 @@ public class PacketPartPlacement extends AppEngPacket
}
// api
public PacketPartPlacement( BlockPos pos, EnumFacing face, float eyeHeight )
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeInt( pos.getX() );
@@ -66,9 +66,9 @@ public class PacketPartPlacement extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
final EntityPlayerMP sender = (EntityPlayerMP) player;
CommonHelper.proxy.updateRenderMode( sender );
PartPlacement.eyeHeight = this.eyeHeight;
PartPlacement.place( sender.getHeldItem(), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[ this.face ], sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
@@ -34,17 +34,17 @@ public class PacketPartialItem extends AppEngPacket
final byte[] data;
// automatic.
public PacketPartialItem( ByteBuf stream )
public PacketPartialItem( final ByteBuf stream )
{
this.pageNum = stream.readShort();
stream.readBytes( this.data = new byte[stream.readableBytes()] );
}
// api
public PacketPartialItem( int page, int maxPages, byte[] buf )
public PacketPartialItem( final int page, final int maxPages, final byte[] buf )
{
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
this.pageNum = (short) ( page | ( maxPages << 8 ) );
this.data = buf;
@@ -56,7 +56,7 @@ public class PacketPartialItem extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
if( player.openContainer instanceof AEBaseContainer )
{
@@ -74,7 +74,7 @@ public class PacketPartialItem extends AppEngPacket
return this.data.length;
}
public int write( byte[] buffer, int cursor )
public int write( final byte[] buffer, final int cursor )
{
System.arraycopy( this.data, 0, buffer, cursor, this.data.length );
return cursor + this.data.length;
@@ -45,7 +45,7 @@ public class PacketPatternSlot extends AppEngPacket
public final boolean shift;
// automatic.
public PacketPatternSlot( ByteBuf stream ) throws IOException
public PacketPatternSlot( final ByteBuf stream ) throws IOException
{
this.shift = stream.readBoolean();
@@ -58,9 +58,9 @@ public class PacketPatternSlot extends AppEngPacket
}
}
public IAEItemStack readItem( ByteBuf stream ) throws IOException
public IAEItemStack readItem( final ByteBuf stream ) throws IOException
{
boolean hasItem = stream.readBoolean();
final boolean hasItem = stream.readBoolean();
if( hasItem )
{
@@ -71,13 +71,13 @@ public class PacketPatternSlot extends AppEngPacket
}
// api
public PacketPatternSlot( IInventory pat, IAEItemStack slotItem, boolean shift ) throws IOException
public PacketPatternSlot( final IInventory pat, final IAEItemStack slotItem, final boolean shift ) throws IOException
{
this.slotItem = slotItem;
this.shift = shift;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
@@ -93,7 +93,7 @@ public class PacketPatternSlot extends AppEngPacket
this.configureWrite( data );
}
private void writeItem( IAEItemStack slotItem, ByteBuf data ) throws IOException
private void writeItem( final IAEItemStack slotItem, final ByteBuf data ) throws IOException
{
if( slotItem == null )
{
@@ -107,12 +107,12 @@ public class PacketPatternSlot extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
final EntityPlayerMP sender = (EntityPlayerMP) player;
if( sender.openContainer instanceof ContainerPatternTerm )
{
ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer;
final ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer;
patternTerminal.craftOrGetItem( this );
}
}
@@ -35,19 +35,19 @@ public class PacketProgressBar extends AppEngPacket
final long value;
// automatic.
public PacketProgressBar( ByteBuf stream )
public PacketProgressBar( final ByteBuf stream )
{
this.id = stream.readShort();
this.value = stream.readLong();
}
// api
public PacketProgressBar( int shortID, long value )
public PacketProgressBar( final int shortID, final long value )
{
this.id = (short) shortID;
this.value = value;
ByteBuf data = Unpooled.buffer();
final ByteBuf data = Unpooled.buffer();
data.writeInt( this.getPacketID() );
data.writeShort( shortID );
@@ -57,9 +57,9 @@ public class PacketProgressBar extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
{
Container c = player.openContainer;
final Container c = player.openContainer;
if( c instanceof AEBaseContainer )
{
( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value );
@@ -67,9 +67,9 @@ public class PacketProgressBar extends AppEngPacket
}
@Override
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
Container c = player.openContainer;
final Container c = player.openContainer;
if( c instanceof AEBaseContainer )
{
( (AEBaseContainer) c ).updateFullProgressBar( this.id, this.value );

Some files were not shown because too many files have changed in this diff Show More