mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
coker recipes
This commit is contained in:
parent
b276b0167f
commit
5644726060
16
src/main/java/com/hbm/handler/nei/CokingHandler.java
Normal file
16
src/main/java/com/hbm/handler/nei/CokingHandler.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.CokerRecipes;
|
||||
|
||||
public class CokingHandler extends NEIUniversalHandler {
|
||||
|
||||
public CokingHandler() {
|
||||
super("Coking", ModBlocks.machine_coker, CokerRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmCoking";
|
||||
}
|
||||
}
|
||||
@ -123,6 +123,9 @@ public class Fluids {
|
||||
public static FluidType PHOSGENE;
|
||||
public static FluidType MUSTARDGAS;
|
||||
public static FluidType IONGEL;
|
||||
public static FluidType OIL_COKER; //heavy fractions from coking, mostly bitumen
|
||||
public static FluidType NAPHTHA_COKER; //medium fractions from coking, aromatics and fuel oil
|
||||
public static FluidType GAS_COKER; //light fractions from coking, natgas and co2
|
||||
|
||||
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
|
||||
private static final HashMap<String, FluidType> nameMapping = new HashMap();
|
||||
@ -257,7 +260,10 @@ public class Fluids {
|
||||
COLLOID = new FluidType("COLLOID", 0x787878, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
PHOSGENE = new FluidType("PHOSGENE", 0xCFC4A4, 4, 0, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xCFC4A4, 0x361414)).addTraits(GASEOUS);
|
||||
MUSTARDGAS = new FluidType("MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
|
||||
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
IONGEL = new FluidType("IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
OIL_COKER = new FluidType("OIL_COKER", 0x001802, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
NAPHTHA_COKER = new FluidType("NAPHTHA_COKER", 0x495944, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
GAS_COKER = new FluidType(106, "GAS_COKER", 0xDEF4CA, 1, 4, 0, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
//ADD NEW FLUIDS HERE
|
||||
@ -298,12 +304,14 @@ public class Fluids {
|
||||
metaOrder.add(OIL);
|
||||
metaOrder.add(CRACKOIL);
|
||||
metaOrder.add(COALOIL);
|
||||
metaOrder.add(OIL_COKER);
|
||||
metaOrder.add(HOTOIL);
|
||||
metaOrder.add(HOTCRACKOIL);
|
||||
metaOrder.add(HEAVYOIL);
|
||||
metaOrder.add(HEAVYOIL_VACUUM);
|
||||
metaOrder.add(NAPHTHA);
|
||||
metaOrder.add(NAPHTHA_CRACK);
|
||||
metaOrder.add(NAPHTHA_COKER);
|
||||
metaOrder.add(REFORMATE);
|
||||
metaOrder.add(LIGHTOIL);
|
||||
metaOrder.add(LIGHTOIL_CRACK);
|
||||
@ -315,6 +323,7 @@ public class Fluids {
|
||||
metaOrder.add(RECLAIMED);
|
||||
metaOrder.add(LUBRICANT);
|
||||
metaOrder.add(GAS);
|
||||
metaOrder.add(GAS_COKER);
|
||||
metaOrder.add(PETROLEUM);
|
||||
metaOrder.add(SOURGAS);
|
||||
metaOrder.add(LPG);
|
||||
@ -437,6 +446,7 @@ public class Fluids {
|
||||
double complexityRefinery = 1.1D;
|
||||
double complexityFraction = 1.05D;
|
||||
double complexityCracking = 1.25D;
|
||||
double complexityCoker = 1.25D;
|
||||
double complexityChemplant = 1.1D;
|
||||
double complexityLubed = 1.15D;
|
||||
double complexityLeaded = 1.5D;
|
||||
@ -449,7 +459,9 @@ 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(OIL_COKER, (baseline / 1D * flammabilityLow * demandLow * complexityCoker), 0, null);
|
||||
registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 1.25, FuelGrade.GAS);
|
||||
registerCalculatedFuel(GAS_COKER, (baseline / 1D * flammabilityNormal * demandVeryLow * complexityCoker), 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);
|
||||
@ -458,6 +470,7 @@ public class Fluids {
|
||||
registerCalculatedFuel(HEATINGOIL, (baseline / 0.31 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction * complexityFraction), 1.25D, FuelGrade.LOW);
|
||||
registerCalculatedFuel(NAPHTHA, (baseline / 0.25 * flammabilityLow * demandLow * complexityRefinery), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(NAPHTHA_CRACK, (baseline / 0.40 * flammabilityLow * demandLow * complexityRefinery * complexityCracking), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(NAPHTHA_COKER, (baseline / 0.25 * flammabilityLow * demandLow * complexityCoker), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(GASOLINE, (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant), 2.5D, FuelGrade.HIGH);
|
||||
registerCalculatedFuel(GASOLINE_LEADED, (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant * complexityLeaded), 2.5D, FuelGrade.HIGH);
|
||||
registerCalculatedFuel(DIESEL, (baseline / 0.21 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction), 2.5D, FuelGrade.HIGH);
|
||||
|
||||
131
src/main/java/com/hbm/inventory/recipes/CokerRecipes.java
Normal file
131
src/main/java/com/hbm/inventory/recipes/CokerRecipes.java
Normal file
@ -0,0 +1,131 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import static com.hbm.inventory.fluid.Fluids.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.trait.FT_Combustible;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CokerRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<FluidType, Triplet<Integer, ItemStack, FluidStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
registerAuto(HEAVYOIL, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEAVYOIL_VACUUM, new FluidStack(Fluids.REFORMATE, 20));
|
||||
registerAuto(COALCREOSOTE, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(WOODOIL, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(SMEAR, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEATINGOIL, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEATINGOIL_VACUUM, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(RECLAIMED, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(NAPHTHA, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(NAPHTHA_CRACK, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL_REFORM, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL_CRACK, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(DIESEL_CRACK_REFORM, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL_CRACK, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL_VACUUM, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(BIOFUEL, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(AROMATICS, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(REFORMATE, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(XYLENE, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
}
|
||||
|
||||
private static void registerAuto(FluidType fluid, FluidStack byproduct) {
|
||||
registerSFAuto(fluid, 800_000L, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), byproduct); //3200 burntime * 1.25 burntime bonus * 200 TU/t
|
||||
}
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, ItemStack fuel, FluidStack byproduct) {
|
||||
long tuFlammable = fluid.hasTrait(FT_Flammable.class) ? fluid.getTrait(FT_Flammable.class).getHeatEnergy() : 0;
|
||||
long tuCombustible = fluid.hasTrait(FT_Combustible.class) ? fluid.getTrait(FT_Combustible.class).getCombustionEnergy() : 0;
|
||||
|
||||
long tuPerBucket = Math.max(tuFlammable, tuCombustible);
|
||||
|
||||
double penalty = 1.1D;
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * penalty / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
registerRecipe(fluid, mB, fuel, byproduct);
|
||||
}
|
||||
private static void registerRecipe(FluidType type, int quantity, ItemStack output, FluidStack byproduct) {
|
||||
recipes.put(type, new Triplet(quantity, output, byproduct));
|
||||
}
|
||||
|
||||
public static HashMap<ItemStack, ItemStack[]> getRecipes() {
|
||||
|
||||
HashMap<ItemStack, ItemStack[]> recipes = new HashMap<ItemStack, ItemStack[]>();
|
||||
|
||||
for(Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>> entry : CokerRecipes.recipes.entrySet()) {
|
||||
|
||||
FluidType type = entry.getKey();
|
||||
int amount = entry.getValue().getX();
|
||||
ItemStack out = entry.getValue().getY().copy();
|
||||
FluidStack byproduct = entry.getValue().getZ();
|
||||
|
||||
recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {out, ItemFluidIcon.make(byproduct)});
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCoker.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
FluidStack in = this.readFluidStack(obj.get("input").getAsJsonArray());
|
||||
ItemStack out = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
FluidStack byproduct = this.readFluidStack(obj.get("byproduct").getAsJsonArray());
|
||||
recipes.put(in.type, new Triplet(in.fill, out, byproduct));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>> rec = (Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>>) recipe;
|
||||
FluidStack in = new FluidStack(rec.getKey(), rec.getValue().getX());
|
||||
writer.name("input");
|
||||
this.writeFluidStack(in, writer);
|
||||
writer.name("output");
|
||||
this.writeItemStack(rec.getValue().getY(), writer);
|
||||
writer.name("byproduct");
|
||||
this.writeFluidStack(rec.getValue().getZ(), writer);
|
||||
}
|
||||
}
|
||||
@ -94,13 +94,13 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerSFAuto(LIGHTOIL_CRACK);
|
||||
registerSFAuto(LIGHTOIL_VACUUM);
|
||||
registerSFAuto(KEROSENE);
|
||||
registerSFAuto(GAS);
|
||||
//registerSFAuto(GAS);
|
||||
registerSFAuto(SOURGAS);
|
||||
registerSFAuto(REFORMGAS);
|
||||
registerSFAuto(SYNGAS);
|
||||
registerSFAuto(PETROLEUM);
|
||||
registerSFAuto(LPG);
|
||||
registerSFAuto(BIOGAS);
|
||||
//registerSFAuto(BIOGAS);
|
||||
registerSFAuto(BIOFUEL);
|
||||
registerSFAuto(AROMATICS);
|
||||
registerSFAuto(UNSATURATEDS);
|
||||
@ -111,7 +111,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
}
|
||||
|
||||
private static void registerSFAuto(FluidType fluid) {
|
||||
registerSFAuto(fluid, 144000L, ModItems.solid_fuel); //3200 burntime * 1.5 burntime bonus * 300 TU/t
|
||||
registerSFAuto(fluid, 1_440_000L, ModItems.solid_fuel); //3200 burntime * 1.5 burntime bonus * 300 TU/t
|
||||
}
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, Item fuel) {
|
||||
long tuPerBucket = fluid.getTrait(FT_Flammable.class).getHeatEnergy();
|
||||
|
||||
@ -53,6 +53,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ReformingRecipes());
|
||||
recipeHandlers.add(new LiquefactionRecipes());
|
||||
recipeHandlers.add(new SolidificationRecipes());
|
||||
recipeHandlers.add(new CokerRecipes());
|
||||
recipeHandlers.add(new BreederRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
|
||||
@ -63,6 +63,7 @@ public class NEIConfig implements IConfigureNEI {
|
||||
}
|
||||
registerHandler(new LiquefactionHandler());
|
||||
registerHandler(new SolidificationHandler());
|
||||
registerHandler(new CokingHandler());
|
||||
registerHandler(new FractioningHandler());
|
||||
registerHandler(new BoilingHandler());
|
||||
registerHandler(new CombinationHandler());
|
||||
|
||||
@ -20,7 +20,7 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityMachineCoker() {
|
||||
super(1);
|
||||
super(2);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.HEAVYOIL, 16_000);
|
||||
tanks[1] = new FluidTank(Fluids.GAS, 8_000);
|
||||
|
||||
@ -620,6 +620,7 @@ hbmfluid.ethanol=Ethanol
|
||||
hbmfluid.enderjuice=Endersaft
|
||||
hbmfluid.fracksol=Frackinglösung
|
||||
hbmfluid.gas=Erdgas
|
||||
hbmfluid.gas_coker=Coker-Gas
|
||||
hbmfluid.gasoline=Benzin
|
||||
hbmfluid.gasoline_leaded=Bleibenzin
|
||||
hbmfluid.heatingoil=Heizöl
|
||||
@ -646,11 +647,13 @@ hbmfluid.mug=Mug Root Beer
|
||||
hbmfluid.mug_hot=Heißes Mug Root Beer
|
||||
hbmfluid.mustardgas=Senfgas
|
||||
hbmfluid.naphtha=Mitteldestillat
|
||||
hbmfluid.naphtha_coker=Coker-Naphtha
|
||||
hbmfluid.naphtha_crack=Crack-Mitteldestillat
|
||||
hbmfluid.nitan=NITAN© 100 Oktan Supertreibstoff
|
||||
hbmfluid.nitric_acid=Salpetersäure
|
||||
hbmfluid.none=Nichts
|
||||
hbmfluid.oil=Rohöl
|
||||
hbmfluid.oil_coker=Coker-Öl
|
||||
hbmfluid.oxyhydrogen=Knallgas
|
||||
hbmfluid.oxygen=Flüssiger Sauerstoff
|
||||
hbmfluid.pain=Pandemonium(III)tantalit-Lösung
|
||||
|
||||
@ -1189,6 +1189,7 @@ hbmfluid.ethanol=Ethanol
|
||||
hbmfluid.enderjuice=Ender Juice
|
||||
hbmfluid.fracksol=Fracking Solution
|
||||
hbmfluid.gas=Natural Gas
|
||||
hbmfluid.gas_coker=Coker Gas
|
||||
hbmfluid.gasoline=Gasoline
|
||||
hbmfluid.gasoline_leaded=Leaded Gasoline
|
||||
hbmfluid.heatingoil=Heating Oil
|
||||
@ -1215,11 +1216,13 @@ hbmfluid.mug=Mug Root Beer
|
||||
hbmfluid.mug_hot=Hot Mug Root Beer
|
||||
hbmfluid.mustardgas=Mustard Gas
|
||||
hbmfluid.naphtha=Naphtha
|
||||
hbmfluid.naphtha_coker=Coker Naphtha
|
||||
hbmfluid.naphtha_crack=Cracked Naphtha
|
||||
hbmfluid.nitan=NITAN© 100 Octane Super Fuel
|
||||
hbmfluid.nitric_acid=Nitric Acid
|
||||
hbmfluid.none=None
|
||||
hbmfluid.oil=Crude Oil
|
||||
hbmfluid.oil_coker=Coker Oil
|
||||
hbmfluid.oxygen=Liquid Oxygen
|
||||
hbmfluid.oxyhydrogen=Oxyhydrogen
|
||||
hbmfluid.pain=Pandemonium(III)tantalite Solution
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/gui/fluids/gas_coker.png
Normal file
BIN
src/main/resources/assets/hbm/textures/gui/fluids/gas_coker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 558 B |
Binary file not shown.
|
After Width: | Height: | Size: 554 B |
BIN
src/main/resources/assets/hbm/textures/gui/fluids/oil_coker.png
Normal file
BIN
src/main/resources/assets/hbm/textures/gui/fluids/oil_coker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 530 B |
Loading…
x
Reference in New Issue
Block a user