Working Towards Crafing CPU MultiBlock
This commit is contained in:
@@ -7,7 +7,6 @@ import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
public class CraftingCPUCalculator extends MBCalculator
|
||||
{
|
||||
@@ -22,19 +21,41 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
@Override
|
||||
public boolean isValidTile(TileEntity te)
|
||||
{
|
||||
return te instanceof TileQuantumBridge;
|
||||
return te instanceof TileCraftingTile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMultiblockScale(WorldCoord min, WorldCoord max)
|
||||
{
|
||||
if ( max.x - min.x > 8 )
|
||||
return false;
|
||||
|
||||
if ( max.y - min.y > 8 )
|
||||
return false;
|
||||
|
||||
if ( max.z - min.z > 8 )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max)
|
||||
{
|
||||
CraftingCPUCluster c = (CraftingCPUCluster) cl;
|
||||
|
||||
for (int x = min.x; x <= max.x; x++)
|
||||
{
|
||||
for (int y = min.y; y <= max.y; y++)
|
||||
{
|
||||
for (int z = min.z; z <= max.z; z++)
|
||||
{
|
||||
TileCraftingTile te = (TileCraftingTile) w.getTileEntity( x, y, z );
|
||||
te.updateStatus( c );
|
||||
c.addTile( te );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +73,6 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
@Override
|
||||
public boolean verifyInternalStructure(World w, WorldCoord min, WorldCoord max)
|
||||
{
|
||||
|
||||
for (int x = min.x; x <= max.x; x++)
|
||||
{
|
||||
for (int y = min.y; y <= max.y; y++)
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.LinkedList;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
|
||||
public class CraftingCPUCluster implements IAECluster
|
||||
{
|
||||
@@ -14,12 +15,16 @@ public class CraftingCPUCluster implements IAECluster
|
||||
public WorldCoord max;
|
||||
public boolean isDestroyed = false;
|
||||
|
||||
private LinkedList<IGridHost> tiles = new LinkedList();
|
||||
private LinkedList<TileCraftingTile> tiles = new LinkedList();
|
||||
|
||||
int accelerator = 0;
|
||||
private LinkedList<TileCraftingTile> storage = new LinkedList<TileCraftingTile>();
|
||||
private LinkedList<TileCraftingTile> status = new LinkedList<TileCraftingTile>();
|
||||
|
||||
@Override
|
||||
public Iterator<IGridHost> getTiles()
|
||||
{
|
||||
return tiles.iterator();
|
||||
return (Iterator) tiles.iterator();
|
||||
}
|
||||
|
||||
public CraftingCPUCluster(WorldCoord _min, WorldCoord _max) {
|
||||
@@ -30,7 +35,10 @@ public class CraftingCPUCluster implements IAECluster
|
||||
@Override
|
||||
public void updateStatus(boolean updateGrid)
|
||||
{
|
||||
|
||||
for (TileCraftingTile r : tiles)
|
||||
{
|
||||
r.updateMeta();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,6 +48,22 @@ public class CraftingCPUCluster implements IAECluster
|
||||
return;
|
||||
isDestroyed = true;
|
||||
|
||||
for (TileCraftingTile r : tiles)
|
||||
{
|
||||
r.updateStatus( null );
|
||||
}
|
||||
}
|
||||
|
||||
public void addTile(TileCraftingTile te)
|
||||
{
|
||||
tiles.add( te );
|
||||
|
||||
if ( te.isStorage() )
|
||||
storage.add( te );
|
||||
else if ( te.isStatus() )
|
||||
status.add( te );
|
||||
else if ( te.isAccelerator() )
|
||||
accelerator++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user