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
+9 -9
View File
@@ -58,22 +58,22 @@ import appeng.util.SettingsFrom;
public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, ICustomNameObject
{
static private final HashMap<Class, EnumMap<TileEventType, List<AETileEventHandler>>> handlers = new HashMap<Class, EnumMap<TileEventType, List<AETileEventHandler>>>();
static private final HashMap<Class, ItemStackSrc> myItem = new HashMap<Class, ItemStackSrc>();
static private final HashMap<Class, EnumMap<TileEventType, List<AETileEventHandler>>> HANDLERS = new HashMap<Class, EnumMap<TileEventType, List<AETileEventHandler>>>();
static private final HashMap<Class, ItemStackSrc> ITEM_STACKS = new HashMap<Class, ItemStackSrc>();
private ForgeDirection forward = ForgeDirection.UNKNOWN;
private ForgeDirection up = ForgeDirection.UNKNOWN;
public static final ThreadLocal<WeakReference<AEBaseTile>> dropNoItems = new ThreadLocal<WeakReference<AEBaseTile>>();
public static final ThreadLocal<WeakReference<AEBaseTile>> DROP_NO_ITEMS = new ThreadLocal<WeakReference<AEBaseTile>>();
public void disableDrops()
{
dropNoItems.set( new WeakReference<AEBaseTile>( this ) );
DROP_NO_ITEMS.set( new WeakReference<AEBaseTile>( this ) );
}
public boolean dropItems()
{
WeakReference<AEBaseTile> what = dropNoItems.get();
WeakReference<AEBaseTile> what = DROP_NO_ITEMS.get();
return what == null || what.get() != this;
}
@@ -92,12 +92,12 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
static public void registerTileItem(Class c, ItemStackSrc wat)
{
myItem.put( c, wat );
ITEM_STACKS.put( c, wat );
}
protected ItemStack getItemFromTile(Object obj)
{
ItemStackSrc src = myItem.get( obj.getClass() );
ItemStackSrc src = ITEM_STACKS.get( obj.getClass() );
if ( src == null )
return null;
return src.stack( 1 );
@@ -112,11 +112,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
protected List<AETileEventHandler> getHandlerListFor(TileEventType type)
{
Class clz = this.getClass();
EnumMap<TileEventType, List<AETileEventHandler>> handlerSet = handlers.get( clz );
EnumMap<TileEventType, List<AETileEventHandler>> handlerSet = HANDLERS.get( clz );
if ( handlerSet == null )
{
handlers.put( clz, handlerSet = new EnumMap<TileEventType, List<AETileEventHandler>>( TileEventType.class ) );
HANDLERS.put( clz, handlerSet = new EnumMap<TileEventType, List<AETileEventHandler>>( TileEventType.class ) );
for (Method m : clz.getMethods())
{
@@ -25,9 +25,9 @@ import appeng.api.AEApi;
public class TileCraftingStorageTile extends TileCraftingTile
{
static final ItemStack stackStorage4k = AEApi.instance().blocks().blockCraftingStorage4k.stack( 1 );
static final ItemStack stackStorage16k = AEApi.instance().blocks().blockCraftingStorage16k.stack( 1 );
static final ItemStack stackStorage64k = AEApi.instance().blocks().blockCraftingStorage64k.stack( 1 );
static final ItemStack STACK_4K_STORAGE = AEApi.instance().blocks().blockCraftingStorage4k.stack( 1 );
static final ItemStack STACK_16K_STORAGE = AEApi.instance().blocks().blockCraftingStorage16k.stack( 1 );
static final ItemStack STACK_64K_STORAGE = AEApi.instance().blocks().blockCraftingStorage64k.stack( 1 );
@Override
protected ItemStack getItemFromTile(Object obj)
@@ -35,11 +35,11 @@ public class TileCraftingStorageTile extends TileCraftingTile
int storage = ((TileCraftingTile) obj).getStorageBytes() / 1024;
if ( storage == 4 )
return stackStorage4k;
return STACK_4K_STORAGE;
if ( storage == 16 )
return stackStorage16k;
return STACK_16K_STORAGE;
if ( storage == 64 )
return stackStorage64k;
return STACK_64K_STORAGE;
return super.getItemFromTile( obj );
}
@@ -63,7 +63,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
public NBTTagCompound previousState = null;
public boolean isCoreBlock = false;
static final ItemStack coProcessorStack = AEApi.instance().blocks().blockCraftingAccelerator.stack( 1 );
static final ItemStack STACK_CO_PROCESSOR = AEApi.instance().blocks().blockCraftingAccelerator.stack( 1 );
@Override
protected AENetworkProxy createProxy()
@@ -75,7 +75,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
protected ItemStack getItemFromTile(Object obj)
{
if ( ((TileCraftingTile) obj).isAccelerator() )
return coProcessorStack;
return STACK_CO_PROCESSOR;
return super.getItemFromTile( obj );
}
@@ -77,13 +77,13 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
IGridTickable, ICraftingMachine, IPowerChannelState
{
private static final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static final ItemStack assemblerStack = AEApi.instance().blocks().blockMolecularAssembler.stack( 1 );
private static final int[] SIDES = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static final ItemStack STACK_ASSEMBLER = AEApi.instance().blocks().blockMolecularAssembler.stack( 1 );
private final InventoryCrafting craftingInv = new InventoryCrafting( new ContainerNull(), 3, 3 );
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 9 + 2 );
private final IConfigManager settings = new ConfigManager( this );
private final UpgradeInventory upgrades = new UpgradeInventory( assemblerStack, this, this.getUpgradeSlots() );
private final UpgradeInventory upgrades = new UpgradeInventory( STACK_ASSEMBLER, this, this.getUpgradeSlots() );
private ForgeDirection pushDirection = ForgeDirection.UNKNOWN;
private ItemStack myPattern = null;
@@ -306,7 +306,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
@Override
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide)
{
return sides;
return SIDES;
}
@Override
@@ -97,7 +97,7 @@ public class TileCrank extends AEBaseTile implements ICustomCollision
public void setOrientation(ForgeDirection inForward, ForgeDirection inUp)
{
super.setOrientation( inForward, inUp );
this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.air );
this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.AIR );
}
/**
@@ -49,7 +49,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
public void setOrientation(ForgeDirection inForward, ForgeDirection inUp)
{
super.setOrientation( inForward, inUp );
this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.air );
this.getBlockType().onNeighborBlockChange( this.worldObj, this.xCoord, this.yCoord, this.zCoord, Platform.AIR );
}
private void addItem(InventoryAdaptor sia, ItemStack output)
@@ -46,7 +46,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
{
final int[] sides = new int[] { 0, 1 };
static private final FluidTankInfo[] empty = new FluidTankInfo[] { new FluidTankInfo( null, 10 ) };
static private final FluidTankInfo[] EMPTY = new FluidTankInfo[] { new FluidTankInfo( null, 10 ) };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 3 );
final ConfigManager cm = new ConfigManager( this );
@@ -241,7 +241,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from)
{
return empty;
return EMPTY;
}
@Override
@@ -78,9 +78,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
public long clientStart;
static final ItemStack inscriberStack = AEApi.instance().blocks().blockInscriber.stack( 1 );
static final ItemStack STACK_INSCRIBER = AEApi.instance().blocks().blockInscriber.stack( 1 );
private final IConfigManager settings = new ConfigManager( this );
private final UpgradeInventory upgrades = new UpgradeInventory( inscriberStack, this, this.getUpgradeSlots() );
private final UpgradeInventory upgrades = new UpgradeInventory( STACK_INSCRIBER, this, this.getUpgradeSlots() );
@Override
public AECableType getCableConnectionType(ForgeDirection dir)
@@ -207,7 +207,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
if ( AEApi.instance().materials().materialNamePress.sameAsStack( itemstack ) )
return true;
for (ItemStack s : Inscribe.plates)
for (ItemStack s : Inscribe.PLATES )
if ( Platform.isSameItemPrecise( s, itemstack ) )
return true;
}
@@ -308,7 +308,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
}
for (InscriberRecipe i : Inscribe.recipes)
for (InscriberRecipe i : Inscribe.RECIPES )
{
boolean matchA = (PlateA == null && i.plateA == null) || (Platform.isSameItemPrecise( PlateA, i.plateA )) && // and...
@@ -153,7 +153,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
public void validate()
{
super.validate();
TickHandler.instance.addInit( this );
TickHandler.INSTANCE.addInit( this );
}
@Override
@@ -348,7 +348,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
return;
}
this.getWorldObj().setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.air );
this.getWorldObj().setBlock( this.xCoord, this.yCoord, this.zCoord, Platform.AIR );
}
/**
@@ -97,7 +97,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable
ItemStack cell = this.getStackInSlot( 0 );
if ( this.isSpatialCell( cell ) )
{
TickHandler.instance.addCallable( null, this );// this needs to be cross world synced.
TickHandler.INSTANCE.addCallable( null, this );// this needs to be cross world synced.
}
}
}
@@ -101,11 +101,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
}
static final ChestNoHandler noHandler = new ChestNoHandler();
static final ChestNoHandler NO_HANDLER = new ChestNoHandler();
static final int[] sides = new int[] { 0 };
static final int[] front = new int[] { 1 };
static final int[] noSlots = new int[] { };
static final int[] SIDES = new int[] { 0 };
static final int[] FRONT = new int[] { 1 };
static final int[] NO_SLOTS = new int[] { };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
final BaseActionSource mySrc = new MachineSource( this );
@@ -471,11 +471,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
{
case FLUIDS:
if ( this.fluidCell == null )
throw noHandler;
throw NO_HANDLER;
return this.fluidCell;
case ITEMS:
if ( this.itemCell == null )
throw noHandler;
throw NO_HANDLER;
return this.itemCell;
default:
}
@@ -582,21 +582,21 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
public int[] getAccessibleSlotsBySide(ForgeDirection side)
{
if ( ForgeDirection.SOUTH == side )
return front;
return FRONT;
if ( this.isPowered() )
{
try
{
if ( this.getHandler( StorageChannel.ITEMS ) != null )
return sides;
return SIDES;
}
catch (ChestNoHandler e)
{
// nope!
}
}
return noSlots;
return NO_SLOTS;
}
@Override