Mass-applied source clean-up

This commit is contained in:
Emmanuel BENOîT 2016-07-22 10:02:29 +02:00
parent 70e312131f
commit 639884accd
23 changed files with 46 additions and 48 deletions

View file

@ -47,7 +47,7 @@ public class Mmm
@Mod.EventHandler
public void postInit( FMLPostInitializationEvent event )
public void postInit( final FMLPostInitializationEvent event )
{
Mmm.proxy.postInit( event );
}

View file

@ -13,12 +13,13 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
public class FHelpers
{
public static ItemFood makeBasicMeal( int amount , float saturation , boolean wolfFood , String... name )
public static ItemFood makeBasicMeal( final int amount , final float saturation , final boolean wolfFood ,
final String... name )
{
final ItemFood item = new ItemFood( amount , saturation , wolfFood );
item.setCreativeTab( CreativeTabs.FOOD );
String[] fullName = new String[ name.length + 1 ];
final String[] fullName = new String[ name.length + 1 ];
fullName[ 0 ] = "food";
System.arraycopy( name , 0 , fullName , 1 , name.length );
CRegistry.setIdentifiers( item , fullName );

View file

@ -47,12 +47,12 @@ public class FIngredients
GameRegistry.addShapelessRecipe( new ItemStack( this.DOUGH ) , //
this.FLOUR , Items.WATER_BUCKET , MmmMaterials.ITEM.ROCK_SALT );
GameRegistry.addShapedRecipe( new ItemStack( GLASS_JAR , 16 ) , //
GameRegistry.addShapedRecipe( new ItemStack( this.GLASS_JAR , 16 ) , //
"G G" , //
"G G" , //
"GGG" , //
'G' , Blocks.GLASS );
GameRegistry.addShapedRecipe( new ItemStack( GLASS_JAR , 16 ) , //
GameRegistry.addShapedRecipe( new ItemStack( this.GLASS_JAR , 16 ) , //
"G G" , //
"G G" , //
"GGG" , //

View file

@ -15,13 +15,13 @@ public enum E_MItemType {
public final Class< ? > extraInfoType;
private E_MItemType( String path )
private E_MItemType( final String path )
{
this( path , Object.class );
}
private E_MItemType( String path , Class< ? > extraInfoType )
private E_MItemType( final String path , final Class< ? > extraInfoType )
{
this.path = path;
this.extraInfoType = extraInfoType;

View file

@ -52,7 +52,8 @@ public class MBlockTypes
} );
}
{
WOOD = new MBlockType( "WOOD" , ( bs ) -> LOG.matches( bs ) || PLANKS.matches( bs ) );
WOOD = new MBlockType( "WOOD" ,
( bs ) -> MBlockTypes.LOG.matches( bs ) || MBlockTypes.PLANKS.matches( bs ) );
}
{
final HashSet< Block > builtinOres = new HashSet<>( );

View file

@ -55,7 +55,7 @@ public class MItem
}
public < T > T getExtraInfo( Class< T > cls )
public < T > T getExtraInfo( final Class< T > cls )
{
return cls.cast( this.extraInfo );
}

View file

@ -51,7 +51,7 @@ public class MMetal
this.NUGGET = nugget;
if ( ingot instanceof MItem ) {
MItem miIngot = (MItem) ingot;
final MItem miIngot = (MItem) ingot;
if ( miIngot.itemType != E_MItemType.INGOT ) {
throw new IllegalArgumentException( "invalid ingot item" );
}
@ -59,7 +59,7 @@ public class MMetal
}
if ( nugget instanceof MItem ) {
MItem miNugget = (MItem) nugget;
final MItem miNugget = (MItem) nugget;
if ( miNugget.itemType != E_MItemType.NUGGET ) {
throw new IllegalArgumentException( "invalid nugget item" );
}

View file

@ -88,7 +88,7 @@ public class MOre
this.dropItems = item;
this.dropMeta = meta;
if ( item instanceof MItem ) {
MItem oreItem = (MItem) item;
final MItem oreItem = (MItem) item;
if ( oreItem.itemType != E_MItemType.ORE ) {
throw new IllegalArgumentException( "ore item expected" );
}

View file

@ -45,7 +45,7 @@ public class MTraps
public < T extends Block & I_TrapBlock > T register( final T block )
{
Block asMcBlock = (Block) block;
final Block asMcBlock = block;
for ( final IBlockState state : block.getReplacedBlocks( ) ) {
this.traps.put( state , block );
this.trapTypes.put( state , block.getTrapType( ) );

View file

@ -229,10 +229,10 @@ public class MTree
CRegistry.setFuel( sapling , this.baseFlammability * 30 );
}
OreDictionary.registerOre( "logWood" , LOG );
OreDictionary.registerOre( "plankWood" , PLANKS );
OreDictionary.registerOre( "treeLeaves" , LEAVES );
OreDictionary.registerOre( "treeSapling" , SAPLING );
OreDictionary.registerOre( "logWood" , this.LOG );
OreDictionary.registerOre( "plankWood" , this.PLANKS );
OreDictionary.registerOre( "treeLeaves" , this.LEAVES );
OreDictionary.registerOre( "treeSapling" , this.SAPLING );
CRegistry.addRecipeRegistrar( this );
return this;

View file

@ -23,7 +23,7 @@ public class RMapCloningRecipeWrapperFactory
@Override
public List< I_CraftingRecipeWrapper > createWrappers( IRecipe recipe )
public List< I_CraftingRecipeWrapper > createWrappers( final IRecipe recipe )
{
return Arrays.asList( new RMapCloningRecipeWrapper( ) );
}

View file

@ -37,8 +37,8 @@ public class RMapExtendingRecipeWrapper
public RMapExtendingRecipeWrapper( )
{
requirements.put( 0 , new ItemStack( Items.FILLED_MAP , 1 , OreDictionary.WILDCARD_VALUE ) , 1 );
requirements.put( 1 , new ItemStack( Items.PAPER ) , 8 );
this.requirements.put( 0 , new ItemStack( Items.FILLED_MAP , 1 , OreDictionary.WILDCARD_VALUE ) , 1 );
this.requirements.put( 1 , new ItemStack( Items.PAPER ) , 8 );
}

View file

@ -42,11 +42,11 @@ class ROreRecipeHelper
final ItemStack invStack = (ItemStack) input;
for ( final ItemStack ciStack : combinedInputStacks ) {
if ( OreDictionary.itemMatches( ciStack , invStack , true ) ) {
ciStack.stackSize ++;
ciStack.stackSize++;
continue OUTER;
}
}
ItemStack ciStack = invStack.copy( );
final ItemStack ciStack = invStack.copy( );
ciStack.stackSize = 1;
combinedInputStacks.add( ciStack );

View file

@ -76,7 +76,7 @@ class RRequirements
@Override
public boolean checkItemStack( final int pos , final ItemStack stack , World world )
public boolean checkItemStack( final int pos , final ItemStack stack , final World world )
{
if ( stack != null ) {
for ( final ItemStack target : this.getItemTypes( pos ) ) {
@ -90,14 +90,14 @@ class RRequirements
@Override
public boolean checkInventory( final IInventory inventory , World world )
public boolean checkInventory( final IInventory inventory , final World world )
{
return this.checkInventory( inventory , 1 , world );
}
@Override
public boolean checkInventory( final IInventory inventory , final int amount , World world )
public boolean checkInventory( final IInventory inventory , final int amount , final World world )
{
final int nInvItems = inventory.getSizeInventory( );
for ( int i = 0 ; i < this.quantities.length ; i++ ) {
@ -119,7 +119,7 @@ class RRequirements
@Override
public int getMaxOutput( final IInventory inventory , World world )
public int getMaxOutput( final IInventory inventory , final World world )
{
final int nInvItems = inventory.getSizeInventory( );
int maxQuantity = Integer.MAX_VALUE;
@ -140,7 +140,7 @@ class RRequirements
@Override
public void removeFromInventory( final IInventory inventory , final int amount , World world )
public void removeFromInventory( final IInventory inventory , final int amount , final World world )
{
final int nInvItems = inventory.getSizeInventory( );
for ( int i = 0 ; i < this.quantities.length ; i++ ) {

View file

@ -22,13 +22,13 @@ public class RShapedRecipeWrapper
public RShapedRecipeWrapper( final ShapedRecipes recipe )
{
this.recipe = recipe;
this.requirements = new RRequirements( extractInputs( recipe ) );
this.requirements = new RRequirements( RShapedRecipeWrapper.extractInputs( recipe ) );
}
private static ArrayList< ItemStack > extractInputs( final ShapedRecipes recipe )
{
ArrayList< ItemStack > inputs = new ArrayList<>( );
final ArrayList< ItemStack > inputs = new ArrayList<>( );
for ( int i = 0 ; i < recipe.recipeWidth ; i++ ) {
RECIPE: for ( int j = 0 ; j < recipe.recipeHeight ; j++ ) {
ItemStack itemStack = recipe.recipeItems[ i + j * recipe.recipeWidth ];
@ -37,7 +37,7 @@ public class RShapedRecipeWrapper
}
for ( int k = 0 ; k < inputs.size( ) ; k++ ) {
ItemStack input = inputs.get( k );
final ItemStack input = inputs.get( k );
if ( OreDictionary.itemMatches( input , itemStack , true ) ) {
input.stackSize++;
continue RECIPE;
@ -109,12 +109,10 @@ public class RShapedRecipeWrapper
}
@Override
public I_RecipeRequirements getRequirements( )
{
return this.requirements;
}
}

View file

@ -24,9 +24,9 @@ public class RShapedRecipeWrapperFactory
@Override
public List< I_CraftingRecipeWrapper > createWrappers( IRecipe recipe )
public List< I_CraftingRecipeWrapper > createWrappers( final IRecipe recipe )
{
ShapedRecipes r = (ShapedRecipes) recipe;
final ShapedRecipes r = (ShapedRecipes) recipe;
if ( r.recipeHeight > 3 || r.recipeWidth > 3 ) {
return Collections.emptyList( );
}

View file

@ -1,12 +1,11 @@
package mmm.recipes;
import mmm.core.api.recipes.I_CraftingRecipeWrapperFactory;
import java.util.Arrays;
import java.util.List;
import mmm.core.api.recipes.I_CraftingRecipeWrapper;
import mmm.core.api.recipes.I_CraftingRecipeWrapperFactory;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapelessRecipes;

View file

@ -163,8 +163,7 @@ public abstract class A_UGTabbedContainerScreen< CTYPE extends UGContainer >
final int tabOffsetX = tab * UGui.TAB_WIDTH;
final int tabX = this.guiLeft + tabOffsetX + UGui.TAB_BORDER;
final int tabY = this.guiTop - UGui.TAB_HEIGHT + UGui.TAB_BORDER;
return mouseX >= tabX && mouseY >= tabY && mouseX <= tabX + UGui.TAB_WIDTH
&& mouseY <= tabY + UGui.TAB_HEIGHT;
return mouseX >= tabX && mouseY >= tabY && mouseX <= tabX + UGui.TAB_WIDTH && mouseY <= tabY + UGui.TAB_HEIGHT;
}

View file

@ -102,9 +102,9 @@ public class UGSlotGroups
}
public int getGroup( int slotIndex )
public int getGroup( final int slotIndex )
{
int nGroups = this.firstSlots.size( );
final int nGroups = this.firstSlots.size( );
for ( int i = 1 ; i < nGroups ; i++ ) {
if ( slotIndex < this.firstSlots.getInt( i ) ) {
return i - 1;

View file

@ -67,7 +67,7 @@ public class WDefaultGenWatcher
@SubscribeEvent
public void onBiomeDecorate( DecorateBiomeEvent.Post event )
public void onBiomeDecorate( final DecorateBiomeEvent.Post event )
{
this.floraGenerator.generate( event.getWorld( ) , event.getRand( ) , event.getPos( ) );
}

View file

@ -66,7 +66,7 @@ public class WGFloraParameters
}
public WGFloraParameters setPlacementAttempts( int attempts )
public WGFloraParameters setPlacementAttempts( final int attempts )
{
if ( attempts < 1 ) {
throw new IllegalArgumentException( "invalid placement attempts count" );
@ -76,7 +76,7 @@ public class WGFloraParameters
}
public WGFloraParameters setSuccessfulPlacements( int successes )
public WGFloraParameters setSuccessfulPlacements( final int successes )
{
if ( successes < 1 ) {
throw new IllegalArgumentException( "invalid successful placement count" );