diff options
Diffstat (limited to 'ihl/processing')
5 files changed, 7 insertions, 83 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()
diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java index f02abea..a546b0a 100644 --- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java +++ b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java @@ -31,7 +31,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa public short progress;
protected short operationLength = 6000;
protected double energyConsume = 1d;
- public double energy;
+ public double energy = 0d;
public int maxStorage = 128;
private boolean addedToEnergyNet = false;
@@ -257,7 +257,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa @Override
public double getEnergyAmountThisNodeWant() {
- return this.energy - this.getMaxStorage();
+ return this.getMaxStorage()-this.energy;
}
public double drawEnergyToGrid(double amount) {
diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java index a0ed60d..4f7c529 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java @@ -16,7 +16,6 @@ import ic2.core.block.invslot.InvSlot.Access; import ic2.core.block.invslot.InvSlotConsumableLiquid;
import ic2.core.block.invslot.InvSlotOutput;
import ihl.interfaces.IFluidTankVisual;
-import ihl.interfaces.IHasTemperature;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.chemistry.ChemicalReactorTileEntity;
import ihl.processing.invslots.IHLInvSlotOutput;
@@ -37,7 +36,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
-public class ImpregnatingMachineTileEntity extends TileEntityInventory implements IHasGui,IFluidTankVisual,INetworkTileEntityEventListener, IFluidHandler, IHasTemperature
+public class ImpregnatingMachineTileEntity extends TileEntityInventory implements IHasGui,IFluidTankVisual,INetworkTileEntityEventListener, IFluidHandler
{
private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("tub");
public final ApparatusProcessableInvSlot input;
@@ -123,7 +122,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement visibleFluidId=-1;
IC2.network.get().updateTileEntityField(this, "visibleFluidId");
}
- temperature=(short) (this.fluidTank.getTemperature()-273);
IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank);
if (this.canOperate())
{
@@ -334,12 +332,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement }
@Override
- public int getTemperature()
- {
- return this.fluidTank.getTemperature();
- }
-
- @Override
public int getVisibleFluidId() {
return this.visibleFluidId;
}
|
