From 1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Tue, 13 Jun 2017 20:58:18 +0300 Subject: enet update --- .../chemistry/ElectrolysisBathContainer.java | 8 --- .../chemistry/ElectrolysisBathTileEntity.java | 9 ++-- .../chemistry/FractionatorBottomTileEntity.java | 59 +--------------------- .../metallurgy/BasicElectricMotorTileEntity.java | 4 +- .../metallurgy/ImpregnatingMachineTileEntity.java | 10 +--- 5 files changed, 7 insertions(+), 83 deletions(-) (limited to 'ihl/processing') 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 ContainerBase0D) + 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-202*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()) { @@ -333,12 +331,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement return pass==0; } - @Override - public int getTemperature() - { - return this.fluidTank.getTemperature(); - } - @Override public int getVisibleFluidId() { return this.visibleFluidId; -- cgit v1.2.3