From 639884accdd94bb9ad8579216cc82d7cc6ce9bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Fri, 22 Jul 2016 10:02:29 +0200 Subject: [PATCH] Mass-applied source clean-up --- src/java/mmm/Mmm.java | 2 +- src/java/mmm/food/FHelpers.java | 5 +++-- src/java/mmm/food/FIngredients.java | 4 ++-- src/java/mmm/materials/E_MItemType.java | 4 ++-- src/java/mmm/materials/MBlockTypes.java | 3 ++- src/java/mmm/materials/MItem.java | 2 +- src/java/mmm/materials/MMetal.java | 4 ++-- src/java/mmm/materials/MOre.java | 2 +- src/java/mmm/materials/traps/MTraps.java | 2 +- src/java/mmm/materials/trees/MTree.java | 8 ++++---- src/java/mmm/plants/PPlantsHelper.java | 8 ++++---- .../mmm/recipes/RMapCloningRecipeWrapperFactory.java | 2 +- src/java/mmm/recipes/RMapExtendingRecipeWrapper.java | 4 ++-- src/java/mmm/recipes/ROreRecipeHelper.java | 4 ++-- src/java/mmm/recipes/RRequirements.java | 10 +++++----- src/java/mmm/recipes/RShapedRecipeWrapper.java | 8 +++----- src/java/mmm/recipes/RShapedRecipeWrapperFactory.java | 4 ++-- .../mmm/recipes/RShapelessRecipeWrapperFactory.java | 3 +-- src/java/mmm/tech/base/alloy_furnace/TBAFGui.java | 2 +- src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java | 3 +-- src/java/mmm/utils/gui/UGSlotGroups.java | 4 ++-- src/java/mmm/world/WDefaultGenWatcher.java | 2 +- src/java/mmm/world/gen/WGFloraParameters.java | 4 ++-- 23 files changed, 46 insertions(+), 48 deletions(-) diff --git a/src/java/mmm/Mmm.java b/src/java/mmm/Mmm.java index 0e61d99..7212c0a 100644 --- a/src/java/mmm/Mmm.java +++ b/src/java/mmm/Mmm.java @@ -47,7 +47,7 @@ public class Mmm @Mod.EventHandler - public void postInit( FMLPostInitializationEvent event ) + public void postInit( final FMLPostInitializationEvent event ) { Mmm.proxy.postInit( event ); } diff --git a/src/java/mmm/food/FHelpers.java b/src/java/mmm/food/FHelpers.java index e5e3cc1..60831ad 100644 --- a/src/java/mmm/food/FHelpers.java +++ b/src/java/mmm/food/FHelpers.java @@ -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 ); diff --git a/src/java/mmm/food/FIngredients.java b/src/java/mmm/food/FIngredients.java index 791fd24..6a4d708 100644 --- a/src/java/mmm/food/FIngredients.java +++ b/src/java/mmm/food/FIngredients.java @@ -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" , // diff --git a/src/java/mmm/materials/E_MItemType.java b/src/java/mmm/materials/E_MItemType.java index bee27a1..6950067 100644 --- a/src/java/mmm/materials/E_MItemType.java +++ b/src/java/mmm/materials/E_MItemType.java @@ -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; diff --git a/src/java/mmm/materials/MBlockTypes.java b/src/java/mmm/materials/MBlockTypes.java index 4cdaec4..66024d1 100644 --- a/src/java/mmm/materials/MBlockTypes.java +++ b/src/java/mmm/materials/MBlockTypes.java @@ -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<>( ); diff --git a/src/java/mmm/materials/MItem.java b/src/java/mmm/materials/MItem.java index 0dd5ec6..7c0d9a5 100644 --- a/src/java/mmm/materials/MItem.java +++ b/src/java/mmm/materials/MItem.java @@ -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 ); } diff --git a/src/java/mmm/materials/MMetal.java b/src/java/mmm/materials/MMetal.java index e27979c..b268b77 100644 --- a/src/java/mmm/materials/MMetal.java +++ b/src/java/mmm/materials/MMetal.java @@ -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" ); } diff --git a/src/java/mmm/materials/MOre.java b/src/java/mmm/materials/MOre.java index ae33fc4..c58d1fb 100644 --- a/src/java/mmm/materials/MOre.java +++ b/src/java/mmm/materials/MOre.java @@ -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" ); } diff --git a/src/java/mmm/materials/traps/MTraps.java b/src/java/mmm/materials/traps/MTraps.java index b22957d..f33a3a1 100644 --- a/src/java/mmm/materials/traps/MTraps.java +++ b/src/java/mmm/materials/traps/MTraps.java @@ -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( ) ); diff --git a/src/java/mmm/materials/trees/MTree.java b/src/java/mmm/materials/trees/MTree.java index 29270eb..aa4d9be 100644 --- a/src/java/mmm/materials/trees/MTree.java +++ b/src/java/mmm/materials/trees/MTree.java @@ -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; diff --git a/src/java/mmm/plants/PPlantsHelper.java b/src/java/mmm/plants/PPlantsHelper.java index fbcdb14..5add47c 100644 --- a/src/java/mmm/plants/PPlantsHelper.java +++ b/src/java/mmm/plants/PPlantsHelper.java @@ -39,7 +39,7 @@ public class PPlantsHelper { float total = 1.0f; final BlockPos blockpos = pos.down( ); - + for ( int xo = -1 ; xo <= 1 ; ++xo ) { for ( int zo = -1 ; zo <= 1 ; ++zo ) { float weight = 0f; @@ -58,12 +58,12 @@ public class PPlantsHelper total += weight; } } - + final BlockPos bpNorth = pos.north( ); final BlockPos bpSouth = pos.south( ); final BlockPos bpWest = pos.west( ); final BlockPos bpEast = pos.east( ); - + final boolean surroundedEW = blockIn == worldIn.getBlockState( bpWest ).getBlock( ) || blockIn == worldIn.getBlockState( bpEast ).getBlock( ); final boolean surroundedNS = blockIn == worldIn.getBlockState( bpNorth ).getBlock( ) @@ -75,7 +75,7 @@ public class PPlantsHelper || blockIn == worldIn.getBlockState( bpWest.south( ) ).getBlock( ) ) { total /= 2f; } - + return total; } diff --git a/src/java/mmm/recipes/RMapCloningRecipeWrapperFactory.java b/src/java/mmm/recipes/RMapCloningRecipeWrapperFactory.java index df76b6e..ff717ad 100644 --- a/src/java/mmm/recipes/RMapCloningRecipeWrapperFactory.java +++ b/src/java/mmm/recipes/RMapCloningRecipeWrapperFactory.java @@ -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( ) ); } diff --git a/src/java/mmm/recipes/RMapExtendingRecipeWrapper.java b/src/java/mmm/recipes/RMapExtendingRecipeWrapper.java index 1cacb2d..307a4f6 100644 --- a/src/java/mmm/recipes/RMapExtendingRecipeWrapper.java +++ b/src/java/mmm/recipes/RMapExtendingRecipeWrapper.java @@ -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 ); } diff --git a/src/java/mmm/recipes/ROreRecipeHelper.java b/src/java/mmm/recipes/ROreRecipeHelper.java index 38f5e68..7bcda3c 100644 --- a/src/java/mmm/recipes/ROreRecipeHelper.java +++ b/src/java/mmm/recipes/ROreRecipeHelper.java @@ -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 ); diff --git a/src/java/mmm/recipes/RRequirements.java b/src/java/mmm/recipes/RRequirements.java index 94f9e91..8df45dd 100644 --- a/src/java/mmm/recipes/RRequirements.java +++ b/src/java/mmm/recipes/RRequirements.java @@ -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++ ) { diff --git a/src/java/mmm/recipes/RShapedRecipeWrapper.java b/src/java/mmm/recipes/RShapedRecipeWrapper.java index 4b9b382..1070331 100644 --- a/src/java/mmm/recipes/RShapedRecipeWrapper.java +++ b/src/java/mmm/recipes/RShapedRecipeWrapper.java @@ -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; } - } diff --git a/src/java/mmm/recipes/RShapedRecipeWrapperFactory.java b/src/java/mmm/recipes/RShapedRecipeWrapperFactory.java index a945769..52c6d46 100644 --- a/src/java/mmm/recipes/RShapedRecipeWrapperFactory.java +++ b/src/java/mmm/recipes/RShapedRecipeWrapperFactory.java @@ -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( ); } diff --git a/src/java/mmm/recipes/RShapelessRecipeWrapperFactory.java b/src/java/mmm/recipes/RShapelessRecipeWrapperFactory.java index a98b99d..f2b3cd1 100644 --- a/src/java/mmm/recipes/RShapelessRecipeWrapperFactory.java +++ b/src/java/mmm/recipes/RShapelessRecipeWrapperFactory.java @@ -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; diff --git a/src/java/mmm/tech/base/alloy_furnace/TBAFGui.java b/src/java/mmm/tech/base/alloy_furnace/TBAFGui.java index 4e5b2b5..1183812 100644 --- a/src/java/mmm/tech/base/alloy_furnace/TBAFGui.java +++ b/src/java/mmm/tech/base/alloy_furnace/TBAFGui.java @@ -172,7 +172,7 @@ public class TBAFGui } else if ( typedChar == 't' || typedChar == 'T' ) { this.tfSearch.setFocused( true ); return true; - + } else if ( keyCode == Keyboard.KEY_LEFT && this.bPrevious.enabled ) { this.onActionPerformed( this.bPrevious ); return true; diff --git a/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java b/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java index cee1c6e..ba17e73 100644 --- a/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java +++ b/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java @@ -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; } diff --git a/src/java/mmm/utils/gui/UGSlotGroups.java b/src/java/mmm/utils/gui/UGSlotGroups.java index 505c7a1..6378395 100644 --- a/src/java/mmm/utils/gui/UGSlotGroups.java +++ b/src/java/mmm/utils/gui/UGSlotGroups.java @@ -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; diff --git a/src/java/mmm/world/WDefaultGenWatcher.java b/src/java/mmm/world/WDefaultGenWatcher.java index abc1d40..9668390 100644 --- a/src/java/mmm/world/WDefaultGenWatcher.java +++ b/src/java/mmm/world/WDefaultGenWatcher.java @@ -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( ) ); } diff --git a/src/java/mmm/world/gen/WGFloraParameters.java b/src/java/mmm/world/gen/WGFloraParameters.java index 5a2e578..a3eedf9 100644 --- a/src/java/mmm/world/gen/WGFloraParameters.java +++ b/src/java/mmm/world/gen/WGFloraParameters.java @@ -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" );