Improved readability of variables
Hopefully improved semantics of variables Fixed typos Added hyphenations
This commit is contained in:
@@ -401,11 +401,11 @@ public class GridNode implements IGridNode, IPathItem
|
||||
return new ReadOnlyCollection<IGridConnection>( Connections );
|
||||
}
|
||||
|
||||
public boolean hasConnection(IGridNode otherside)
|
||||
public boolean hasConnection(IGridNode otherSide)
|
||||
{
|
||||
for (IGridConnection gc : Connections)
|
||||
{
|
||||
if ( gc.a() == otherside || gc.b() == otherside )
|
||||
if ( gc.a() == otherSide || gc.b() == otherSide )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class GridStorage implements IGridStorage
|
||||
final NBTTagCompound data;
|
||||
|
||||
public boolean isDirty = false;
|
||||
private WeakHashMap<GridStorage,Boolean> divlist = new WeakHashMap();
|
||||
private WeakHashMap<GridStorage,Boolean> divided = new WeakHashMap();
|
||||
final GridStorageSearch mySearchEntry; // keep myself in the list until I'm
|
||||
// lost...
|
||||
|
||||
@@ -52,8 +52,8 @@ public class GridStorage implements IGridStorage
|
||||
|
||||
try
|
||||
{
|
||||
byte[] dbata = javax.xml.bind.DatatypeConverter.parseBase64Binary( input );
|
||||
myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( dbata ) );
|
||||
byte[] byteData = javax.xml.bind.DatatypeConverter.parseBase64Binary( input );
|
||||
myTag = CompressedStreamTools.readCompressed( new ByteArrayInputStream( byteData ) );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
@@ -125,12 +125,12 @@ public class GridStorage implements IGridStorage
|
||||
|
||||
public void addDivided(GridStorage gs)
|
||||
{
|
||||
divlist.put( gs, true );
|
||||
divided.put( gs, true );
|
||||
}
|
||||
|
||||
public boolean hasDivided(GridStorage myStorage)
|
||||
{
|
||||
return divlist.containsKey( myStorage );
|
||||
return divided.containsKey( myStorage );
|
||||
}
|
||||
|
||||
public void remove()
|
||||
|
||||
+10
-10
@@ -262,13 +262,13 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
for (IGridNode cst : grid.getMachines( TileCraftingStorageTile.class ))
|
||||
{
|
||||
TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine();
|
||||
CraftingCPUCluster clust = (CraftingCPUCluster) tile.getCluster();
|
||||
if ( clust != null )
|
||||
CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster();
|
||||
if ( cluster != null )
|
||||
{
|
||||
cpuClusters.add( clust );
|
||||
cpuClusters.add( cluster );
|
||||
|
||||
if ( clust.myLastLink != null )
|
||||
addLink( (CraftingLink) clust.myLastLink );
|
||||
if ( cluster.myLastLink != null )
|
||||
addLink( (CraftingLink) cluster.myLastLink );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,10 +433,10 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
if ( job.isSimulation() )
|
||||
return null;
|
||||
|
||||
CraftingCPUCluster cpuClust = null;
|
||||
CraftingCPUCluster cpuCluster = null;
|
||||
|
||||
if ( target instanceof CraftingCPUCluster )
|
||||
cpuClust = (CraftingCPUCluster) target;
|
||||
cpuCluster = (CraftingCPUCluster) target;
|
||||
|
||||
if ( target == null )
|
||||
{
|
||||
@@ -471,12 +471,12 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
} );
|
||||
|
||||
if ( !validCpusClusters.isEmpty() )
|
||||
cpuClust = validCpusClusters.get( 0 );
|
||||
cpuCluster = validCpusClusters.get( 0 );
|
||||
}
|
||||
|
||||
if ( cpuClust != null )
|
||||
if ( cpuCluster != null )
|
||||
{
|
||||
return cpuClust.submitJob( grid, job, src, requestingMachine );
|
||||
return cpuCluster.submitJob( grid, job, src, requestingMachine );
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+23
-23
@@ -73,7 +73,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
IAEPowerStorage lastProvider;
|
||||
final Set<IAEPowerStorage> providers = new LinkedHashSet();
|
||||
|
||||
IAEPowerStorage lastRequestor;
|
||||
IAEPowerStorage lastRequester;
|
||||
final Set<IAEPowerStorage> requesters = new LinkedHashSet();
|
||||
|
||||
final public TreeSet<EnergyThreshold> interests = new TreeSet<EnergyThreshold>();
|
||||
@@ -86,15 +86,15 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
return providers.isEmpty() ? 1000.0 : 0.0;
|
||||
}
|
||||
|
||||
private IAEPowerStorage getFirstRequestor()
|
||||
private IAEPowerStorage getFirstRequester()
|
||||
{
|
||||
if ( lastRequestor == null )
|
||||
if ( lastRequester == null )
|
||||
{
|
||||
Iterator<IAEPowerStorage> i = requesters.iterator();
|
||||
lastRequestor = i.hasNext() ? i.next() : null;
|
||||
lastRequester = i.hasNext() ? i.next() : null;
|
||||
}
|
||||
|
||||
return lastRequestor;
|
||||
return lastRequester;
|
||||
}
|
||||
|
||||
private IAEPowerStorage getFirstProvider()
|
||||
@@ -108,7 +108,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
return lastProvider;
|
||||
}
|
||||
|
||||
final Multiset<IEnergyGridProvider> gproviders = HashMultiset.create();
|
||||
final Multiset<IEnergyGridProvider> energyGridProviders = HashMultiset.create();
|
||||
|
||||
final IGrid myGrid;
|
||||
PathGridCache pgc;
|
||||
@@ -182,7 +182,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
required += Math.max( 0.0, node.getAEMaxPower() - node.getAECurrentPower() );
|
||||
}
|
||||
|
||||
Iterator<IEnergyGridProvider> ix = gproviders.iterator();
|
||||
Iterator<IEnergyGridProvider> ix = energyGridProviders.iterator();
|
||||
while (required < maxRequired && ix.hasNext())
|
||||
{
|
||||
IEnergyGridProvider node = ix.next();
|
||||
@@ -216,7 +216,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
amt = node.injectAEPower( amt, Actionable.SIMULATE );
|
||||
}
|
||||
|
||||
Iterator<IEnergyGridProvider> i = gproviders.iterator();
|
||||
Iterator<IEnergyGridProvider> i = energyGridProviders.iterator();
|
||||
while (amt > 0 && i.hasNext())
|
||||
amt = i.next().injectAEPower( amt, mode, seen );
|
||||
}
|
||||
@@ -227,17 +227,17 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
|
||||
while (amt > 0 && !requesters.isEmpty())
|
||||
{
|
||||
IAEPowerStorage node = getFirstRequestor();
|
||||
IAEPowerStorage node = getFirstRequester();
|
||||
|
||||
amt = node.injectAEPower( amt, Actionable.MODULATE );
|
||||
if ( amt > 0 )
|
||||
{
|
||||
requesters.remove( node );
|
||||
lastRequestor = null;
|
||||
lastRequester = null;
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<IEnergyGridProvider> i = gproviders.iterator();
|
||||
Iterator<IEnergyGridProvider> i = energyGridProviders.iterator();
|
||||
while (amt > 0 && i.hasNext())
|
||||
{
|
||||
IEnergyGridProvider what = i.next();
|
||||
@@ -267,13 +267,13 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
public void addNode(IGridNode node, IGridHost machine)
|
||||
{
|
||||
if ( machine instanceof IEnergyGridProvider )
|
||||
gproviders.add( (IEnergyGridProvider) machine );
|
||||
energyGridProviders.add( (IEnergyGridProvider) machine );
|
||||
|
||||
// idle draw...
|
||||
GridNode gnode = (GridNode) node;
|
||||
IGridBlock gb = gnode.getGridBlock();
|
||||
gnode.previousDraw = gb.getIdlePowerUsage();
|
||||
drainPerTick += gnode.previousDraw;
|
||||
GridNode gridNode = (GridNode) node;
|
||||
IGridBlock gb = gridNode.getGridBlock();
|
||||
gridNode.previousDraw = gb.getIdlePowerUsage();
|
||||
drainPerTick += gridNode.previousDraw;
|
||||
|
||||
// power storage
|
||||
if ( machine instanceof IAEPowerStorage )
|
||||
@@ -315,11 +315,11 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
public void removeNode(IGridNode node, IGridHost machine)
|
||||
{
|
||||
if ( machine instanceof IEnergyGridProvider )
|
||||
gproviders.remove( machine );
|
||||
energyGridProviders.remove( machine );
|
||||
|
||||
// idle draw.
|
||||
GridNode gnode = (GridNode) node;
|
||||
drainPerTick -= gnode.previousDraw;
|
||||
GridNode gridNode = (GridNode) node;
|
||||
drainPerTick -= gridNode.previousDraw;
|
||||
|
||||
// power storage.
|
||||
if ( machine instanceof IAEPowerStorage )
|
||||
@@ -336,8 +336,8 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
if ( lastProvider == machine )
|
||||
lastProvider = null;
|
||||
|
||||
if ( lastRequestor == machine )
|
||||
lastRequestor = null;
|
||||
if ( lastRequester == machine )
|
||||
lastRequester = null;
|
||||
|
||||
providers.remove( machine );
|
||||
requesters.remove( machine );
|
||||
@@ -464,7 +464,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
|
||||
if ( extractedPower < amt )
|
||||
{
|
||||
Iterator<IEnergyGridProvider> i = gproviders.iterator();
|
||||
Iterator<IEnergyGridProvider> i = energyGridProviders.iterator();
|
||||
while (extractedPower < amt && i.hasNext())
|
||||
extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen );
|
||||
}
|
||||
@@ -489,7 +489,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
|
||||
if ( extractedPower < amt )
|
||||
{
|
||||
Iterator<IEnergyGridProvider> i = gproviders.iterator();
|
||||
Iterator<IEnergyGridProvider> i = energyGridProviders.iterator();
|
||||
while (extractedPower < amt && i.hasNext())
|
||||
extractedPower += i.next().extractAEPower( amt - extractedPower, mode, seen );
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,10 +31,10 @@ public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<T>, Object> o = i.next();
|
||||
IMEMonitorHandlerReceiver<T> recv = o.getKey();
|
||||
IMEMonitorHandlerReceiver<T> receiver = o.getKey();
|
||||
|
||||
if ( recv.isValid( o.getValue() ) )
|
||||
recv.onListUpdate();
|
||||
if ( receiver.isValid( o.getValue() ) )
|
||||
receiver.onListUpdate();
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class P2PCache implements IGridCache
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void bootComplete(MENetworkBootingStatusChange bootstat)
|
||||
public void bootComplete(MENetworkBootingStatusChange bootStatus)
|
||||
{
|
||||
ITickManager tm = myGrid.getCache( ITickManager.class );
|
||||
for (PartP2PTunnel me : inputs.values())
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache
|
||||
efficiency = 0.0;
|
||||
|
||||
minPower = (double) reqX * (double) reqY * reqZ * AEConfig.instance.spatialPowerMultiplier;
|
||||
maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerScaler );
|
||||
maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerExponent );
|
||||
}
|
||||
|
||||
double affective_efficiency = Math.pow( efficiency, 0.25 );
|
||||
|
||||
@@ -10,24 +10,24 @@ public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T>
|
||||
{
|
||||
|
||||
final Class clz;
|
||||
Collection<T> tunnelsource;
|
||||
Collection<T> tunnelSources;
|
||||
|
||||
public TunnelCollection(Collection<T> src, Class c) {
|
||||
tunnelsource = src;
|
||||
tunnelSources = src;
|
||||
clz = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<T> iterator()
|
||||
{
|
||||
if ( tunnelsource == null )
|
||||
if ( tunnelSources == null )
|
||||
return new NullIterator();
|
||||
return new TunnelIterator( tunnelsource, clz );
|
||||
return new TunnelIterator( tunnelSources, clz );
|
||||
}
|
||||
|
||||
public void setSource(Collection<T> c)
|
||||
{
|
||||
tunnelsource = c;
|
||||
tunnelSources = c;
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
|
||||
@@ -22,8 +22,8 @@ public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T>
|
||||
}
|
||||
}
|
||||
|
||||
public TunnelIterator(Collection<T> tunnelsource, Class clz) {
|
||||
wrapped = tunnelsource.iterator();
|
||||
public TunnelIterator(Collection<T> tunnelSources, Class clz) {
|
||||
wrapped = tunnelSources.iterator();
|
||||
targetType = clz;
|
||||
findNext();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public abstract class MBCalculator
|
||||
public abstract IAECluster createCluster(World w, WorldCoord min, WorldCoord max);
|
||||
|
||||
/**
|
||||
* configure the mutli-block tiles, most of the important stuff is in here.
|
||||
* configure the multi-block tiles, most of the important stuff is in here.
|
||||
*
|
||||
* @param c updated cluster
|
||||
* @param w in world
|
||||
@@ -110,15 +110,15 @@ public abstract class MBCalculator
|
||||
}
|
||||
|
||||
boolean updateGrid = false;
|
||||
IAECluster clust = target.getCluster();
|
||||
if ( clust == null )
|
||||
IAECluster cluster = target.getCluster();
|
||||
if ( cluster == null )
|
||||
{
|
||||
updateTiles( c, w, min, max );
|
||||
|
||||
updateGrid = true;
|
||||
}
|
||||
else
|
||||
c = clust;
|
||||
c = cluster;
|
||||
|
||||
c.updateStatus( updateGrid );
|
||||
return;
|
||||
@@ -135,43 +135,43 @@ public abstract class MBCalculator
|
||||
|
||||
public abstract boolean verifyInternalStructure(World worldObj, WorldCoord min, WorldCoord max);
|
||||
|
||||
public boolean verifyUnownedRegionInner(World w, int minx, int miny, int minz, int maxx, int maxy, int maxz, ForgeDirection side)
|
||||
public boolean verifyUnownedRegionInner(World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ForgeDirection side)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case WEST:
|
||||
minx -= 1;
|
||||
maxx = minx;
|
||||
minX -= 1;
|
||||
maxX = minX;
|
||||
break;
|
||||
case EAST:
|
||||
maxx += 1;
|
||||
minx = maxx;
|
||||
maxX += 1;
|
||||
minX = maxX;
|
||||
break;
|
||||
case DOWN:
|
||||
miny -= 1;
|
||||
maxy = miny;
|
||||
minY -= 1;
|
||||
maxY = minY;
|
||||
break;
|
||||
case NORTH:
|
||||
maxz += 1;
|
||||
minz = maxz;
|
||||
maxZ += 1;
|
||||
minZ = maxZ;
|
||||
break;
|
||||
case SOUTH:
|
||||
minz -= 1;
|
||||
maxz = minz;
|
||||
minZ -= 1;
|
||||
maxZ = minZ;
|
||||
break;
|
||||
case UP:
|
||||
maxy += 1;
|
||||
miny = maxy;
|
||||
maxY += 1;
|
||||
minY = maxY;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int x = minx; x <= maxx; x++)
|
||||
for (int x = minX; x <= maxX; x++)
|
||||
{
|
||||
for (int y = miny; y <= maxy; y++)
|
||||
for (int y = minY; y <= maxY; y++)
|
||||
{
|
||||
for (int z = minz; z <= maxz; z++)
|
||||
for (int z = minZ; z <= maxZ; z++)
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if ( isValidTile( te ) )
|
||||
|
||||
@@ -118,9 +118,9 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<IAEItemStack>, Object> o = i.next();
|
||||
IMEMonitorHandlerReceiver<IAEItemStack> recv = o.getKey();
|
||||
if ( recv.isValid( o.getValue() ) )
|
||||
recv.postChange( null, single, src );
|
||||
IMEMonitorHandlerReceiver<IAEItemStack> receiver = o.getKey();
|
||||
if ( receiver.isValid( o.getValue() ) )
|
||||
receiver.postChange( null, single, src );
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
@@ -552,21 +552,21 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
do
|
||||
{
|
||||
didsomething = false;
|
||||
somethingChanged = false;
|
||||
executeCrafting( eg, cc );
|
||||
}
|
||||
while (didsomething && remainingOperations > 0);
|
||||
while (somethingChanged && remainingOperations > 0);
|
||||
}
|
||||
usedOps[2] = usedOps[1];
|
||||
usedOps[1] = usedOps[0];
|
||||
usedOps[0] = started - remainingOperations;
|
||||
|
||||
if ( remainingOperations > 0 && didsomething == false )
|
||||
if ( remainingOperations > 0 && somethingChanged == false )
|
||||
waiting = true;
|
||||
}
|
||||
|
||||
private int remainingOperations;
|
||||
private boolean didsomething;
|
||||
private boolean somethingChanged;
|
||||
|
||||
private void executeCrafting(IEnergyGrid eg, CraftingGridCache cc)
|
||||
{
|
||||
@@ -677,7 +677,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
if ( m.pushPattern( details, ic ) )
|
||||
{
|
||||
didsomething = true;
|
||||
somethingChanged = true;
|
||||
remainingOperations--;
|
||||
|
||||
for (IAEItemStack out : details.getCondensedOutputs())
|
||||
|
||||
@@ -25,17 +25,17 @@ public class PathSegment
|
||||
|
||||
PathGridCache pgc;
|
||||
|
||||
public PathSegment(PathGridCache myPGC, List open, Set semiopen, Set closed)
|
||||
public PathSegment(PathGridCache myPGC, List open, Set semiOpen, Set closed)
|
||||
{
|
||||
this.open = open;
|
||||
this.semiopen = semiopen;
|
||||
this.semiOpen = semiOpen;
|
||||
this.closed = closed;
|
||||
pgc = myPGC;
|
||||
isDead = false;
|
||||
}
|
||||
|
||||
List<IPathItem> open;
|
||||
Set<IPathItem> semiopen;
|
||||
Set<IPathItem> semiOpen;
|
||||
Set<IPathItem> closed;
|
||||
|
||||
public boolean step()
|
||||
@@ -56,7 +56,7 @@ public class PathSegment
|
||||
if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) )
|
||||
{
|
||||
// close the semi open.
|
||||
if ( !semiopen.contains( pi ) )
|
||||
if ( !semiOpen.contains( pi ) )
|
||||
{
|
||||
boolean worked = false;
|
||||
|
||||
@@ -72,14 +72,14 @@ public class PathSegment
|
||||
{
|
||||
IGridNode otherNodes = oni.next();
|
||||
if ( otherNodes != pi )
|
||||
semiopen.add( (IPathItem) otherNodes );
|
||||
semiOpen.add( (IPathItem) otherNodes );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pi.incrementChannelCount( 1 ); // give a channel.
|
||||
semiopen.remove( pi );
|
||||
semiOpen.remove( pi );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ public class CellInventory implements ICellInventory
|
||||
static final String ITEM_TYPE_TAG = "it";
|
||||
static final String ITEM_COUNT_TAG = "ic";
|
||||
static final String ITEM_SLOT = "#";
|
||||
static final String ITEM_SLOTCOUNT = "@";
|
||||
static final String ITEM_SLOT_COUNT = "@";
|
||||
static final String ITEM_PRE_FORMATTED_COUNT = "PF";
|
||||
static final String ITEM_PRE_FORMATTED_SLOT = "PF#";
|
||||
static final String ITEM_PRE_FORMATTED_NAME = "PN";
|
||||
static final String ITEM_PRE_FORMATTED_FUZZY = "FP";
|
||||
|
||||
static protected String[] ITEM_SLOT_ARR;
|
||||
static protected String[] ITEM_SLOTCOUNT_ARR;
|
||||
static protected String[] ITEM_SLOT_COUNT_ARR;
|
||||
|
||||
final protected NBTTagCompound tagCompound;
|
||||
protected int MAX_ITEM_TYPES = 63;
|
||||
@@ -70,7 +70,7 @@ public class CellInventory implements ICellInventory
|
||||
ItemStack t = ItemStack.loadItemStackFromNBT( tagCompound.getCompoundTag( ITEM_SLOT_ARR[x] ) );
|
||||
if ( t != null )
|
||||
{
|
||||
t.stackSize = tagCompound.getInteger( ITEM_SLOTCOUNT_ARR[x] );
|
||||
t.stackSize = tagCompound.getInteger( ITEM_SLOT_COUNT_ARR[x] );
|
||||
|
||||
if ( t.stackSize > 0 )
|
||||
{
|
||||
@@ -106,17 +106,17 @@ public class CellInventory implements ICellInventory
|
||||
}
|
||||
|
||||
/*
|
||||
* NBTBase tagSlotCount = tagCompound.getTag( ITEM_SLOTCOUNT_ARR[x] ); if ( tagSlotCount instanceof
|
||||
* NBTBase tagSlotCount = tagCompound.getTag( ITEM_SLOT_COUNT_ARR[x] ); if ( tagSlotCount instanceof
|
||||
* NBTTagInt ) ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else
|
||||
*/
|
||||
tagCompound.setInteger( ITEM_SLOTCOUNT_ARR[x], (int) v.getStackSize() );
|
||||
tagCompound.setInteger( ITEM_SLOT_COUNT_ARR[x], (int) v.getStackSize() );
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
// NBTBase tagType = tagCompound.getTag( ITEM_TYPE_TAG );
|
||||
// NBTBase tagCount = tagCompound.getTag( ITEM_COUNT_TAG );
|
||||
short oldStoreditems = storedItems;
|
||||
short oldStoredItems = storedItems;
|
||||
|
||||
/*
|
||||
* if ( tagType instanceof NBTTagShort ) ((NBTTagShort) tagType).data = storedItems = (short) cellItems.size();
|
||||
@@ -130,10 +130,10 @@ public class CellInventory implements ICellInventory
|
||||
tagCompound.setInteger( ITEM_COUNT_TAG, storedItemCount = itemCount );
|
||||
|
||||
// clean any old crusty stuff...
|
||||
for (; x < oldStoreditems && x < MAX_ITEM_TYPES; x++)
|
||||
for (; x < oldStoredItems && x < MAX_ITEM_TYPES; x++)
|
||||
{
|
||||
tagCompound.removeTag( ITEM_SLOT_ARR[x] );
|
||||
tagCompound.removeTag( ITEM_SLOTCOUNT_ARR[x] );
|
||||
tagCompound.removeTag( ITEM_SLOT_COUNT_ARR[x] );
|
||||
}
|
||||
|
||||
if ( container != null )
|
||||
@@ -144,12 +144,12 @@ public class CellInventory implements ICellInventory
|
||||
if ( ITEM_SLOT_ARR == null )
|
||||
{
|
||||
ITEM_SLOT_ARR = new String[MAX_ITEM_TYPES];
|
||||
ITEM_SLOTCOUNT_ARR = new String[MAX_ITEM_TYPES];
|
||||
ITEM_SLOT_COUNT_ARR = new String[MAX_ITEM_TYPES];
|
||||
|
||||
for (int x = 0; x < MAX_ITEM_TYPES; x++)
|
||||
{
|
||||
ITEM_SLOT_ARR[x] = ITEM_SLOT + x;
|
||||
ITEM_SLOTCOUNT_ARR[x] = ITEM_SLOTCOUNT + x;
|
||||
ITEM_SLOT_COUNT_ARR[x] = ITEM_SLOT_COUNT + x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,9 +349,9 @@ public class CellInventory implements ICellInventory
|
||||
return blackList.contains( (input.getItemDamage() << Platform.DEF_OFFSET) | Item.getIdFromItem( input.getItem() ) );
|
||||
}
|
||||
|
||||
private boolean isEmpty(IMEInventory meinv)
|
||||
private boolean isEmpty(IMEInventory meInventory)
|
||||
{
|
||||
return meinv.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty();
|
||||
return meInventory.getAvailableItems( AEApi.instance().storage().createItemList() ).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -369,8 +369,8 @@ public class CellInventory implements ICellInventory
|
||||
|
||||
if ( CellInventory.isStorageCell( sharedItemStack ) )
|
||||
{
|
||||
IMEInventory meinv = getCell( sharedItemStack, null );
|
||||
if ( meinv != null && !isEmpty( meinv ) )
|
||||
IMEInventory meInventory = getCell( sharedItemStack, null );
|
||||
if ( meInventory != null && !isEmpty( meInventory ) )
|
||||
return input;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack> imple
|
||||
{
|
||||
Object o = this.internal;
|
||||
|
||||
if ( o instanceof MEPassthru )
|
||||
o = ((MEPassthru) o).getInternal();
|
||||
if ( o instanceof MEPassThrough )
|
||||
o = ((MEPassThrough) o).getInternal();
|
||||
|
||||
return (ICellInventory) (o instanceof ICellInventory ? o : null);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
if ( i instanceof IMEInventoryHandler )
|
||||
internal = (IMEInventoryHandler<T>) i;
|
||||
else
|
||||
internal = new MEPassthru<T>( i, channel );
|
||||
internal = new MEPassThrough<T>( i, channel );
|
||||
|
||||
monitor = internal instanceof IMEMonitor ? (IMEMonitor<T>) internal : null;
|
||||
}
|
||||
|
||||
+8
-8
@@ -15,7 +15,7 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.ItemListIgnoreCrafting;
|
||||
|
||||
public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> implements IMEMonitor<T>, IMEMonitorHandlerReceiver<T>
|
||||
public class MEMonitorPassThrough<T extends IAEStack<T>> extends MEPassThrough<T> implements IMEMonitor<T>, IMEMonitorHandlerReceiver<T>
|
||||
{
|
||||
|
||||
HashMap<IMEMonitorHandlerReceiver<T>, Object> listeners = new HashMap();
|
||||
@@ -23,7 +23,7 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
|
||||
public BaseActionSource changeSource;
|
||||
|
||||
public MEMonitorPassthu(IMEInventory<T> i, StorageChannel channel) {
|
||||
public MEMonitorPassThrough(IMEInventory<T> i, StorageChannel channel) {
|
||||
super( i, channel );
|
||||
if ( i instanceof IMEMonitor )
|
||||
monitor = (IMEMonitor<T>) i;
|
||||
@@ -96,9 +96,9 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<T>, Object> e = i.next();
|
||||
IMEMonitorHandlerReceiver<T> recv = e.getKey();
|
||||
if ( recv.isValid( e.getValue() ) )
|
||||
recv.postChange( this, change, source );
|
||||
IMEMonitorHandlerReceiver<T> receiver = e.getKey();
|
||||
if ( receiver.isValid( e.getValue() ) )
|
||||
receiver.postChange( this, change, source );
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
@@ -111,9 +111,9 @@ public class MEMonitorPassthu<T extends IAEStack<T>> extends MEPassthru<T> imple
|
||||
while (i.hasNext())
|
||||
{
|
||||
Entry<IMEMonitorHandlerReceiver<T>, Object> e = i.next();
|
||||
IMEMonitorHandlerReceiver<T> recv = e.getKey();
|
||||
if ( recv.isValid( e.getValue() ) )
|
||||
recv.onListUpdate();
|
||||
IMEMonitorHandlerReceiver<T> receiver = e.getKey();
|
||||
if ( receiver.isValid( e.getValue() ) )
|
||||
receiver.onListUpdate();
|
||||
else
|
||||
i.remove();
|
||||
}
|
||||
+2
-2
@@ -9,7 +9,7 @@ import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
|
||||
public class MEPassthru<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
public class MEPassThrough<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
{
|
||||
|
||||
private IMEInventory<T> internal;
|
||||
@@ -20,7 +20,7 @@ public class MEPassthru<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
return internal;
|
||||
}
|
||||
|
||||
public MEPassthru(IMEInventory<T> i, StorageChannel channel) {
|
||||
public MEPassThrough(IMEInventory<T> i, StorageChannel channel) {
|
||||
this.channel = channel;
|
||||
setInternal( i );
|
||||
}
|
||||
Reference in New Issue
Block a user