Renamed constants

This commit is contained in:
thatsIch
2015-01-01 22:13:10 +01:00
parent e0175bac98
commit 52c512635d
118 changed files with 511 additions and 508 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ public class BlockUpdate implements Callable
public Object call() throws Exception
{
if ( this.w.blockExists( this.x, this.y, this.z ) )
this.w.notifyBlocksOfNeighborChange( this.x, this.y, this.z, Platform.air );
this.w.notifyBlocksOfNeighborChange( this.x, this.y, this.z, Platform.AIR );
return true;
}
+5 -5
View File
@@ -71,7 +71,7 @@ public class ItemSorters
return 1;
}
public static final Comparator<IAEItemStack> ConfigBased_SortByName = new Comparator<IAEItemStack>() {
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_NAME = new Comparator<IAEItemStack>() {
@Override
public int compare(IAEItemStack o1, IAEItemStack o2)
@@ -82,7 +82,7 @@ public class ItemSorters
}
};
public static final Comparator<IAEItemStack> ConfigBased_SortByMod = new Comparator<IAEItemStack>() {
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_MOD = new Comparator<IAEItemStack>() {
@Override
public int compare(IAEItemStack o1, IAEItemStack o2)
@@ -104,7 +104,7 @@ public class ItemSorters
}
};
public static final Comparator<IAEItemStack> ConfigBased_SortBySize = new Comparator<IAEItemStack>() {
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_SIZE = new Comparator<IAEItemStack>() {
@Override
public int compare(IAEItemStack o1, IAEItemStack o2)
@@ -115,13 +115,13 @@ public class ItemSorters
}
};
public static final Comparator<IAEItemStack> ConfigBased_SortByInvTweaks = new Comparator<IAEItemStack>() {
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_INV_TWEAKS = new Comparator<IAEItemStack>() {
@Override
public int compare(IAEItemStack o1, IAEItemStack o2)
{
if ( api == null )
return ConfigBased_SortByName.compare( o1, o2 );
return CONFIG_BASED_SORT_BY_NAME.compare( o1, o2 );
int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() );
+14 -14
View File
@@ -141,28 +141,28 @@ import appeng.util.prioitylist.IPartitionList;
public class Platform
{
public static final Block air = Blocks.air;
public static final Block AIR = Blocks.air;
public static final int DEF_OFFSET = 16;
/*
* random source, use it for item drop locations...
*/
static private final Random rdnSrc = new Random();
static private final Random RANDOM_GENERATOR = new Random();
public static Random getRandom()
{
return rdnSrc;
return RANDOM_GENERATOR;
}
public static int getRandomInt()
{
return Math.abs( rdnSrc.nextInt() );
return Math.abs( RANDOM_GENERATOR.nextInt() );
}
public static float getRandomFloat()
{
return rdnSrc.nextFloat();
return RANDOM_GENERATOR.nextFloat();
}
/**
@@ -929,19 +929,19 @@ public class Platform
return false;
}
private static final WeakHashMap<World, EntityPlayer> fakePlayers = new WeakHashMap<World, EntityPlayer>();
private static final WeakHashMap<World, EntityPlayer> FAKE_PLAYERS = new WeakHashMap<World, EntityPlayer>();
public static EntityPlayer getPlayer(WorldServer w)
{
if ( w == null )
throw new NullPointerException();
EntityPlayer wrp = fakePlayers.get( w );
EntityPlayer wrp = FAKE_PLAYERS.get( w );
if ( wrp != null )
return wrp;
EntityPlayer p = FakePlayerFactory.getMinecraft( w );
fakePlayers.put( w, p );
FAKE_PLAYERS.put( w, p );
return p;
}
@@ -990,7 +990,7 @@ public class Platform
public static <T> T pickRandom(Collection<T> outs)
{
int index = rdnSrc.nextInt( outs.size() );
int index = RANDOM_GENERATOR.nextInt( outs.size() );
Iterator<T> i = outs.iterator();
while (i.hasNext() && index-- > 0)
i.next();
@@ -1204,10 +1204,10 @@ public class Platform
}
}
OreReference aOR = OreHelper.instance.isOre( a );
OreReference bOR = OreHelper.instance.isOre( b );
OreReference aOR = OreHelper.INSTANCE.isOre( a );
OreReference bOR = OreHelper.INSTANCE.isOre( b );
if ( OreHelper.instance.sameOre( aOR, bOR ) )
if ( OreHelper.INSTANCE.sameOre( aOR, bOR ) )
return true;
/*
@@ -1339,7 +1339,7 @@ public class Platform
public static long nanoTime()
{
// if ( Configuration.instance.enableNetworkProfiler )
// if ( Configuration.INSTANCE.enableNetworkProfiler )
// return System.nanoTime();
return 0;
}
@@ -1746,7 +1746,7 @@ public class Platform
public static void notifyBlocksOfNeighbors(World worldObj, int xCoord, int yCoord, int zCoord)
{
if ( !worldObj.isRemote )
TickHandler.instance.addCallable( worldObj, new BlockUpdate( worldObj, xCoord, yCoord, zCoord ) );
TickHandler.INSTANCE.addCallable( worldObj, new BlockUpdate( worldObj, xCoord, yCoord, zCoord ) );
}
public static boolean canRepair(AEFeature type, ItemStack a, ItemStack b)
@@ -57,8 +57,8 @@ public class AEItemDef
public OreReference isOre;
static final AESharedNBT lowTag = new AESharedNBT( Integer.MIN_VALUE );
static final AESharedNBT highTag = new AESharedNBT( Integer.MAX_VALUE );
static final AESharedNBT LOW_TAG = new AESharedNBT( Integer.MIN_VALUE );
static final AESharedNBT HIGH_TAG = new AESharedNBT( Integer.MAX_VALUE );
public AEItemDef(Item it) {
this.item = it;
@@ -110,7 +110,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
this.setCountRequestable( 0 );
this.def.reHash();
this.def.isOre = OreHelper.instance.isOre( is );
this.def.isOre = OreHelper.INSTANCE.isOre( is );
}
public static AEItemStack create(Object a)
@@ -401,7 +401,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public boolean sameOre(IAEItemStack is)
{
return OreHelper.instance.sameOre( this, is );
return OreHelper.INSTANCE.sameOre( this, is );
}
@Override
@@ -467,7 +467,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
ItemStack o = (ItemStack) st;
OreHelper.instance.sameOre( this, o );
OreHelper.INSTANCE.sameOre( this, o );
if ( o.getItem() == this.getItem() )
{
@@ -555,7 +555,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
newDef.damageValue = newDef.displayDamage;
}
newDef.tagCompound = AEItemDef.lowTag;
newDef.tagCompound = AEItemDef.LOW_TAG;
newDef.reHash();
return bottom;
}
@@ -594,7 +594,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
newDef.damageValue = newDef.displayDamage;
}
newDef.tagCompound = AEItemDef.highTag;
newDef.tagCompound = AEItemDef.HIGH_TAG;
newDef.reHash();
return top;
}
@@ -139,14 +139,14 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
/*
* Shared Tag Compound Cache.
*/
private static final WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>> sharedTagCompounds = new WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>>();
private static final WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>> SHARED_TAG_COMPOUND = new WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>>();
/*
* Debug purposes.
*/
public static int sharedTagLoad()
{
return sharedTagCompounds.size();
return SHARED_TAG_COMPOUND.size();
}
/*
@@ -175,7 +175,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound );
WeakReference<SharedSearchObject> c = sharedTagCompounds.get( sso );
WeakReference<SharedSearchObject> c = SHARED_TAG_COMPOUND.get( sso );
if ( c != null )
{
SharedSearchObject cg = c.get();
@@ -193,7 +193,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
sso.shared = clone;
clone.sso = sso;
sharedTagCompounds.put( sso, new WeakReference<SharedSearchObject>( sso ) );
SHARED_TAG_COMPOUND.put( sso, new WeakReference<SharedSearchObject>( sso ) );
return clone;
}
@@ -30,7 +30,7 @@ import appeng.api.storage.data.IAEItemStack;
public class OreHelper
{
public static final OreHelper instance = new OreHelper();
public static final OreHelper INSTANCE = new OreHelper();
static class ItemRef
{
@@ -26,7 +26,7 @@ import appeng.api.storage.data.IAEStack;
public class DefaultPriorityList<T extends IAEStack<T>> implements IPartitionList<T>
{
final static List nullList = new ArrayList();
final static List NULL_LIST = new ArrayList();
@Override
public boolean isListed(T input)
@@ -43,7 +43,7 @@ public class DefaultPriorityList<T extends IAEStack<T>> implements IPartitionLis
@Override
public Iterable<T> getItems()
{
return nullList;
return NULL_LIST;
}
}