Merge pull request #1420 from thatsIch/e-method-parameter-naming-conventions

Replaces all method parameter regarding their naming conventions
This commit is contained in:
thatsIch
2015-05-08 23:45:28 +02:00
76 changed files with 381 additions and 381 deletions
+35 -35
View File
@@ -243,7 +243,7 @@ public class Platform
return ForgeDirection.UNKNOWN;
}
public static <T extends Enum> T rotateEnum( T ce, boolean backwards, EnumSet ValidOptions )
public static <T extends Enum> T rotateEnum( T ce, boolean backwards, EnumSet validOptions )
{
do
{
@@ -256,7 +256,7 @@ public class Platform
ce = nextEnum( ce );
}
}
while( !ValidOptions.contains( ce ) || isNotValidSetting( ce ) );
while( !validOptions.contains( ce ) || isNotValidSetting( ce ) );
return ce;
}
@@ -455,18 +455,18 @@ public class Platform
* then the vanilla version which likes to fail when NBT Compound data changes order, it is pretty expensive
* performance wise, so try an use shared tag compounds as long as the system remains in AE.
*/
public static boolean NBTEqualityTest( NBTBase A, NBTBase B )
public static boolean NBTEqualityTest( NBTBase left, NBTBase right )
{
// same type?
byte id = A.getId();
if( id == B.getId() )
byte id = left.getId();
if( id == right.getId() )
{
switch( id )
{
case 10:
{
NBTTagCompound ctA = (NBTTagCompound) A;
NBTTagCompound ctB = (NBTTagCompound) B;
NBTTagCompound ctA = (NBTTagCompound) left;
NBTTagCompound ctB = (NBTTagCompound) right;
Set<String> cA = ctA.func_150296_c();
Set<String> cB = ctB.func_150296_c();
@@ -496,8 +496,8 @@ public class Platform
case 9: // ) // A instanceof NBTTagList )
{
NBTTagList lA = (NBTTagList) A;
NBTTagList lB = (NBTTagList) B;
NBTTagList lA = (NBTTagList) left;
NBTTagList lB = (NBTTagList) right;
if( lA.tagCount() != lB.tagCount() )
{
return false;
@@ -527,25 +527,25 @@ public class Platform
}
case 1: // ( A instanceof NBTTagByte )
return ( (NBTTagByte) A ).func_150287_d() == ( (NBTTagByte) B ).func_150287_d();
return ( (NBTTagByte) left ).func_150287_d() == ( (NBTTagByte) right ).func_150287_d();
case 4: // else if ( A instanceof NBTTagLong )
return ( (NBTTagLong) A ).func_150291_c() == ( (NBTTagLong) B ).func_150291_c();
return ( (NBTTagLong) left ).func_150291_c() == ( (NBTTagLong) right ).func_150291_c();
case 8: // else if ( A instanceof NBTTagString )
return ( (NBTTagString) A ).func_150285_a_().equals( ( (NBTTagString) B ).func_150285_a_() ) || ( (NBTTagString) A ).func_150285_a_().equals( ( (NBTTagString) B ).func_150285_a_() );
return ( (NBTTagString) left ).func_150285_a_().equals( ( (NBTTagString) right ).func_150285_a_() ) || ( (NBTTagString) left ).func_150285_a_().equals( ( (NBTTagString) right ).func_150285_a_() );
case 6: // else if ( A instanceof NBTTagDouble )
return ( (NBTTagDouble) A ).func_150286_g() == ( (NBTTagDouble) B ).func_150286_g();
return ( (NBTTagDouble) left ).func_150286_g() == ( (NBTTagDouble) right ).func_150286_g();
case 5: // else if ( A instanceof NBTTagFloat )
return ( (NBTTagFloat) A ).func_150288_h() == ( (NBTTagFloat) B ).func_150288_h();
return ( (NBTTagFloat) left ).func_150288_h() == ( (NBTTagFloat) right ).func_150288_h();
case 3: // else if ( A instanceof NBTTagInt )
return ( (NBTTagInt) A ).func_150287_d() == ( (NBTTagInt) B ).func_150287_d();
return ( (NBTTagInt) left ).func_150287_d() == ( (NBTTagInt) right ).func_150287_d();
default:
return A.equals( B );
return left.equals( right );
}
}
@@ -591,17 +591,17 @@ public class Platform
* Orderless hash on NBT Data, used to work thought huge piles fast, but ignores the order just in case MC decided
* to change it... WHICH IS BAD...
*/
public static int NBTOrderlessHash( NBTBase A )
public static int NBTOrderlessHash( NBTBase nbt )
{
// same type?
int hash = 0;
byte id = A.getId();
byte id = nbt.getId();
hash += id;
switch( id )
{
case 10:
{
NBTTagCompound ctA = (NBTTagCompound) A;
NBTTagCompound ctA = (NBTTagCompound) nbt;
Set<String> cA = ctA.func_150296_c();
@@ -615,7 +615,7 @@ public class Platform
case 9: // ) // A instanceof NBTTagList )
{
NBTTagList lA = (NBTTagList) A;
NBTTagList lA = (NBTTagList) nbt;
hash += 9 * lA.tagCount();
List<NBTBase> l = tagList( lA );
@@ -628,22 +628,22 @@ public class Platform
}
case 1: // ( A instanceof NBTTagByte )
return hash + ( (NBTTagByte) A ).func_150290_f();
return hash + ( (NBTTagByte) nbt ).func_150290_f();
case 4: // else if ( A instanceof NBTTagLong )
return hash + (int) ( (NBTTagLong) A ).func_150291_c();
return hash + (int) ( (NBTTagLong) nbt ).func_150291_c();
case 8: // else if ( A instanceof NBTTagString )
return hash + ( (NBTTagString) A ).func_150285_a_().hashCode();
return hash + ( (NBTTagString) nbt ).func_150285_a_().hashCode();
case 6: // else if ( A instanceof NBTTagDouble )
return hash + (int) ( (NBTTagDouble) A ).func_150286_g();
return hash + (int) ( (NBTTagDouble) nbt ).func_150286_g();
case 5: // else if ( A instanceof NBTTagFloat )
return hash + (int) ( (NBTTagFloat) A ).func_150288_h();
return hash + (int) ( (NBTTagFloat) nbt ).func_150288_h();
case 3: // else if ( A instanceof NBTTagInt )
return hash + ( (NBTTagInt) A ).func_150287_d();
return hash + ( (NBTTagInt) nbt ).func_150287_d();
default:
return hash;
@@ -653,14 +653,14 @@ public class Platform
/*
* The usual version of this returns an ItemStack, this version returns the recipe.
*/
public static IRecipe findMatchingRecipe( InventoryCrafting par1InventoryCrafting, World par2World )
public static IRecipe findMatchingRecipe( InventoryCrafting inventoryCrafting, World par2World )
{
CraftingManager cm = CraftingManager.getInstance();
List<IRecipe> rl = cm.getRecipeList();
for( IRecipe r : rl )
{
if( r.matches( par1InventoryCrafting, par2World ) )
if( r.matches( inventoryCrafting, par2World ) )
{
return r;
}
@@ -1236,7 +1236,7 @@ public class Platform
return isSameItem( is, filter ) && sameStackStags( is, filter );
}
public static boolean isSameItemFuzzy( ItemStack a, ItemStack b, FuzzyMode Mode )
public static boolean isSameItemFuzzy( ItemStack a, ItemStack b, FuzzyMode mode )
{
if( a == null && b == null )
{
@@ -1263,11 +1263,11 @@ public class Platform
{
try
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamageForDisplay() > 1 ) == ( b.getItemDamageForDisplay() > 1 );
}
@@ -1276,16 +1276,16 @@ public class Platform
float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage();
float BPercentDamaged = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
catch( Throwable e )
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamage() > 1 ) == ( b.getItemDamage() > 1 );
}
@@ -1294,7 +1294,7 @@ public class Platform
float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage();
float BPercentDamaged = (float) b.getItemDamage() / (float) b.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
}
@@ -105,7 +105,7 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
int s = this.i.size();
for( int x = 0; x < s; x++ )
@@ -113,20 +113,20 @@ public class AdaptorList extends InventoryAdaptor
ItemStack is = this.i.get( x );
if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
if( how_many > is.stackSize )
if( amount > is.stackSize )
{
how_many = is.stackSize;
amount = is.stackSize;
}
if( destination != null && !destination.canInsert( is ) )
{
how_many = 0;
amount = 0;
}
if( how_many > 0 )
if( amount > 0 )
{
ItemStack rv = is.copy();
rv.stackSize = how_many;
is.stackSize -= how_many;
rv.stackSize = amount;
is.stackSize -= amount;
// remove it..
if( is.stackSize <= 0 )
@@ -36,17 +36,17 @@ import appeng.util.iterators.NullIterator;
public class AdaptorPlayerHand extends InventoryAdaptor
{
private final EntityPlayer p;
private final EntityPlayer player;
public AdaptorPlayerHand( EntityPlayer _p )
public AdaptorPlayerHand( EntityPlayer player )
{
this.p = _p;
this.player = player;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
{
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -59,7 +59,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
hand.stackSize -= amount;
if( hand.stackSize <= 0 )
{
this.p.inventory.setItemStack( null );
this.player.inventory.setItemStack( null );
}
return result;
}
@@ -71,7 +71,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
{
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -88,22 +88,22 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
}
if( Filter == null || Platform.isSameItemFuzzy( Filter, hand, fuzzyMode ) )
if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) )
{
ItemStack result = hand.copy();
result.stackSize = hand.stackSize > how_many ? how_many : hand.stackSize;
hand.stackSize -= how_many;
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
hand.stackSize -= amount;
if( hand.stackSize <= 0 )
{
this.p.inventory.setItemStack( null );
this.player.inventory.setItemStack( null );
}
return result;
}
@@ -112,16 +112,16 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
}
if( Filter == null || Platform.isSameItemFuzzy( Filter, hand, fuzzyMode ) )
if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) )
{
ItemStack result = hand.copy();
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
@@ -143,16 +143,16 @@ public class AdaptorPlayerHand extends InventoryAdaptor
{
return null;
}
if( this.p == null )
if( this.player == null )
{
return toBeAdded;
}
if( this.p.inventory == null )
if( this.player.inventory == null )
{
return toBeAdded;
}
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( hand != null && !Platform.isSameItemPrecise( toBeAdded, hand ) )
{
@@ -177,18 +177,18 @@ public class AdaptorPlayerHand extends InventoryAdaptor
newHand.stackSize = newHand.getMaxStackSize();
ItemStack B = toBeAdded.copy();
B.stackSize -= newHand.stackSize - original;
this.p.inventory.setItemStack( newHand );
this.player.inventory.setItemStack( newHand );
return B;
}
this.p.inventory.setItemStack( newHand );
this.player.inventory.setItemStack( newHand );
return null;
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
{
ItemStack hand = this.p.inventory.getItemStack();
ItemStack hand = this.player.inventory.getItemStack();
if( toBeSimulated == null )
{
return null;
@@ -226,7 +226,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
@Override
public boolean containsItems()
{
return this.p.inventory.getItemStack() != null;
return this.player.inventory.getItemStack() != null;
}
@Override
+12 -12
View File
@@ -21,10 +21,10 @@ package appeng.util.inv;
import java.util.Iterator;
import net.minecraft.item.ItemStack;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode;
@@ -66,11 +66,11 @@ public class IMEAdaptor extends InventoryAdaptor
return this.doRemoveItems( amount, filter, destination, Actionable.MODULATE );
}
public ItemStack doRemoveItems( int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type )
public ItemStack doRemoveItems( int amount, ItemStack filter, IInventoryDestination destination, Actionable type )
{
IAEItemStack req = null;
if( Filter == null )
if( filter == null )
{
IItemList<IAEItemStack> list = this.getList();
if( !list.isEmpty() )
@@ -80,14 +80,14 @@ public class IMEAdaptor extends InventoryAdaptor
}
else
{
req = AEItemStack.create( Filter );
req = AEItemStack.create( filter );
}
IAEItemStack out = null;
if( req != null )
{
req.setStackSize( how_many );
req.setStackSize( amount );
out = this.target.extractItems( req, type, this.src );
}
@@ -106,18 +106,18 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
if( filter == null )
{
return this.doRemoveItems( how_many, null, destination, Actionable.MODULATE );
return this.doRemoveItems( amount, null, destination, Actionable.MODULATE );
}
return this.doRemoveItemsFuzzy( how_many, filter, destination, Actionable.MODULATE, fuzzyMode );
return this.doRemoveItemsFuzzy( amount, filter, destination, Actionable.MODULATE, fuzzyMode );
}
public ItemStack doRemoveItemsFuzzy( int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode )
public ItemStack doRemoveItemsFuzzy( int amount, ItemStack filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode )
{
IAEItemStack reqFilter = AEItemStack.create( Filter );
IAEItemStack reqFilter = AEItemStack.create( filter );
if( reqFilter == null )
{
return null;
@@ -129,7 +129,7 @@ public class IMEAdaptor extends InventoryAdaptor
{
if( req != null )
{
req.setStackSize( how_many );
req.setStackSize( amount );
out = this.target.extractItems( req, type, this.src );
if( out != null )
{
@@ -44,13 +44,13 @@ public class WrapperInventoryRange implements IInventory
this.ignoreValidItems = ignoreValid;
}
public WrapperInventoryRange( IInventory a, int _min, int _size, boolean ignoreValid )
public WrapperInventoryRange( IInventory a, int min, int size, boolean ignoreValid )
{
this.src = a;
this.slots = new int[_size];
for( int x = 0; x < _size; x++ )
this.slots = new int[size];
for( int x = 0; x < size; x++ )
{
this.slots[x] = _min + x;
this.slots[x] = min + x;
}
this.ignoreValidItems = ignoreValid;
}
+13 -13
View File
@@ -259,7 +259,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
}
@Override
public boolean fuzzyComparison( Object st, FuzzyMode Mode )
public boolean fuzzyComparison( Object st, FuzzyMode mode )
{
if( st instanceof IAEItemStack )
{
@@ -279,11 +279,11 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
try
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamageForDisplay() > 1 ) == ( b.getItemDamageForDisplay() > 1 );
}
@@ -292,16 +292,16 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage();
float BPercentDamaged = 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
catch( Throwable e )
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamage() > 1 ) == ( b.getItemDamage() > 1 );
}
@@ -310,7 +310,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage();
float BPercentDamaged = (float) b.getItemDamage() / (float) b.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
}
@@ -333,11 +333,11 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
try
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamageForDisplay() > 1 ) == ( o.getItemDamageForDisplay() > 1 );
}
@@ -346,16 +346,16 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
float APercentDamaged = 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage();
float BPercentDamaged = 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
catch( Throwable e )
{
if( Mode == FuzzyMode.IGNORE_ALL )
if( mode == FuzzyMode.IGNORE_ALL )
{
return true;
}
else if( Mode == FuzzyMode.PERCENT_99 )
else if( mode == FuzzyMode.PERCENT_99 )
{
return ( a.getItemDamage() > 1 ) == ( o.getItemDamage() > 1 );
}
@@ -364,7 +364,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
float APercentDamaged = (float) a.getItemDamage() / (float) a.getMaxDamage();
float BPercentDamaged = (float) o.getItemDamage() / (float) o.getMaxDamage();
return ( APercentDamaged > Mode.breakPoint ) == ( BPercentDamaged > Mode.breakPoint );
return ( APercentDamaged > mode.breakPoint ) == ( BPercentDamaged > mode.breakPoint );
}
}
}
@@ -26,14 +26,14 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.storage.data.IAEItemStack;
@@ -59,13 +59,13 @@ public class OreHelper
/**
* Test if the passed {@link ItemStack} is an ore.
*
* @param ItemStack the itemstack to test
* @param itemStack the itemstack to test
*
* @return true if an ore entry exists, false otherwise
*/
public OreReference isOre( ItemStack ItemStack )
public OreReference isOre( ItemStack itemStack )
{
ItemRef ir = new ItemRef( ItemStack );
ItemRef ir = new ItemRef( itemStack );
if( !this.references.containsKey( ir ) )
{
@@ -85,7 +85,7 @@ public class OreHelper
for( ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) )
{
if( OreDictionary.itemMatches( oreItem, ItemStack, false ) )
if( OreDictionary.itemMatches( oreItem, itemStack, false ) )
{
toAdd.add( ore );
break;