Spacing cleanup
This commit is contained in:
parent
dde9b53447
commit
22db67c895
6 changed files with 44 additions and 17 deletions
|
@ -92,6 +92,7 @@ public class FusionReactor implements IFusionReactor
|
|||
lastCaseTemperature = caseTemperature;
|
||||
return;
|
||||
}
|
||||
|
||||
//Only thermal transfer happens unless we're hot enough to burn.
|
||||
if(plasmaTemperature >= burnTemperature)
|
||||
{
|
||||
|
@ -100,6 +101,7 @@ public class FusionReactor implements IFusionReactor
|
|||
{
|
||||
vaporiseHohlraum();
|
||||
}
|
||||
|
||||
//Only inject fuel if we're burning
|
||||
if(burning)
|
||||
{
|
||||
|
@ -124,10 +126,12 @@ public class FusionReactor implements IFusionReactor
|
|||
{
|
||||
getFuelTank().receive(new GasStack(GasRegistry.getGas("fusionFuelDT"), 10), true);
|
||||
controller.inventory[0].stackSize -= 1;
|
||||
|
||||
if(controller.inventory[0].stackSize == 0)
|
||||
{
|
||||
controller.inventory[0] = null;
|
||||
}
|
||||
|
||||
burning = true;
|
||||
}
|
||||
|
||||
|
@ -136,7 +140,9 @@ public class FusionReactor implements IFusionReactor
|
|||
int amountNeeded = getFuelTank().getNeeded();
|
||||
int amountAvailable = 2*min(getDeuteriumTank().getStored(), getTritiumTank().getStored());
|
||||
int amountToInject = min(amountNeeded, min(amountAvailable, injectionRate));
|
||||
|
||||
amountToInject -= amountToInject % 2;
|
||||
|
||||
getDeuteriumTank().draw(amountToInject / 2, true);
|
||||
getTritiumTank().draw(amountToInject / 2, true);
|
||||
getFuelTank().receive(new GasStack(GasRegistry.getGas("fusionFuel"), amountToInject), true);
|
||||
|
@ -145,8 +151,10 @@ public class FusionReactor implements IFusionReactor
|
|||
public int burnFuel()
|
||||
{
|
||||
int fuelBurned = (int)min(getFuelTank().getStored(), max(0, lastPlasmaTemperature - burnTemperature)*burnRatio);
|
||||
|
||||
getFuelTank().draw(fuelBurned, true);
|
||||
plasmaTemperature += energyPerFuel * fuelBurned / plasmaHeatCapacity;
|
||||
|
||||
return fuelBurned;
|
||||
}
|
||||
|
||||
|
@ -155,13 +163,17 @@ public class FusionReactor implements IFusionReactor
|
|||
int neutronsRemaining = fuelBurned;
|
||||
List<INeutronCapture> list = new ArrayList<INeutronCapture>(neutronCaptors);
|
||||
Collections.shuffle(list);
|
||||
|
||||
for(INeutronCapture captor: neutronCaptors)
|
||||
{
|
||||
if(neutronsRemaining <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
neutronsRemaining = captor.absorbNeutrons(neutronsRemaining);
|
||||
}
|
||||
|
||||
controller.radiateNeutrons(neutronsRemaining);
|
||||
}
|
||||
|
||||
|
@ -179,18 +191,21 @@ public class FusionReactor implements IFusionReactor
|
|||
int waterToVaporize = (int)(steamTransferEfficiency * caseWaterHeat / enthalpyOfVaporization);
|
||||
//Mekanism.logger.info("Wanting to vaporise " + waterToVaporize + "mB of water");
|
||||
waterToVaporize = min(waterToVaporize, min(getWaterTank().getFluidAmount(), getSteamTank().getCapacity() - getSteamTank().getFluidAmount()));
|
||||
|
||||
if(waterToVaporize > 0)
|
||||
{
|
||||
//Mekanism.logger.info("Vaporising " + waterToVaporize + "mB of water");
|
||||
getWaterTank().drain(waterToVaporize, true);
|
||||
getSteamTank().fill(new FluidStack(FluidRegistry.getFluid("steam"), waterToVaporize), true);
|
||||
}
|
||||
|
||||
caseWaterHeat = waterToVaporize * enthalpyOfVaporization / steamTransferEfficiency;
|
||||
caseTemperature -= caseWaterHeat / caseHeatCapacity;
|
||||
}
|
||||
|
||||
//Transfer from casing to environment
|
||||
double caseAirHeat = caseAirConductivity * lastCaseTemperature;
|
||||
|
||||
caseTemperature -= caseAirHeat / caseHeatCapacity;
|
||||
setBufferedEnergy(getBufferedEnergy() + caseAirHeat * thermocoupleEfficiency);
|
||||
}
|
||||
|
@ -273,6 +288,7 @@ public class FusionReactor implements IFusionReactor
|
|||
{
|
||||
block.setReactor(null);
|
||||
}
|
||||
|
||||
//Don't remove from controller
|
||||
controller.setReactor(this);
|
||||
reactorBlocks.clear();
|
||||
|
@ -299,6 +315,7 @@ public class FusionReactor implements IFusionReactor
|
|||
Mekanism.logger.trace("Reactor failed: Frame not complete.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.trace("Frame valid");
|
||||
if(!addSides(centreOfReactor))
|
||||
{
|
||||
|
@ -306,6 +323,7 @@ public class FusionReactor implements IFusionReactor
|
|||
Mekanism.logger.trace("Reactor failed: Sides not complete.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.trace("Side Blocks Valid");
|
||||
if(!centreIsClear(centreOfReactor))
|
||||
{
|
||||
|
@ -313,6 +331,7 @@ public class FusionReactor implements IFusionReactor
|
|||
Mekanism.logger.trace("Blocks in chamber.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.trace("Centre is clear");
|
||||
formed = true;
|
||||
}
|
||||
|
|
|
@ -316,12 +316,6 @@ public class BlockReactor extends BlockContainer
|
|||
{
|
||||
return new ItemStack(typeBlock, 1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return Integer.toString(meta);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
|
|
|
@ -33,6 +33,7 @@ public abstract class TileEntityReactorBlock extends TileEntityElectricBlock imp
|
|||
{
|
||||
changed = true;
|
||||
}
|
||||
|
||||
fusionReactor = reactor;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
{
|
||||
setReactor(new FusionReactor(this));
|
||||
}
|
||||
|
||||
getReactor().formMultiblock();
|
||||
}
|
||||
|
||||
|
@ -77,6 +78,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return getReactor().getPlasmaTemp();
|
||||
}
|
||||
|
||||
|
@ -86,6 +88,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return getReactor().getCaseTemp();
|
||||
}
|
||||
|
||||
|
@ -97,6 +100,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
if(isFormed())
|
||||
{
|
||||
getReactor().simulate();
|
||||
|
||||
if(!worldObj.isRemote && (getReactor().isBurning() != clientBurning || Math.abs(getReactor().getPlasmaTemp() - clientTemp) > 1000000))
|
||||
{
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
|
@ -126,8 +130,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
tag.setInteger("injectionRate", getReactor().getInjectionRate());
|
||||
tag.setBoolean("burning", getReactor().isBurning());
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
tag.setDouble("plasmaTemp", 0);
|
||||
tag.setDouble("caseTemp", 0);
|
||||
tag.setInteger("injectionRate", 0);
|
||||
|
@ -171,6 +174,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
super.getNetworkedData(data);
|
||||
|
||||
data.add(getReactor() != null && getReactor().isFormed());
|
||||
|
||||
if(getReactor() != null)
|
||||
{
|
||||
data.add(getReactor().getPlasmaTemp());
|
||||
|
@ -201,6 +205,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
break;
|
||||
case 1:
|
||||
if(getReactor() != null) getReactor().setInjectionRate(dataStream.readInt());
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -209,6 +214,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
super.handlePacketData(dataStream);
|
||||
|
||||
boolean formed = dataStream.readBoolean();
|
||||
|
||||
if(formed)
|
||||
{
|
||||
if(getReactor() == null)
|
||||
|
@ -216,6 +222,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
setReactor(new FusionReactor(this));
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
((FusionReactor)getReactor()).formed = true;
|
||||
getReactor().setPlasmaTemp(dataStream.readDouble());
|
||||
getReactor().setCaseTemp(dataStream.readDouble());
|
||||
|
@ -280,6 +287,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
{
|
||||
box = AxisAlignedBB.getBoundingBox(xCoord-1, yCoord-3, zCoord-1, xCoord+2, yCoord, zCoord+2);
|
||||
}
|
||||
|
||||
return box;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
public TileEntityReactorPort()
|
||||
{
|
||||
super("name", 1);
|
||||
|
||||
inventory = new ItemStack[0];
|
||||
}
|
||||
|
||||
|
@ -48,6 +49,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
return getReactor().getWaterTank().fill(resource, doFill);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -58,6 +60,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
getReactor().getSteamTank().drain(resource.amount, doDrain);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -68,6 +71,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
return getReactor().getSteamTank().drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -90,6 +94,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
return new FluidTankInfo[0];
|
||||
}
|
||||
|
||||
return new FluidTankInfo[] {getReactor().getWaterTank().getInfo(), getReactor().getSteamTank().getInfo()};
|
||||
}
|
||||
|
||||
|
@ -111,6 +116,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
return getReactor().getFuelTank().receive(stack, true);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -159,8 +165,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return getReactor().getBufferedEnergy();
|
||||
}
|
||||
}
|
||||
|
@ -181,8 +186,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return getReactor().getBufferSize();
|
||||
}
|
||||
}
|
||||
|
@ -192,6 +196,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
{
|
||||
EnumSet set = EnumSet.allOf(ForgeDirection.class);
|
||||
set.remove(ForgeDirection.UNKNOWN);
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
|
|
|
@ -667,11 +667,11 @@ tile.Generator.BioGenerator.name=Bio-Generator
|
|||
tile.Generator.AdvancedSolarGenerator.name=Advanced Solar Generator
|
||||
tile.Generator.WindTurbine.name=Wind Turbine
|
||||
|
||||
tile.Reactor.ReactorController=Reactor Controller
|
||||
tile.Reactor.ReactorFrame=Reactor Frame
|
||||
tile.Reactor.ReactorLaserFocusMatrix=Laser Focus Matrix
|
||||
tile.Reactor.ReactorNeutronCapturePlate=Neutron Capture Plate
|
||||
tile.Reactor.ReactorInOutPort=Reactor Port
|
||||
tile.Reactor.ReactorController.name=Reactor Controller
|
||||
tile.Reactor.ReactorFrame.name=Reactor Frame
|
||||
tile.Reactor.ReactorLaserFocusMatrix.name=Laser Focus Matrix
|
||||
tile.Reactor.ReactorNeutronCapturePlate.name=Neutron Capture Plate
|
||||
tile.Reactor.ReactorInOutPort.name=Reactor Port
|
||||
|
||||
tile.ReactorGlass.ReactorGlass.name=Reactor Glass
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue