more plasmas because sure

This commit is contained in:
Boblet 2025-11-21 13:49:20 +01:00
parent 6818121b9a
commit 170f155bc7
10 changed files with 75 additions and 147 deletions

View File

@ -1,133 +1,13 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.gui.GUIITER;
import com.hbm.inventory.recipes.FusionRecipesLegacy;
import com.hbm.lib.RefStrings;
import com.hbm.inventory.recipes.FusionRecipes;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class FusionRecipeHandler extends NEIGenericRecipeHandler {
public class FusionRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.iter)};
}
@Override
public String getRecipeID() {
return "fusion";
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
PositionedStack result;
public SmeltingSet(ItemStack in, ItemStack out) {
this.input = new PositionedStack(in, 30, 24);
this.result = new PositionedStack(out, 120, 24);
}
@Override
public List<PositionedStack> getIngredients() {
return new ArrayList() {{ add(input); }};
}
@Override
public PositionedStack getResult() {
return result;
}
}
@Override
public String getRecipeName() {
return "Fusion Reactor";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("fusion") && getClass() == FusionRecipeHandler.class) {
Map<ItemStack, ItemStack> recipes = FusionRecipesLegacy.getRecipes();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet(recipe.getKey(), recipe.getValue()));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
public FusionRecipeHandler() {
super(ModBlocks.fusion_torus.getLocalizedName(), FusionRecipes.INSTANCE, ModBlocks.fusion_torus);
}
@Override
public void loadCraftingRecipes(ItemStack result) {
Map<ItemStack, ItemStack> recipes = FusionRecipesLegacy.getRecipes();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getValue(), result)) {
this.arecipes.add(new SmeltingSet(recipe.getKey(), recipe.getValue()));
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("fusion") && getClass() == FusionRecipeHandler.class) {
loadCraftingRecipes("fusion", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
Map<ItemStack, ItemStack> recipes = FusionRecipesLegacy.getRecipes();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)) {
this.arecipes.add(new SmeltingSet(recipe.getKey(), recipe.getValue()));
}
}
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(52 - 5, 34 - 11, 18 * 4, 18), "fusion"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(115 - 5, 17 - 11, 18, 18), "fusion"));
guiGui.add(GUIITER.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_fusion.png";
}
@Override public String getRecipeID() { return "ntmFusion"; }
}

View File

