mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #1625 from RosaTryp/machine-configs
More Machine Configs!
This commit is contained in:
commit
a14899ad1e
@ -1,10 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.container.ContainerAshpit;
|
||||
import com.hbm.inventory.gui.GUIAshpit;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
@ -19,7 +24,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider {
|
||||
public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvider, IConfigurableMachine {
|
||||
|
||||
private int playersUsing = 0;
|
||||
public float doorAngle = 0;
|
||||
@ -32,10 +37,40 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
||||
public int ashLevelFly;
|
||||
public int ashLevelSoot;
|
||||
|
||||
//Configurable values
|
||||
public static int thresholdWood = 2000;
|
||||
public static int thresholdCoal = 2000;
|
||||
public static int thresholdMisc = 2000;
|
||||
public static int thresholdFly = 2000;
|
||||
public static int thresholdSoot = 8000;
|
||||
|
||||
public TileEntityAshpit() {
|
||||
super(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "ashpit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
thresholdWood = IConfigurableMachine.grab(obj, "I:thresholdWood", thresholdWood);
|
||||
thresholdCoal = IConfigurableMachine.grab(obj, "I:thresholdCoal", thresholdCoal);
|
||||
thresholdMisc = IConfigurableMachine.grab(obj, "I:thresholdMisc", thresholdMisc);
|
||||
thresholdFly = IConfigurableMachine.grab(obj, "I:thresholdFly", thresholdFly);
|
||||
thresholdSoot = IConfigurableMachine.grab(obj, "I:thresholdSoot", thresholdSoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:thresholdWood").value(thresholdWood);
|
||||
writer.name("I:thresholdCoal").value(thresholdCoal);
|
||||
writer.name("I:thresholdMisc").value(thresholdMisc);
|
||||
writer.name("I:thresholdFly").value(thresholdFly);
|
||||
writer.name("I:thresholdSoot").value(thresholdSoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if(!worldObj.isRemote) this.playersUsing++;
|
||||
@ -56,13 +91,12 @@ public class TileEntityAshpit extends TileEntityMachineBase implements IGUIProvi
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
int threshold = 2000;
|
||||
|
||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, threshold)) ashLevelWood -= threshold;
|
||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, threshold)) ashLevelCoal -= threshold;
|
||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, threshold)) ashLevelMisc -= threshold;
|
||||
if(processAsh(ashLevelFly, EnumAshType.FLY, threshold)) ashLevelFly -= threshold;
|
||||
if(processAsh(ashLevelSoot, EnumAshType.SOOT, threshold * 4)) ashLevelSoot -= threshold * 4;
|
||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, thresholdWood)) ashLevelWood -= thresholdWood;
|
||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, thresholdCoal)) ashLevelCoal -= thresholdCoal;
|
||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, thresholdMisc)) ashLevelMisc -= thresholdMisc;
|
||||
if(processAsh(ashLevelFly, EnumAshType.FLY, thresholdFly)) ashLevelFly -= thresholdFly;
|
||||
if(processAsh(ashLevelSoot, EnumAshType.SOOT, thresholdSoot)) ashLevelSoot -= thresholdSoot;
|
||||
|
||||
isFull = false;
|
||||
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Random;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -13,6 +16,7 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -36,10 +40,9 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000000L;
|
||||
private int turnTimer;
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
@ -50,16 +53,46 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
|
||||
private AudioWrapper audio;
|
||||
private float audioDesync;
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 100000000000L;
|
||||
public static int inputTankSize = 1_000_000_000;
|
||||
public static int outputTankSize = 1_000_000_000;
|
||||
public static double efficiency = 0.85D;
|
||||
|
||||
public TileEntityChungus() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 1_000_000_000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000_000);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
|
||||
Random rand = new Random();
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineLeviathan";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("leviathan steam turbine consumes all availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -72,7 +105,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //85% efficiency
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //85% efficiency by default
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -12,7 +17,7 @@ import api.hbm.tile.IInfoProviderEC;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC {
|
||||
public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidStandardTransceiver, INBTPacketReceiver, IInfoProviderEC, IConfigurableMachine {
|
||||
|
||||
public int age = 0;
|
||||
public FluidTank[] tanks;
|
||||
@ -20,11 +25,34 @@ public class TileEntityCondenser extends TileEntityLoadedBase implements IFluidS
|
||||
public int waterTimer = 0;
|
||||
protected int throughput;
|
||||
|
||||
//Configurable values
|
||||
public static int inputTankSize = 100;
|
||||
public static int outputTankSize = 100;
|
||||
|
||||
public TileEntityCondenser() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 100);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 100);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenser";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
@ -16,16 +21,41 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
public class TileEntityCondenserPowered extends TileEntityCondenser implements IEnergyReceiverMK2 {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10_000_000;
|
||||
public float spin;
|
||||
public float lastSpin;
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 10_000_000;
|
||||
public static int inputTankSizeP = 1_000_000;
|
||||
public static int outputTankSizeP = 1_000_000;
|
||||
public static int powerConsumption = 10;
|
||||
|
||||
public TileEntityCondenserPowered() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1_000_000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 1_000_000);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeP);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenserPowered";
|
||||
}
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSizeP = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeP);
|
||||
outputTankSizeP = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeP);
|
||||
powerConsumption = IConfigurableMachine.grab(obj, "I:powerConsumption", powerConsumption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("I:inputTankSize").value(inputTankSizeP);
|
||||
writer.name("I:outputTankSize").value(outputTankSizeP);
|
||||
writer.name("I:powerConsumption").value(powerConsumption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
@ -63,7 +93,7 @@ public class TileEntityCondenserPowered extends TileEntityCondenser implements I
|
||||
|
||||
@Override
|
||||
public void postConvert(int convert) {
|
||||
this.power -= convert * 10;
|
||||
this.power -= convert * powerConsumption;
|
||||
if(this.power < 0) this.power = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Random;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
||||
@ -14,6 +17,7 @@ import com.hbm.inventory.gui.GUIMachineLargeTurbine;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -39,10 +43,9 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
public FluidTank[] tanks;
|
||||
protected double[] info = new double[3];
|
||||
|
||||
@ -54,17 +57,46 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
private AudioWrapper audio;
|
||||
private float audioDesync;
|
||||
|
||||
//Configurable Values
|
||||
public static long maxPower = 100000000;
|
||||
public static int inputTankSize = 512_000;
|
||||
public static int outputTankSize = 10_240_000;
|
||||
public static double efficiency = 1.0;
|
||||
|
||||
|
||||
public TileEntityMachineLargeTurbine() {
|
||||
super(7);
|
||||
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 512000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 10240000);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
|
||||
Random rand = new Random();
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbineIndustrial";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineLargeTurbine";
|
||||
@ -92,7 +124,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE); //100% efficiency
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //100% efficiency by default
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = (int) Math.floor(tanks[0].getFill() / trait.amountReq); //amount of cycles possible with the entire input buffer
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineTurbine;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -9,6 +13,7 @@ import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.inventory.gui.GUIMachineTurbine;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -37,12 +42,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IEnergyProviderMK2, IFluidStandardTransceiver, IBufPacketReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IEnergyProviderMK2, IFluidStandardTransceiver, IBufPacketReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine{
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000;
|
||||
public int age = 0;
|
||||
public FluidTank[] tanks;
|
||||
|
||||
@ -53,11 +57,40 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
||||
private String customName;
|
||||
protected double[] info = new double[3];
|
||||
|
||||
//Configurable values
|
||||
public static long maxPower = 1_000_000;
|
||||
public static int inputTankSize = 64_000;
|
||||
public static int outputTankSize = 128_000;
|
||||
public static int maxSteamPerTick = 6_000;
|
||||
public static double efficiency = 0.85D;
|
||||
|
||||
public TileEntityMachineTurbine() {
|
||||
slots = new ItemStack[7];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 64_000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 128_000);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
|
||||
}
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "steamturbine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
|
||||
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
|
||||
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
|
||||
maxSteamPerTick = IConfigurableMachine.grab(obj, "I:maxSteamPerTick", maxSteamPerTick);
|
||||
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:maxPower").value(maxPower);
|
||||
writer.name("I:inputTankSize").value(inputTankSize);
|
||||
writer.name("I:outputTankSize").value(outputTankSize);
|
||||
writer.name("I:maxSteamPerTick").value(maxSteamPerTick);
|
||||
writer.name("D:efficiency").value(efficiency);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -247,12 +280,12 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
||||
boolean valid = false;
|
||||
if(in.hasTrait(FT_Coolable.class)) {
|
||||
FT_Coolable trait = in.getTrait(FT_Coolable.class);
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * 0.85D; //small turbine is only 85% efficient
|
||||
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //small turbine is only 85% efficient by default
|
||||
if(eff > 0) {
|
||||
tanks[1].setTankType(trait.coolsTo);
|
||||
int inputOps = tanks[0].getFill() / trait.amountReq;
|
||||
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
|
||||
int cap = 6_000 / trait.amountReq;
|
||||
int cap = maxSteamPerTick / trait.amountReq;
|
||||
int ops = Math.min(inputOps, Math.min(outputOps, cap));
|
||||
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
|
||||
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -15,12 +20,33 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityTowerLarge extends TileEntityCondenser {
|
||||
|
||||
//Configurable values
|
||||
public static int inputTankSizeTL = 10_000;
|
||||
public static int outputTankSizeTL = 10_000;
|
||||
|
||||
public TileEntityTowerLarge() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 10000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 10000);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTL);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeTL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenserTowerLarge";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSizeTL = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeTL);
|
||||
outputTankSizeTL = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeTL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:inputTankSize").value(inputTankSizeTL);
|
||||
writer.name("I:outputTankSize").value(outputTankSizeTL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -15,12 +20,33 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityTowerSmall extends TileEntityCondenser {
|
||||
|
||||
//Configurable values
|
||||
public static int inputTankSizeTS = 1_000;
|
||||
public static int outputTankSizeTS = 1_000;
|
||||
|
||||
public TileEntityTowerSmall() {
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, 1000);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, 1000);
|
||||
tanks[0] = new FluidTank(Fluids.SPENTSTEAM, inputTankSizeTS);
|
||||
tanks[1] = new FluidTank(Fluids.WATER, outputTankSizeTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "condenserTowerSmall";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
inputTankSizeTS = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSizeTS);
|
||||
outputTankSizeTS = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSizeTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:inputTankSize").value(inputTankSizeTS);
|
||||
writer.name("I:outputTankSize").value(outputTankSizeTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user