mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
cancelable shotgun reloads, more recipe configs
This commit is contained in:
parent
84c28767db
commit
9dc3061160
@ -101,7 +101,9 @@ public class MachineTurbineGas extends BlockDummyable implements ILookOverlay {
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + "Power");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
if(!text.isEmpty()) {
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean hitCheck(ForgeDirection dir, int coreX, int coreY, int coreZ, int exDir, int exRot, int exY, int hitX, int hitY, int hitZ) {
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.inventory.recipes.CrackingRecipes;
|
||||
|
||||
public class CrackingHandler extends NEIUniversalHandler {
|
||||
|
||||
public CrackingHandler() {
|
||||
super("Cracking", ModBlocks.machine_catalytic_cracker, RefineryRecipes.getCrackingRecipesForNEI());
|
||||
super("Cracking", ModBlocks.machine_catalytic_cracker, CrackingRecipes.getCrackingRecipesForNEI());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.inventory.recipes.FractionRecipes;
|
||||
|
||||
public class FractioningHandler extends NEIUniversalHandler {
|
||||
|
||||
public FractioningHandler() {
|
||||
super("Fractioning", ModBlocks.machine_fraction_tower, RefineryRecipes.getFractionRecipesForNEI());
|
||||
super("Fractioning", ModBlocks.machine_fraction_tower, FractionRecipes.getFractionRecipesForNEI());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -358,26 +358,26 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
recipes.add(new ChemRecipe(0, "FP_HEAVYOIL", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.HEAVYOIL))
|
||||
.outputFluids(
|
||||
new FluidStack(RefineryRecipes.heavy_frac_bitu * 10, Fluids.BITUMEN),
|
||||
new FluidStack(RefineryRecipes.heavy_frac_smear * 10, Fluids.SMEAR)
|
||||
new FluidStack(FractionRecipes.heavy_frac_bitu * 10, Fluids.BITUMEN),
|
||||
new FluidStack(FractionRecipes.heavy_frac_smear * 10, Fluids.SMEAR)
|
||||
));
|
||||
recipes.add(new ChemRecipe(1, "FP_SMEAR", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.SMEAR))
|
||||
.outputFluids(
|
||||
new FluidStack(RefineryRecipes.smear_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(RefineryRecipes.smear_frac_lube * 10, Fluids.LUBRICANT)
|
||||
new FluidStack(FractionRecipes.smear_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(FractionRecipes.smear_frac_lube * 10, Fluids.LUBRICANT)
|
||||
));
|
||||
recipes.add(new ChemRecipe(2, "FP_NAPHTHA", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.NAPHTHA))
|
||||
.outputFluids(
|
||||
new FluidStack(RefineryRecipes.napht_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(RefineryRecipes.napht_frac_diesel * 10, Fluids.DIESEL)
|
||||
new FluidStack(FractionRecipes.napht_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(FractionRecipes.napht_frac_diesel * 10, Fluids.DIESEL)
|
||||
));
|
||||
recipes.add(new ChemRecipe(3, "FP_LIGHTOIL", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.LIGHTOIL))
|
||||
.outputFluids(
|
||||
new FluidStack(RefineryRecipes.light_frac_diesel * 10, Fluids.DIESEL),
|
||||
new FluidStack(RefineryRecipes.light_frac_kero * 10, Fluids.KEROSENE)
|
||||
new FluidStack(FractionRecipes.light_frac_diesel * 10, Fluids.DIESEL),
|
||||
new FluidStack(FractionRecipes.light_frac_kero * 10, Fluids.KEROSENE)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
119
src/main/java/com/hbm/inventory/recipes/CrackingRecipes.java
Normal file
119
src/main/java/com/hbm/inventory/recipes/CrackingRecipes.java
Normal file
@ -0,0 +1,119 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
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.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CrackingRecipes extends SerializableRecipe {
|
||||
|
||||
//cracking in percent
|
||||
public static final int oil_crack_oil = 80;
|
||||
public static final int oil_crack_petro = 20;
|
||||
public static final int bitumen_crack_oil = 80;
|
||||
public static final int bitumen_crack_aroma = 20;
|
||||
public static final int smear_crack_napht = 60;
|
||||
public static final int smear_crack_petro = 40;
|
||||
public static final int gas_crack_petro = 30;
|
||||
public static final int gas_crack_unsat = 20;
|
||||
public static final int diesel_crack_kero = 40;
|
||||
public static final int diesel_crack_petro = 30;
|
||||
public static final int kero_crack_petro = 60;
|
||||
public static final int wood_crack_aroma = 10;
|
||||
public static final int wood_crack_heat = 40;
|
||||
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> cracking = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
cracking.put(Fluids.OIL, new Pair(new FluidStack(Fluids.CRACKOIL, oil_crack_oil), new FluidStack(Fluids.PETROLEUM, oil_crack_petro)));
|
||||
cracking.put(Fluids.BITUMEN, new Pair(new FluidStack(Fluids.OIL, bitumen_crack_oil), new FluidStack(Fluids.AROMATICS, bitumen_crack_aroma)));
|
||||
cracking.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.NAPHTHA, smear_crack_napht), new FluidStack(Fluids.PETROLEUM, smear_crack_petro)));
|
||||
cracking.put(Fluids.GAS, new Pair(new FluidStack(Fluids.PETROLEUM, gas_crack_petro), new FluidStack(Fluids.UNSATURATEDS, gas_crack_unsat)));
|
||||
cracking.put(Fluids.DIESEL, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.DIESEL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.KEROSENE, new Pair(new FluidStack(Fluids.PETROLEUM, kero_crack_petro), new FluidStack(Fluids.NONE, 0)));
|
||||
cracking.put(Fluids.WOODOIL, new Pair(new FluidStack(Fluids.HEATINGOIL, wood_crack_heat), new FluidStack(Fluids.AROMATICS, wood_crack_aroma)));
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getCracking(FluidType oil) {
|
||||
return cracking.get(oil);
|
||||
}
|
||||
|
||||
protected static Map<FluidType, Pair<FluidStack, FluidStack>> getCrackingRecipes() {
|
||||
return cracking;
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object> getCrackingRecipesForNEI() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap();
|
||||
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : cracking.entrySet()) {
|
||||
ItemStack[] in = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getKey(), 100),
|
||||
ItemFluidIcon.make(Fluids.STEAM, 200)
|
||||
};
|
||||
ItemStack[] out = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getKey()),
|
||||
ItemFluidIcon.make(recipe.getValue().getValue()),
|
||||
ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)
|
||||
};
|
||||
|
||||
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? new ItemStack[] {ItemFluidIcon.make(recipe.getValue().getKey()), ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)} : out);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCracking.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Inputs are always 100mB, set output quantities accordingly. The steam in/outputs are fixed, using 200mB of steam per 100mB of input.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return cracking;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
cracking.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
FluidType input = Fluids.fromName(obj.get("input").getAsString());
|
||||
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
|
||||
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
|
||||
|
||||
cracking.put(input, new Pair(output1, output2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Pair<FluidStack, FluidStack>> rec = (Entry<FluidType, Pair<FluidStack, FluidStack>>) recipe;
|
||||
|
||||
writer.name("input").value(rec.getKey().getName());
|
||||
writer.name("output1"); this.writeFluidStack(rec.getValue().getKey(), writer);
|
||||
writer.name("output2"); this.writeFluidStack(rec.getValue().getValue(), writer);
|
||||
}
|
||||
}
|
||||
113
src/main/java/com/hbm/inventory/recipes/FractionRecipes.java
Normal file
113
src/main/java/com/hbm/inventory/recipes/FractionRecipes.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
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.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FractionRecipes extends SerializableRecipe {
|
||||
|
||||
public static final int heavy_frac_bitu = 30;
|
||||
public static final int heavy_frac_smear = 70;
|
||||
public static final int smear_frac_heat = 60;
|
||||
public static final int smear_frac_lube = 40;
|
||||
public static final int napht_frac_heat = 40;
|
||||
public static final int napht_frac_diesel = 60;
|
||||
public static final int light_frac_diesel = 40;
|
||||
public static final int light_frac_kero = 60;
|
||||
|
||||
public static final int ncrack_frac_heat = 30;
|
||||
public static final int ncrack_frac_diesel = 70;
|
||||
public static final int lcrack_frac_kero = 70;
|
||||
public static final int lcrack_frac_petro = 30;
|
||||
public static final int coal_frac_coalgas = 30;
|
||||
public static final int coal_frac_oil = 70;
|
||||
public static final int creo_frac_coaloil = 10;
|
||||
public static final int creo_frac_bitu = 90;
|
||||
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> fractions = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, creo_frac_coaloil), new FluidStack(Fluids.BITUMEN, creo_frac_bitu)));
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
return fractions.get(oil);
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object> getFractionRecipesForNEI() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap();
|
||||
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : fractions.entrySet()) {
|
||||
ItemStack[] out = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getKey()),
|
||||
ItemFluidIcon.make(recipe.getValue().getValue())
|
||||
};
|
||||
|
||||
recipes.put(ItemFluidIcon.make(recipe.getKey(), 100), out);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmFractions.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Inputs are always 100mB, set output quantities accordingly.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return fractions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
fractions.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
FluidType input = Fluids.fromName(obj.get("input").getAsString());
|
||||
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
|
||||
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
|
||||
|
||||
fractions.put(input, new Pair(output1, output2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Pair<FluidStack, FluidStack>> rec = (Entry<FluidType, Pair<FluidStack, FluidStack>>) recipe;
|
||||
|
||||
writer.name("input").value(rec.getKey().getName());
|
||||
writer.name("output1"); this.writeFluidStack(rec.getValue().getKey(), writer);
|
||||
writer.name("output2"); this.writeFluidStack(rec.getValue().getValue(), writer);
|
||||
}
|
||||
}
|
||||
@ -2,11 +2,15 @@ package com.hbm.inventory.recipes;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.KNO;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
@ -14,14 +18,16 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
public class MixerRecipes {
|
||||
public class MixerRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<FluidType, MixerRecipe> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
recipes.put(Fluids.COOLANT, new MixerRecipe(2_000, 50).setStack1(new FluidStack(Fluids.WATER, 1_800)).setSolid(new OreDictStack(KNO.dust())));
|
||||
recipes.put(Fluids.CRYOGEL, new MixerRecipe(2_000, 50).setStack1(new FluidStack(Fluids.COOLANT, 1_800)).setSolid(new ComparableStack(ModItems.powder_ice)));
|
||||
recipes.put(Fluids.NITAN, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.KEROSENE, 600)).setStack2(new FluidStack(Fluids.MERCURY, 200)).setSolid(new ComparableStack(ModItems.powder_nitan_mix)));
|
||||
@ -44,6 +50,50 @@ public class MixerRecipes {
|
||||
public static MixerRecipe getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmMixer.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
FluidStack output = this.readFluidStack(obj.get("output").getAsJsonArray());
|
||||
MixerRecipe mix = new MixerRecipe(output.fill, obj.get("duration").getAsInt());
|
||||
|
||||
if(obj.has("input1")) mix.setStack1(this.readFluidStack(obj.get("input1").getAsJsonArray()));
|
||||
if(obj.has("input2")) mix.setStack2(this.readFluidStack(obj.get("input2").getAsJsonArray()));
|
||||
if(obj.has("solidInput")) mix.setSolid(this.readAStack(obj.get("solidInput").getAsJsonArray()));
|
||||
|
||||
recipes.put(output.type, mix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, MixerRecipe> rec = (Entry<FluidType, MixerRecipe>) recipe;
|
||||
MixerRecipe mix = rec.getValue();
|
||||
FluidStack output = new FluidStack(rec.getKey(), mix.output);
|
||||
|
||||
writer.name("duration").value(mix.processTime);
|
||||
writer.name("output");
|
||||
this.writeFluidStack(output, writer);
|
||||
|
||||
if(mix.input1 != null) { writer.name("input1"); this.writeFluidStack(mix.input1, writer); }
|
||||
if(mix.input2 != null) { writer.name("input2"); this.writeFluidStack(mix.input2, writer); }
|
||||
if(mix.solidInput != null) { writer.name("solidInput"); this.writeAStack(mix.solidInput, writer); }
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import java.util.Map.Entry;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.inventory.recipes.CrackingRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -51,7 +51,7 @@ public class RadiolysisRecipes {
|
||||
|
||||
//automatically add cracking recipes to the radiolysis recipe list
|
||||
//we want the numbers and types to stay consistent anyway and this will save us a lot of headache later on
|
||||
Map<FluidType, Pair<FluidStack, FluidStack>> cracking = RefineryRecipes.getCrackingRecipes();
|
||||
Map<FluidType, Pair<FluidStack, FluidStack>> cracking = CrackingRecipes.getCrackingRecipes();
|
||||
|
||||
if(cracking.isEmpty()) {
|
||||
throw new IllegalStateException("RefineryRecipes.getCrackingRecipes has yielded an empty map while registering the radiolysis recipes! Either the load order is broken or cracking recipes have been removed!");
|
||||
|
||||
@ -29,42 +29,7 @@ public class RefineryRecipes {
|
||||
public static final int crack_frac_aroma = 15;
|
||||
public static final int crack_frac_unsat = 15;
|
||||
|
||||
public static final int heavy_frac_bitu = 30;
|
||||
public static final int heavy_frac_smear = 70;
|
||||
public static final int smear_frac_heat = 60;
|
||||
public static final int smear_frac_lube = 40;
|
||||
public static final int napht_frac_heat = 40;
|
||||
public static final int napht_frac_diesel = 60;
|
||||
public static final int light_frac_diesel = 40;
|
||||
public static final int light_frac_kero = 60;
|
||||
|
||||
public static final int ncrack_frac_heat = 30;
|
||||
public static final int ncrack_frac_diesel = 70;
|
||||
public static final int lcrack_frac_kero = 70;
|
||||
public static final int lcrack_frac_petro = 30;
|
||||
public static final int coal_frac_coalgas = 30;
|
||||
public static final int coal_frac_oil = 70;
|
||||
public static final int creo_frac_coaloil = 10;
|
||||
public static final int creo_frac_bitu = 90;
|
||||
|
||||
//cracking in percent
|
||||
public static final int oil_crack_oil = 80;
|
||||
public static final int oil_crack_petro = 20;
|
||||
public static final int bitumen_crack_oil = 80;
|
||||
public static final int bitumen_crack_aroma = 20;
|
||||
public static final int smear_crack_napht = 60;
|
||||
public static final int smear_crack_petro = 40;
|
||||
public static final int gas_crack_petro = 30;
|
||||
public static final int gas_crack_unsat = 20;
|
||||
public static final int diesel_crack_kero = 40;
|
||||
public static final int diesel_crack_petro = 30;
|
||||
public static final int kero_crack_petro = 60;
|
||||
public static final int wood_crack_aroma = 10;
|
||||
public static final int wood_crack_heat = 40;
|
||||
|
||||
private static Map<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> refinery = new HashMap();
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> fractions = new HashMap();
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> cracking = new HashMap();
|
||||
|
||||
public static Map<Object, Object[]> getRefineryRecipe() {
|
||||
|
||||
@ -103,78 +68,7 @@ public class RefineryRecipes {
|
||||
));
|
||||
}
|
||||
|
||||
public static void registerFractions() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, creo_frac_coaloil), new FluidStack(Fluids.BITUMEN, creo_frac_bitu)));
|
||||
}
|
||||
|
||||
public static void registerCracking() {
|
||||
cracking.put(Fluids.OIL, new Pair(new FluidStack(Fluids.CRACKOIL, oil_crack_oil), new FluidStack(Fluids.PETROLEUM, oil_crack_petro)));
|
||||
cracking.put(Fluids.BITUMEN, new Pair(new FluidStack(Fluids.OIL, bitumen_crack_oil), new FluidStack(Fluids.AROMATICS, bitumen_crack_aroma)));
|
||||
cracking.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.NAPHTHA, smear_crack_napht), new FluidStack(Fluids.PETROLEUM, smear_crack_petro)));
|
||||
cracking.put(Fluids.GAS, new Pair(new FluidStack(Fluids.PETROLEUM, gas_crack_petro), new FluidStack(Fluids.UNSATURATEDS, gas_crack_unsat)));
|
||||
cracking.put(Fluids.DIESEL, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.DIESEL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.KEROSENE, new Pair(new FluidStack(Fluids.PETROLEUM, kero_crack_petro), new FluidStack(Fluids.NONE, 0)));
|
||||
cracking.put(Fluids.WOODOIL, new Pair(new FluidStack(Fluids.HEATINGOIL, wood_crack_heat), new FluidStack(Fluids.AROMATICS, wood_crack_aroma)));
|
||||
}
|
||||
|
||||
public static Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> getRefinery(FluidType oil) {
|
||||
return refinery.get(oil);
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
return fractions.get(oil);
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getCracking(FluidType oil) {
|
||||
return cracking.get(oil);
|
||||
}
|
||||
|
||||
protected static Map<FluidType, Pair<FluidStack, FluidStack>> getCrackingRecipes() {
|
||||
return cracking;
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object> getFractionRecipesForNEI() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap();
|
||||
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : fractions.entrySet()) {
|
||||
ItemStack[] out = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getKey()),
|
||||
ItemFluidIcon.make(recipe.getValue().getValue())
|
||||
};
|
||||
|
||||
recipes.put(ItemFluidIcon.make(recipe.getKey(), 100), out);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object> getCrackingRecipesForNEI() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap();
|
||||
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : cracking.entrySet()) {
|
||||
ItemStack[] in = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getKey(), 100),
|
||||
ItemFluidIcon.make(Fluids.STEAM, 200)
|
||||
};
|
||||
ItemStack[] out = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getKey()),
|
||||
ItemFluidIcon.make(recipe.getValue().getValue()),
|
||||
ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)
|
||||
};
|
||||
|
||||
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? new ItemStack[] {ItemFluidIcon.make(recipe.getValue().getKey()), ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)} : out);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,11 +43,14 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ChemplantRecipes());
|
||||
recipeHandlers.add(new CrucibleRecipes());
|
||||
recipeHandlers.add(new CentrifugeRecipes());
|
||||
recipeHandlers.add(new FractionRecipes());
|
||||
recipeHandlers.add(new CrackingRecipes());
|
||||
recipeHandlers.add(new LiquefactionRecipes());
|
||||
recipeHandlers.add(new SolidificationRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
recipeHandlers.add(new FuelPoolRecipes());
|
||||
recipeHandlers.add(new MixerRecipes());
|
||||
recipeHandlers.add(new MatDistribution());
|
||||
}
|
||||
|
||||
@ -213,7 +216,7 @@ public abstract class SerializableRecipe {
|
||||
OreDictStack ore = (OreDictStack) astack;
|
||||
writer.value("dict"); //DICT identifier
|
||||
writer.value(ore.name); //dict name
|
||||
writer.value(ore.stacksize); //stacksize
|
||||
if(ore.stacksize != 1) writer.value(ore.stacksize); //stacksize
|
||||
}
|
||||
writer.endArray();
|
||||
writer.setIndent(" ");
|
||||
|
||||
@ -164,6 +164,11 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
//whether or not the gun can shoot in its current state
|
||||
protected boolean tryShoot(ItemStack stack, World world, EntityPlayer player, boolean main) {
|
||||
|
||||
if(getIsReloading(stack) && mainConfig.reloadType == mainConfig.RELOAD_SINGLE) {
|
||||
setReloadCycle(stack, 0);
|
||||
setIsReloading(stack, false);
|
||||
}
|
||||
|
||||
if(main && getDelay(stack) == 0 && !getIsReloading(stack) && getItemWear(stack) < mainConfig.durability) {
|
||||
return hasAmmo(stack, player, main);
|
||||
}
|
||||
|
||||
@ -781,16 +781,15 @@ public class MainRegistry {
|
||||
AnvilRecipes.register();
|
||||
PressRecipes.register();
|
||||
RefineryRecipes.registerRefinery();
|
||||
RefineryRecipes.registerFractions();
|
||||
RefineryRecipes.registerCracking();
|
||||
RadiolysisRecipes.registerRadiolysis();
|
||||
GasCentrifugeRecipes.register();
|
||||
CombinationRecipes.register();
|
||||
MixerRecipes.register();
|
||||
|
||||
//the good stuff
|
||||
SerializableRecipe.registerAllHandlers();
|
||||
SerializableRecipe.initialize();
|
||||
|
||||
//has to register after cracking, and therefore after all serializable recipes
|
||||
RadiolysisRecipes.registerRadiolysis();
|
||||
|
||||
FalloutConfigJSON.initialize();
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.inventory.recipes.CrackingRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -93,7 +93,7 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
|
||||
private void crack() {
|
||||
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = CrackingRecipes.getCracking(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
|
||||
@ -118,7 +118,7 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
|
||||
private void setupTanks() {
|
||||
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = CrackingRecipes.getCracking(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
tanks[1].setTankType(Fluids.STEAM);
|
||||
|
||||
@ -9,7 +9,7 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.inventory.recipes.FractionRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -120,7 +120,7 @@ public class TileEntityMachineFractionTower extends TileEntityLoadedBase impleme
|
||||
|
||||
private void setupTanks() {
|
||||
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = FractionRecipes.getFractions(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
tanks[1].setTankType(quart.getKey().type);
|
||||
@ -134,7 +134,7 @@ public class TileEntityMachineFractionTower extends TileEntityLoadedBase impleme
|
||||
|
||||
private void fractionate() {
|
||||
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = FractionRecipes.getFractions(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user