diff --git a/src/main/java/com/hbm/inventory/fluid/Fluids.java b/src/main/java/com/hbm/inventory/fluid/Fluids.java index 28236f736..7d3a9e697 100644 --- a/src/main/java/com/hbm/inventory/fluid/Fluids.java +++ b/src/main/java/com/hbm/inventory/fluid/Fluids.java @@ -100,6 +100,8 @@ public class Fluids { public static FluidType SOLVENT; //oranic solvent in fact public static FluidType BLOOD; //BLOOD ORB! BLOOD ORB! BLOOD ORB! public static FluidType BLOOD_HOT; + public static FluidType SYNGAS; + public static FluidType OXYHYDROGEN; private static final HashMap idMapping = new HashMap(); private static final HashMap nameMapping = new HashMap(); @@ -215,7 +217,9 @@ public class Fluids { NITRIC_ACID = new FluidType("NITRIC_ACID", 0xBB7A1E, 3, 0, 2, EnumSymbol.OXIDIZER).addTraits(LIQUID, new FT_Corrosive(60)); SOLVENT = new FluidType("SOLVENT", 0xE4E3EF, 2, 3, 0, EnumSymbol.NONE).addContainers(0xE4E3EF, ExtContainer.CANISTER).addTraits(LIQUID); BLOOD = new FluidType("BLOOD", 0xB22424, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID); - BLOOD_HOT = new FluidType(85, "BLOOD_HOT", 0xE4E3EF, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID).setTemp(666); //it's funny because it's the satan number + BLOOD_HOT = new FluidType("BLOOD_HOT", 0xE4E3EF, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID).setTemp(666); //it's funny because it's the satan number + SYNGAS = new FluidType("SYNGAS", 0xffffff, 3, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS); + OXYHYDROGEN = new FluidType(87, "OXYHYDROGEN", 0x483FC1, 3, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS); // ^ ^ ^ ^ ^ ^ ^ ^ @@ -271,6 +275,8 @@ public class Fluids { metaOrder.add(GAS); metaOrder.add(PETROLEUM); metaOrder.add(LPG); + metaOrder.add(SYNGAS); + metaOrder.add(OXYHYDROGEN); metaOrder.add(AROMATICS); metaOrder.add(UNSATURATEDS); metaOrder.add(DIESEL); @@ -382,7 +388,7 @@ public class Fluids { /// the allmighty excel spreadsheet has spoken! /// registerCalculatedFuel(OIL, (baseline / 1D * flammabilityLow * demandLow), 0, null); registerCalculatedFuel(CRACKOIL, (baseline / 1D * flammabilityLow * demandLow * complexityCracking), 0, null); - registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 0, null); + registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 1.25, FuelGrade.GAS); registerCalculatedFuel(HEAVYOIL, (baseline / 0.5 * flammabilityLow * demandLow * complexityRefinery), 1.25D, FuelGrade.LOW); registerCalculatedFuel(SMEAR, (baseline / 0.35 * flammabilityLow * demandLow * complexityRefinery * complexityFraction), 1.25D, FuelGrade.LOW); registerCalculatedFuel(RECLAIMED, (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant), 1.25D, FuelGrade.LOW); @@ -398,7 +404,7 @@ public class Fluids { registerCalculatedFuel(LIGHTOIL, (baseline / 0.15 * flammabilityNormal * demandHigh * complexityRefinery), 1.5D, FuelGrade.MEDIUM); registerCalculatedFuel(LIGHTOIL_CRACK, (baseline / 0.30 * flammabilityNormal * demandHigh * complexityRefinery * complexityCracking), 1.5D, FuelGrade.MEDIUM); registerCalculatedFuel(KEROSENE, (baseline / 0.09 * flammabilityNormal * demandHigh * complexityRefinery * complexityFraction), 1.5D, FuelGrade.AERO); - registerCalculatedFuel(PETROLEUM, (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery), 0, null); + registerCalculatedFuel(PETROLEUM, (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery), 1.25, FuelGrade.GAS); registerCalculatedFuel(AROMATICS, (baseline / 0.15 * flammabilityLow * demandHigh * complexityRefinery * complexityCracking), 0, null); registerCalculatedFuel(UNSATURATEDS, (baseline / 0.15 * flammabilityHigh * demandHigh * complexityRefinery * complexityCracking), 0, null); registerCalculatedFuel(LPG, (baseline / 0.05 * flammabilityNormal * demandMedium * complexityRefinery * complexityChemplant), 2.5, FuelGrade.HIGH); @@ -413,13 +419,16 @@ public class Fluids { registerCalculatedFuel(ETHANOL, 275_000D /* diesel / 2 */, 2.5D, FuelGrade.HIGH); - registerCalculatedFuel(BIOGAS, 250_000D * flammabilityLow /* biofuel with half compression, terrible flammability */, 0, null); + registerCalculatedFuel(BIOGAS, 250_000D * flammabilityLow /* biofuel with half compression, terrible flammability */, 1.25, FuelGrade.GAS); registerCalculatedFuel(BIOFUEL, 500_000D /* slightly below diesel */, 2.5D, FuelGrade.HIGH); registerCalculatedFuel(WOODOIL, 110_000 /* 20_000 TU per 250mB + a bonus */, 0, null); registerCalculatedFuel(COALCREOSOTE, 250_000 /* 20_000 TU per 100mB + a bonus */, 0, null); - - registerCalculatedFuel(SOLVENT, 100_000, 0, null); + + registerCalculatedFuel(SOLVENT, 100_000, 0, null); // flammable, sure, but not combustable + + registerCalculatedFuel(SYNGAS, coalHeat * 10 * flammabilityNormal * demandMedium * complexityChemplant, 1.25, FuelGrade.GAS); //1:1 same base stats as coal oil but with combustability and higher processing bonuses + registerCalculatedFuel(OXYHYDROGEN, 5_000, 3, FuelGrade.GAS); // TODO: figure out how well that works with hydrogen production costs } private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) { diff --git a/src/main/java/com/hbm/inventory/fluid/trait/FT_Combustible.java b/src/main/java/com/hbm/inventory/fluid/trait/FT_Combustible.java index 2c6480099..a88ac2c35 100644 --- a/src/main/java/com/hbm/inventory/fluid/trait/FT_Combustible.java +++ b/src/main/java/com/hbm/inventory/fluid/trait/FT_Combustible.java @@ -40,7 +40,8 @@ public class FT_Combustible extends FluidTrait { LOW("Low"), //heating and industrial oil < star engine, iGen MEDIUM("Medium"), //petroil < diesel generator HIGH("High"), //diesel, gasoline < HP engine - AERO("Aviation"); //kerosene and other light aviation fuels < turbofan + AERO("Aviation"), //kerosene and other light aviation fuels < turbofan + GAS("Gaseous"); //fuel gasses like NG, PG and syngas < gas turbine private String grade; diff --git a/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java b/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java index 804e8e10a..fe6bb932c 100644 --- a/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java @@ -42,6 +42,9 @@ public class MixerRecipes extends SerializableRecipe { recipes.put(Fluids.LUBRICANT, new MixerRecipe(1_000, 20).setStack1(new FluidStack(Fluids.HEATINGOIL, 500)).setStack2(new FluidStack(Fluids.UNSATURATEDS, 500))); recipes.put(Fluids.PETROIL, new MixerRecipe(1_000, 30).setStack1(new FluidStack(Fluids.RECLAIMED, 800)).setStack2(new FluidStack(Fluids.LUBRICANT, 200))); + recipes.put(Fluids.SYNGAS, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.COALOIL, 500)).setStack2(new FluidStack(Fluids.STEAM, 500))); + recipes.put(Fluids.OXYHYDROGEN, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.HYDROGEN, 500)).setStack2(new FluidStack(Fluids.OXYGEN, 500))); + recipes.put(Fluids.PETROIL_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.PETROIL, 800)).setSolid(new ComparableStack(ModItems.antiknock))); recipes.put(Fluids.GASOLINE_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.GASOLINE, 800)).setSolid(new ComparableStack(ModItems.antiknock))); recipes.put(Fluids.COALGAS_LEADED, new MixerRecipe(1_000, 40).setStack1(new FluidStack(Fluids.COALGAS, 800)).setSolid(new ComparableStack(ModItems.antiknock))); diff --git a/src/main/java/com/hbm/items/machine/ItemPistons.java b/src/main/java/com/hbm/items/machine/ItemPistons.java index 576371e0f..e47d8a53b 100644 --- a/src/main/java/com/hbm/items/machine/ItemPistons.java +++ b/src/main/java/com/hbm/items/machine/ItemPistons.java @@ -50,10 +50,10 @@ public class ItemPistons extends ItemEnumMulti { } public static enum EnumPistonType { - STEEL (1.00, 0.75, 0.25, 0.00), - DURA (0.50, 1.00, 0.90, 0.50), - DESH (0.00, 0.50, 1.00, 0.75), - STARMETAL (0.50, 0.75, 1.00, 0.90); + STEEL (1.00, 0.75, 0.25, 0.00, 0.00), + DURA (0.50, 1.00, 0.90, 0.50, 0.00), + DESH (0.00, 0.50, 1.00, 0.75, 0.00), + STARMETAL (0.50, 0.75, 1.00, 0.90, 0.50); public double[] eff; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java index 34c92cc42..d4d7285be 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java @@ -6,7 +6,7 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.fluid.trait.FT_Combustible; -import com.hbm.inventory.fluid.trait.FT_Flammable; +import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade; import com.hbm.inventory.gui.GUIMachineTurbineGas; import com.hbm.inventory.container.ContainerMachineTurbineGas; import com.hbm.inventory.fluid.FluidType; @@ -43,7 +43,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement public int tempIdle = 300; public int powerSliderPos; //goes from 0 to 60, 0 is idle, 60 is max power - public int throttle; //the same thing, but goes from0 to 100 + public int throttle; //the same thing, but goes from 0 to 100 public boolean autoMode; public int state = 0; //0 is offline, -1 is startup, 1 is online @@ -59,19 +59,20 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement static { fuelMaxCons.put(Fluids.GAS, 50D); - fuelMaxCons.put(Fluids.PETROLEUM, 5D); - fuelMaxCons.put(Fluids.LPG, 5D); - //fuelMaxCons.put(Fluids.BIOGAS, 1D); currently useless + //fuelMaxCons.put(Fluids.PETROLEUM, 5D); + //fuelMaxCons.put(Fluids.LPG, 5D); + + // default to 5 if not in list } - public static HashMap fuelMaxTemp = new HashMap(); //power production at maxT is half the normal production multiplied by (maxtemp - 300) / 500 + /*public static HashMap fuelMaxTemp = new HashMap(); //power production at maxT is half the normal production multiplied by (maxtemp - 300) / 500 static { fuelMaxTemp.put(Fluids.GAS, 600); fuelMaxTemp.put(Fluids.PETROLEUM, 800); fuelMaxTemp.put(Fluids.LPG, 400); //fuelMaxTemp.put(Fluids.BIOGAS, 500); - } + }*/ //i don't think we need even more variance between fuel types - types already have a combustion value //TODO particles from heat exchanger maybe? maybe in a future @@ -93,8 +94,9 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement if(slots[1] != null && slots[1].getItem() instanceof IItemFluidIdentifier) { FluidType fluid = ((IItemFluidIdentifier) slots[1].getItem()).getType(worldObj, xCoord, yCoord, zCoord, slots[1]); - if(fuelMaxTemp.get(fluid) != null) + if(fluid.hasTrait(FT_Combustible.class) && fluid.getTrait(FT_Combustible.class).getGrade() == FuelGrade.GAS) { tanks[0].setTankType(fluid); + } } switch(state) { //what to do when turbine offline, starting up and online @@ -102,11 +104,11 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement shutdown(); break; case -1: - isReady(); + stopIfNotReady(); startup(); break; case 1: - isReady(); + stopIfNotReady(); run(); break; default: @@ -115,6 +117,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement if(autoMode) { //power production depending on power requirement + //scales the slider proportionally to the power gauge int powerSliderTarget = 60 - (int) (60 * power / maxPower); if(powerSliderTarget > powerSliderPos) { //makes the auto slider slide instead of snapping into position @@ -171,7 +174,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } else { //client side, for sounds n shit - if(rpm >= 10 && state != -1) { //if conditions are right, play thy sound + if(rpm >= 10 && state != -1) { //if conditions are right, play the sound if(audio == null) { //if there is no sound playing, start it @@ -197,19 +200,22 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } } - private void isReady() { //checks if the turbine can make power, if not shutdown TODO make this a bool maybe? + private void stopIfNotReady() { if(tanks[0].getFill() == 0 || tanks[1].getFill() == 0) { state = 0; } - if (!hasAcceptableFuel()) + if(!hasAcceptableFuel()) { state = 0; + } } - public boolean hasAcceptableFuel() { //TODO useless check? + public boolean hasAcceptableFuel() { + + if(tanks[0].getTankType().hasTrait(FT_Combustible.class)) { + return tanks[0].getTankType().getTrait(FT_Combustible.class).getGrade() == FuelGrade.GAS; + } - if (fuelMaxTemp.get(tanks[0].getTankType()) != null) - return true; return false; } @@ -261,18 +267,20 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement rpm = (int) (rpmLast * (counter) / 225); temp = (int) (tempLast * (counter) / 225); - } - else if(rpm > 11) { //quickly slows down the turbine to idle before shutdown + + } else if(rpm > 11) { //quickly slows down the turbine to idle before shutdown counter = 42069; //absolutely necessary to avoid fuckeries on shutdown rpm--; - return; - } - else if(rpm == 11) { + } else if(rpm == 11) { counter = 225; rpm--; } } + protected int getFluidBurnTemp(FluidType type) { + return 800; + } + private void run() { if((int) (throttle * 0.9) > rpm - rpmIdle) { //simulates the rotor's moment of inertia @@ -285,17 +293,20 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } } - if(throttle * 5 * (fuelMaxTemp.get(tanks[0].getTankType()) - tempIdle) / 500 > temp - tempIdle) { //simulates the heat exchanger's resistance to temperature variation + int maxTemp = getFluidBurnTemp(tanks[0].getTankType()); // fuelMaxTemp.get(tanks[0].getTankType()) + + if(throttle * 5 * (maxTemp - tempIdle) / 500 > temp - tempIdle) { //simulates the heat exchanger's resistance to temperature variation if(worldObj.getTotalWorldTime() % 2 == 0) { temp++; } - } else if(throttle * 5 * (fuelMaxTemp.get(tanks[0].getTankType()) - tempIdle) / 500 < temp - tempIdle) { + } else if(throttle * 5 * (maxTemp - tempIdle) / 500 < temp - tempIdle) { if(worldObj.getTotalWorldTime() % 2 == 0) { temp--; } } - makePower(fuelMaxCons.get(tanks[0].getTankType()), throttle); + double consumption = fuelMaxCons.containsKey(tanks[0].getTankType()) ? fuelMaxCons.get(tanks[0].getTankType()) : 5D; + makePower(consumption, throttle); } @@ -326,15 +337,10 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } - long energy; //energy per mb of fuel + long energy = 0; //energy per mb of fuel if(tanks[0].getTankType().hasTrait(FT_Combustible.class)) { - FT_Combustible a = tanks[0].getTankType().getTrait(FT_Combustible.class); - energy = a.getCombustionEnergy() / 1000; - } - else { - FT_Flammable b = tanks[0].getTankType().getTrait(FT_Flammable.class); - energy = b.getHeatEnergy() / 1000; + energy = tanks[0].getTankType().getTrait(FT_Combustible.class).getCombustionEnergy() / 1000; } //consMax*energy is equivalent to power production at 100% diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 0d2e9b96d..9b712608b 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -389,6 +389,7 @@ container.soyuzLauncher=Soyuz-Startplatform container.storageDrum=Atommüll-Lagertrommel container.teleLinker=TelLink-Gerät container.teleporter=Teleporter +container.turbinegas=Kombizyklus-Gasturbine container.turretArty=Greg container.turretChekhov=Tschechows Gewehr container.turretFriendly=Mister Friendly @@ -629,6 +630,7 @@ hbmfluid.nitan=NITAN© 100 Oktan Supertreibstoff hbmfluid.nitric_acid=Salpetersäure hbmfluid.none=Nichts hbmfluid.oil=Rohöl +hbmfluid.oxyhydrogen=Knallgas hbmfluid.oxygen=Flüssiger Sauerstoff hbmfluid.pain=Pandemonium(III)tantalit-Lösung hbmfluid.petroil=Gemisch @@ -652,6 +654,7 @@ hbmfluid.spentsteam=Niedrigdruckdampf hbmfluid.steam=Dampf hbmfluid.sulfuric_acid=Schwefelsäure hbmfluid.superhotsteam=Superverdichteter Dampf +hbmfluid.syngas=Synthesegas hbmfluid.tritium=Tritium hbmfluid.uf6=Uranhexafluorid hbmfluid.ultrahotsteam=Ultraverdichteter Dampf @@ -3823,6 +3826,7 @@ tile.machine_transformer_dnt.name=DNT-20Hz-Transformator tile.machine_transformer_dnt_20.name=DNT-1Hz-Transformator tile.machine_turbine.name=Dampfturbine tile.machine_turbine.desc=Effizienz: 85%% +tile.machine_turbinegas.name=Kombizyklus-Gasturbine tile.machine_turbofan.name=Turbofan tile.machine_uf6_tank.name=Uranhexafluorid-Tank tile.machine_waste_drum.name=Abklingbecken-Trommel diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index f9f87d69c..697f0dacf 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -710,6 +710,7 @@ container.soyuzLauncher=Soyuz Launch Platform container.storageDrum=Nuclear Waste Disposal Drum container.teleLinker=TelLink Device container.teleporter=Teleporter +container.turbinegas=Combined Cycle Gas Turbine container.turretArty=Greg container.turretChekhov=Chekhov's Gun container.turretFriendly=Mister Friendly @@ -1227,6 +1228,7 @@ hbmfluid.nitric_acid=Nitric Acid hbmfluid.none=None hbmfluid.oil=Crude Oil hbmfluid.oxygen=Liquid Oxygen +hbmfluid.oxyhydrogen=Oxyhydrogen hbmfluid.pain=Pandemonium(III)tantalite Solution hbmfluid.petroil=Petroil hbmfluid.petroil_leaded=Leaded Petroil @@ -1249,6 +1251,7 @@ hbmfluid.spentsteam=Low-Pressure Steam hbmfluid.steam=Steam hbmfluid.sulfuric_acid=Sulfuric Acid hbmfluid.superhotsteam=Super Dense Steam +hbmfluid.syngas=Syngas hbmfluid.tritium=Tritium hbmfluid.uf6=Uranium Hexafluoride hbmfluid.ultrahotsteam=Ultra Dense Steam @@ -4668,6 +4671,7 @@ tile.machine_transformer_dnt.name=DNT-20Hz Transformer tile.machine_transformer_dnt_20.name=DNT-1Hz Transformer tile.machine_turbine.name=Steam Turbine tile.machine_turbine.desc=Efficiency: 85%% +tile.machine_turbinegas.name=Combined Cycle Gas Turbine tile.machine_turbofan.name=Turbofan tile.machine_uf6_tank.name=Uranium Hexafluoride Tank tile.machine_waste_drum.name=Spent Fuel Pool Drum diff --git a/src/main/resources/assets/hbm/textures/gui/fluids/oxyhydrogen.png b/src/main/resources/assets/hbm/textures/gui/fluids/oxyhydrogen.png new file mode 100644 index 000000000..17799feb4 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/gui/fluids/oxyhydrogen.png differ diff --git a/src/main/resources/assets/hbm/textures/gui/fluids/syngas.png b/src/main/resources/assets/hbm/textures/gui/fluids/syngas.png new file mode 100644 index 000000000..8ed3337b8 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/gui/fluids/syngas.png differ diff --git a/src/main/resources/assets/hbm/textures/models/tank/tank_OXYHYDROGEN.png b/src/main/resources/assets/hbm/textures/models/tank/tank_OXYHYDROGEN.png new file mode 100644 index 000000000..7282f7390 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/tank/tank_OXYHYDROGEN.png differ diff --git a/src/main/resources/assets/hbm/textures/models/tank/tank_SYNGAS.png b/src/main/resources/assets/hbm/textures/models/tank/tank_SYNGAS.png new file mode 100644 index 000000000..e7e92367f Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/tank/tank_SYNGAS.png differ