@ -190,6 +190,7 @@ public class Fluids {
public static FluidType BAUXITE_SOLUTION;
public static FluidType ALUMINA;
public static FluidType CONCRETE;
public static FluidType DHC;
/* Lagacy names for compatibility purposes */
@Deprecated public static FluidType ACID; //JAOPCA uses this, apparently
@ -262,8 +263,8 @@ public class Fluids {
ULTRAHOTSTEAM = new FluidType("ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600).addTraits(GASEOUS, UNSIPHONABLE);
COOLANT = new FluidType("COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
LAVA = new FluidType("LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200).addTraits(LIQUID, VISCOUS);
DEUTERIUM = new FluidType("DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS);
TRITIUM = new FluidType("TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS, new FT_VentRadiation(0.001F));
DEUTERIUM = new FluidType("DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).addContainers(new CD_Gastank(0x0000FF, 0xFFFFFF)).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS);
TRITIUM = new FluidType("TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION).addContainers(new CD_Gastank(0x000099, 0xE9FFAA)).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS, new FT_VentRadiation(0.001F));
OIL = new FluidType("OIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(new FT_Flammable(10_000), LIQUID, VISCOUS, P_OIL);
HOTOIL = new FluidType("HOTOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS, P_OIL);
HEAVYOIL = new FluidType("HEAVYOIL", 0x141312, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x513F39)).addTraits(new FT_Flammable(50_000), new FT_Combustible(FuelGrade.LOW, 25_000), LIQUID, VISCOUS, P_OIL);
@ -406,7 +407,8 @@ public class Fluids {
BAUXITE_SOLUTION = new FluidType("BAUXITE_SOLUTION", 0xE2560F, 3, 0, 3, EnumSymbol.ACID).addTraits(new FT_Corrosive(40), LIQUID, VISCOUS);
ALUMINA = new FluidType("ALUMINA", 0xDDFFFF, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
AIR = new FluidType("AIR", 0xE7EAEB, 0, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS);
CONCRETE = new FluidType(152, "CONCRETE", 0xA2A2A2, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
CONCRETE = new FluidType("CONCRETE", 0xA2A2A2, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
DHC = new FluidType(153, "DHC", 0xD2AFFF, 0, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS);
// ^ ^ ^ ^ ^ ^ ^ ^
//ADD NEW FLUIDS HERE
@ -521,6 +523,7 @@ public class Fluids {
metaOrder.add(FISHOIL);
metaOrder.add(SUNFLOWEROIL);
metaOrder.add(NITAN);
metaOrder.add(DHC);
metaOrder.add(BALEFIRE);
//processing fluids
metaOrder.add(SALIENT);

View File

@ -342,6 +342,10 @@ public class ChemicalPlantRecipes extends GenericRecipes<GenericRecipe> {
.inputFluids(new FluidStack(Fluids.KEROSENE, 6_000))
.outputItems(new ItemStack(ModItems.powder_balefire))
.outputFluids(new FluidStack(Fluids.BALEFIRE, 8_000)));
this.register(new GenericRecipe("chem.dhc").setup(400, 500).setIcon(ModItems.fluid_icon, Fluids.DHC.getID())
.inputFluids(new FluidStack(Fluids.DEUTERIUM, 500), new FluidStack(Fluids.REFORMGAS, 250), new FluidStack(Fluids.SYNGAS, 250))
.outputFluids(new FluidStack(Fluids.DHC, 500)));
/// OSMIRIDIUM ///
this.register(new GenericRecipe("chem.osmiridiumdeath").setup(240, 1_000)

View File

@ -31,11 +31,10 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
long solenoid = 25_000;
double breederCapacity = TileEntityFusionBreeder.capacity;
/// DEMO ///
// mostly for breeding helium and tritium, energy gains are enough to ignite TH4
// 15MHE/s to 20MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.dd").setInputEnergy(750_000).setOutputEnergy(1_000_000).setOutputFlux(breederCapacity / 200)
.setNamed().setIcon(new ItemStack(ModItems.gas_full, 1, Fluids.DEUTERIUM.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.DEUTERIUM, 20))
.outputFluids(new FluidStack(Fluids.HELIUM4, 1_000))); // akshuyally it should be helium-3 muh realisme
@ -43,6 +42,7 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
// early fuel
// 5MHE/s to 20MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.do").setInputEnergy(250_000).setOutputEnergy(1_250_000).setOutputFlux(breederCapacity / 200)
.setNamed().setIcon(new ItemStack(ModItems.gas_full, 1, Fluids.OXYGEN.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.DEUTERIUM, 10), new FluidStack(Fluids.OXYGEN, 10))
.outputItems(new ItemStack(ModItems.pellet_charged)));
@ -50,6 +50,7 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
// medium fuel
// 15MHE/s to 75MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.dt").setInputEnergy(750_000).setOutputEnergy(3_750_000).setOutputFlux(breederCapacity / 100)
.setNamed().setIcon(new ItemStack(ModItems.gas_full, 1, Fluids.HELIUM4.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.DEUTERIUM, 10), new FluidStack(Fluids.TRITIUM, 10))
.outputFluids(new FluidStack(Fluids.HELIUM4, 1_000)));
@ -57,13 +58,15 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
// medium fuel, three klystrons or in tandem
// 50MHE/s to 125MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.tcl").setInputEnergy(2_500_000).setOutputEnergy(6_250_000).setOutputFlux(breederCapacity / 20)
.setNamed().setIcon(new ItemStack(ModItems.powder_chlorophyte))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.TRITIUM, 10), new FluidStack(Fluids.CHLORINE, 10))
.outputItems(new ItemStack(ModItems.pellet_charged)));
.outputItems(new ItemStack(ModItems.powder_chlorophyte)));
// medium fuel, aneutronic
// 10MHE/s to 75MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.h3").setInputEnergy(500_000).setOutputEnergy(3_750_000).setOutputFlux(0)
.setNamed().setIcon(new ItemStack(ModItems.gas_full, 1, Fluids.HELIUM3.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.HELIUM3, 20))
.outputFluids(new FluidStack(Fluids.HELIUM4, 1_000)));
@ -71,6 +74,7 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
// medium fuel, in tandem with DD
// 17.5MHE/s to 80MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.th4").setInputEnergy(875_000).setOutputEnergy(4_000_000).setOutputFlux(breederCapacity / 20)
.setNamed().setIcon(new ItemStack(ModItems.gas_full, 1, Fluids.TRITIUM.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.TRITIUM, 10), new FluidStack(Fluids.HELIUM4, 10))
.outputItems(new ItemStack(ModItems.pellet_charged)));
@ -78,21 +82,34 @@ public class FusionRecipes extends GenericRecipes<FusionRecipe> {
// high fuel, ignition exceeds klystron power, requires TH4 or H3
// 75MHE/s to 200MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.cl").setInputEnergy(3_750_000).setOutputEnergy(10_000_000).setOutputFlux(breederCapacity / 10)
.setNamed().setIcon(new ItemStack(ModItems.powder_chlorophyte))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.CHLORINE, 20))
.outputItems(new ItemStack(ModItems.pellet_charged)));
/// DEMO ///
/*
* TODO:
* chlorophyte and more liquid byproduct types
* stellar flux plasma (post ICF, erisite?)
* balefire plasma (raw balefire instead of rocket fuel?)
* scrap ionized particle liquefaction recipe
* deuterated carbon (deut + refgas + syngas in a chemplant)
*/
.outputItems(new ItemStack(ModItems.powder_chlorophyte)));
// high fuel, requires chlorine phase to ignite
// 200MHE/s to 500MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.dhc").setInputEnergy(10_000_000).setOutputEnergy(25_000_000).setOutputFlux(breederCapacity / 5)
.setNamed().setIcon(new ItemStack(ModItems.fluid_icon, 1, Fluids.DHC.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.DHC, 20))
.outputItems(new ItemStack(ModItems.powder_chlorophyte)));
// high fuel, low ignition point
// 20MHE/s to 250MHE/s
this.register((FusionRecipe) new FusionRecipe("fus.bf").setInputEnergy(1_000_000).setOutputEnergy(12_500_000).setOutputFlux(breederCapacity / 5)
.setNamed().setIcon(new ItemStack(ModItems.fluid_icon, 1, Fluids.BALEFIRE.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.BALEFIRE, 15), new FluidStack(Fluids.AMAT, 5)) // do we kick the antimatter requirement or maybe change it?
.outputItems(new ItemStack(ModItems.powder_balefire)));
// high fuel, low ignition point
// 200MHE/s/s to 1GHE/s
this.register((FusionRecipe) new FusionRecipe("fus.stellar").setInputEnergy(10_000_000).setOutputEnergy(50_000_000).setOutputFlux(breederCapacity / 1)
.setNamed().setIcon(new ItemStack(ModItems.fluid_icon, 1, Fluids.STELLAR_FLUX.getID()))
.setPower(solenoid).setDuration(100)
.inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 10))
.outputItems(new ItemStack(ModItems.powder_gold))); // eough
}
// foresight! yeah!

