Finished implementing Induction Matrix core functionality, just about everything works! Need to redesign GUI to include separate gauge for output rate

This commit is contained in:
Aidan C. Brady committed 2015-03-03 18:18:32 -05:00
1 parent 2ed43e5328
commit 9260414177
22 files changed
+273 -142

No files matched your search

@@ -83,6 +83,7 @@ public class MatrixUpdateProtocol extends UpdateProtocol<SynchronizedMatrixData>
{
structure.cells.add(coord);
structure.storageCap += ((TileEntityInductionCell)tile).tier.MAX_ELECTRICITY;
structure.electricityStored += ((TileEntityInductionCell)tile).getEnergy();
}
else if(tile instanceof TileEntityInductionProvider)
{
@@ -95,13 +96,13 @@ public class MatrixUpdateProtocol extends UpdateProtocol<SynchronizedMatrixData>
@Override
protected void onStructureDestroyed(SynchronizedMatrixData structure)
{
if(structure.electricityStored <= 0)
{
return;
}
for(Coord4D coord : structure.cells)
{
if(structure.electricityStored == 0)
{
break;
}
if(coord.getTileEntity(pointer.getWorldObj()) instanceof TileEntityInductionCell)
{
TileEntityInductionCell cell = (TileEntityInductionCell)coord.getTileEntity(pointer.getWorldObj());
@@ -110,6 +111,11 @@ public class MatrixUpdateProtocol extends UpdateProtocol<SynchronizedMatrixData>
cell.setEnergy(cell.getEnergy()+toAdd);
structure.electricityStored -= toAdd;
}
if(structure.electricityStored <= 0)
{
break;
}
}
}
}