diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-06-13 20:58:18 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-06-13 20:58:18 +0300 |
| commit | 1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c (patch) | |
| tree | f9de575627405d0c407b2afb442ab18a6fbea01f /ihl/processing/chemistry | |
| parent | 50d62a1298f05d6d440a5bc261a0fdf9ffece893 (diff) | |
enet update
Diffstat (limited to 'ihl/processing/chemistry')
3 files changed, 4 insertions, 72 deletions
diff --git a/ihl/processing/chemistry/ElectrolysisBathContainer.java b/ihl/processing/chemistry/ElectrolysisBathContainer.java index 9797755..54bb9c7 100644 --- a/ihl/processing/chemistry/ElectrolysisBathContainer.java +++ b/ihl/processing/chemistry/ElectrolysisBathContainer.java @@ -60,16 +60,11 @@ public class ElectrolysisBathContainer extends ContainerBase<ElectrolysisBathTil icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress);
}
- if (this.tileEntity.temperature != this.lastTemperature)
- {
- icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.temperature);
- }
}
this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank();
this.lastFluidAmount = this.tileEntity.getTankAmount();
this.lastProgress = this.tileEntity.progress;
- this.lastTemperature = this.tileEntity.temperature;
}
@Override
@@ -81,9 +76,6 @@ public class ElectrolysisBathContainer extends ContainerBase<ElectrolysisBathTil case 0:
this.tileEntity.progress=(short) value;
break;
- case 1:
- this.tileEntity.temperature=(short) value;
- break;
}
}
diff --git a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java index 8a498b6..f4743df 100644 --- a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java +++ b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java @@ -42,7 +42,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit public short progress;
protected short operationLength=20000;//Short.MAX_VALUE=32767
private final IHLFluidTank fluidTank = new IHLFluidTank(2000);
- public short temperature=20;
private final static double resistance=5D;
public ElectrolysisBathTileEntity() {
@@ -88,7 +87,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit public void updateEntityServer()
{
super.updateEntityServer();
- temperature=(short) (this.fluidTank.getTemperature()-273);
IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank);
if (this.canOperate())
{
@@ -97,10 +95,9 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit {
IC2.network.get().initiateTileEntityEvent(this, 0, true);
}
- if(this.getGrid().energy>0D)
+ if(gridID!=-1 && this.getGrid().energy>0D)
{
- double voltage = this.getGrid().getSinkVoltage(this);
- double drawEnergy = voltage*voltage/resistance;
+ double drawEnergy = getEnergyAmountThisNodeWant();
this.progress+=drawEnergy;
this.getGrid().drawEnergy(drawEnergy, this);
}
@@ -289,7 +286,7 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit {
double voltage = this.getGrid().getSinkVoltage(this);
double energy = voltage*voltage/resistance;
- return this.getOutput()!=null?energy:0;
+ return this.getOutput()!=null?energy>1d?energy:1d:0d;
}
@Override
diff --git a/ihl/processing/chemistry/FractionatorBottomTileEntity.java b/ihl/processing/chemistry/FractionatorBottomTileEntity.java index eeabf61..3d9e95e 100644 --- a/ihl/processing/chemistry/FractionatorBottomTileEntity.java +++ b/ihl/processing/chemistry/FractionatorBottomTileEntity.java @@ -130,11 +130,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory implements FluidStack coolant = this.waterTank.getFluid();
if(coolant!=null && coolant.amount>0)
{
- int t1 = this.waterTank.getTemperature();
- float densityOfCoolant = IHLFluid.getRealDensity(coolant.getFluid());
- float densityOfGas = 17.8f;
- int boilingPointOfGas = IHLFluid.getBoilingPoint(result2.getFluid());
- int amountOfGasToCondense = this.getAmountOfCondensedGas(coolant.amount, amountOfVapours, boilingPointOfGas, t1, densityOfGas, densityOfCoolant);
+ int amountOfGasToCondense = Math.min(coolant.amount*50, amountOfVapours);
amountOfGasCondensed += amountOfGasToCondense;
amountOfFluidEvaporated -= amountOfGasToCondense/50;
}
@@ -252,59 +248,6 @@ public class FractionatorBottomTileEntity extends TileEntityInventory implements }
return false;
}
-
- private int getAmountOfCondensedGas(int amountOfCoolant, int amountOfGas, int boilingPointOfGas, int temperatureOfCoolant, float densityOfGas, float densityOfCoolant)
- {
- if(amountOfCoolant<=0 || amountOfGas<=0 || boilingPointOfGas-20<temperatureOfCoolant)
- {
- return 0;
- }
- int L = amountOfGas;
- int t2 = boilingPointOfGas;
- int t1 = temperatureOfCoolant;
- int dt1=t2-t1;
- float maxQ=H*L*densityOfGas;
- int t1_1 = t1;
- for(int i=0;i<10;i++)
- {
- float Q2=H*L*densityOfGas;
- t1_1 = t1+(int)(Q2/fluidC/amountOfCoolant/densityOfCoolant);
- int dt2=t2-t1_1;
- float deltaT;
- if(dt1>2*dt2)
- {
- deltaT = (float) ((dt1-dt2)/Math.log((double)dt2/(double)dt1));
- }
- else
- {
- deltaT = (dt1+dt2)*0.5F;
- }
- float Q1 = kF*deltaT;
- if(Q1>=maxQ)
- {
- break;
- }
- else
- {
- int next_L = (int)(Q1/H/densityOfGas);
- if(Math.abs(next_L-L)<4)
- {
- L=next_L;
- break;
- }
- L=next_L;
- }
- }
- if(t1_1>t1)
- {
- this.waterTank.setTemperature(t1_1);
- }
- else
- {
- this.waterTank.setTemperature(t1+1);
- }
- return L;
- }
@Override
public String getInventoryName()
|
