summaryrefslogtreecommitdiff
path: root/ihl/processing/chemistry/ElectrolysisBathTileEntity.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-06-13 20:58:18 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-06-13 20:58:18 +0300
commit1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c (patch)
treef9de575627405d0c407b2afb442ab18a6fbea01f /ihl/processing/chemistry/ElectrolysisBathTileEntity.java
parent50d62a1298f05d6d440a5bc261a0fdf9ffece893 (diff)
enet update
Diffstat (limited to 'ihl/processing/chemistry/ElectrolysisBathTileEntity.java')
-rw-r--r--ihl/processing/chemistry/ElectrolysisBathTileEntity.java9
1 files changed, 3 insertions, 6 deletions
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