View File

@ -474,9 +474,9 @@ public class PUREXRecipes extends GenericRecipes<GenericRecipe> {
this.register(new GenericRecipe("purex.icf").setup(300, 10_000).setNameWrapper("purex.recycle")
.inputItems(new ComparableStack(ModItems.icf_pellet_depleted))
.outputItems(new ItemStack(ModItems.icf_pellet_empty, 1),
new ItemStack(ModItems.pellet_charged, 1),
new ItemStack(ModItems.pellet_charged, 1),
new ItemStack(ModItems.powder_iron, 1))
.outputFluids(new FluidStack(Fluids.HELIUM4, 1_250)) // enough for another pellet + 25% surplus
.setIconToFirstIngredient());
/// Vitrification

View File

@ -675,6 +675,17 @@ fluid.schrabidic_fluid=Schrabidische Säure
fluid.toxic_fluid=Stereotypischer grüner Schleim
fluid.volcanic_lava_fluid=Vulkanische Lava
fus.bf=Balefire-Plasma
fus.cl=Chlor-Plasma
fus.dd=Deuterium-Plasma
fus.dhc=DKW-Plasma
fus.do=Deuterium-Sauerstoff-Plasma
fus.dt=Deuterium-Tritium-Plasma
fus.h3=Helium-3-Plasma
fus.stellar=Stellares Plasma
fus.tcl=Tritium-Chlor-Plasma
fus.th4=Tritium-Helium-4-Plasma
foundry.filter=Filter: %s
foundry.inverted=Redstone invertiert
foundry.invertFilter=Filter invertiert
@ -781,7 +792,8 @@ hbmfluid.crackoil=Crack-Öl
hbmfluid.crackoil_ds=Entschwefeltes Crack-Öl
hbmfluid.cryogel=Kryogel
hbmfluid.death=Osmiridiumlösung
hbmfluid.deuterium=Deuterium
hbmfluid.deuterium=Deuterierter Kohlenwasserstoff
hbmfluid.dhc=Deuterated Hydrocarbon
hbmfluid.diesel=Diesel
hbmfluid.diesel_crack=Crackdiesel
hbmfluid.diesel_crack_reform=Hochcetan-Diesel

View File

@ -1264,6 +1264,17 @@ foundry.inverted=Redstone inverted
foundry.invertFilter=Filter inverted
foundry.noCast=No mold installed!
fus.bf=Balefire Plasma
fus.cl=Chlorine Plasma
fus.dd=Deuterium Plasma
fus.dhc=DHC Plasma
fus.do=Deuterium-Oxygen Plasma
fus.dt=Deuterium-Tritium Plasma
fus.h3=Helium-3 Plasma
fus.stellar=Stellar Plasma
fus.tcl=Tritium-Chlorine Plasma
fus.th4=Tritium-Helium-4 Plasma
geiger.chunkRad=Current chunk radiation:
geiger.envRad=Total environmental radiation:
geiger.playerRad=Player contamination:
@ -1521,6 +1532,7 @@ hbmfluid.crackoil_ds=Desulfurized Cracked Oil
hbmfluid.cryogel=Cryogel
hbmfluid.death=Osmiridic Solution
hbmfluid.deuterium=Deuterium
hbmfluid.dhc=Deuterated Hydrocarbon
hbmfluid.diesel=Diesel
hbmfluid.diesel_crack=Cracked Diesel
hbmfluid.diesel_crack_reform=High-Cetane Cracked Diesel

View File

@ -6,6 +6,6 @@
"en_US": "Fusion Reactor Plasma Vessel"
},
"content": {
"en_US": "\"Torus\", main component of the [[fusion reactor|Fusion Reactor]], uses fuel and energy from a [[klystron|Klystron]] to generate plasma. Also requires electricity and cooling via [[perfluoromethyl|Perfluoromethyl]] to operate.<br><br>Features four connection ports for external components. Devices that use plasma energy (and not just neutron flux) split the total output, a single component will receive 100% of the energy, two components will receive 62.5% each and three components get 50% each. Therefore, using multiple [[boilers|Fusion Reactor Boiler]] or [[MHDTs|MHD Turbine]] increases the total energy output, although with diminishing returns. Flux levels are not affected when shared, the output remains steady across all ports no matter how many attachments are used.<br><br>Both the buffered electric charge and fuel levels determine working speed, if either is below 50%, the reactor will start to throttle, burnng slower and decreasing output energy. The klystron energy does not affect processing speed, to little energy will simply fail to ignite the plasma, and more energy will not accelerate the reaction."
"en_US": "\"Torus\", main component of the [[fusion reactor|Fusion Reactor]], uses fuel and energy from a [[klystron|Klystron]] to generate plasma. Also requires electricity and cooling via [[perfluoromethyl|Perfluoromethyl]] to operate.<br><br>Features four connection ports for external components. Devices that use plasma energy (and not just neutron flux) split the total output, a single component will receive 100% of the energy, two components will receive 62.5% each and three components get 50% each. Therefore, using multiple [[boilers|Fusion Reactor Boiler]] or [[MHDTs|MHD Turbine]] increases the total energy output, although with diminishing returns. Flux levels are not affected when shared, the output remains steady across all ports no matter how many attachments are used.<br><br>Both the buffered electric charge and fuel levels determine working speed, if either is below 50%, the reactor will start to throttle, burnng slower and decreasing output energy. The klystron energy does not affect processing speed, too little energy will simply fail to ignite the plasma, and more energy will not accelerate the reaction."
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB