Skip to content

Commit

Permalink
Fusion Changes (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Dec 23, 2021
1 parent b5aecc0 commit 017116a
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import gregtech.api.recipes.MatchingMode;
import gregtech.api.recipes.Recipe;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;
import net.minecraft.util.Tuple;
import net.minecraftforge.items.IItemHandlerModifiable;

Expand Down Expand Up @@ -240,13 +241,6 @@ protected int[] runOverclockingLogic(@Nonnull Recipe recipe, boolean negativeEU,
return overclock;
}

@Override
protected int[] performOverclocking(Recipe recipe, boolean negativeEU) {
int maxOverclocks = getOverclockingTier(getMaxVoltage()) - 1; // exclude ULV overclocking

return runOverclockingLogic(recipe, negativeEU, maxOverclocks);
}

protected Tuple<Integer, Double> getMaintenanceValues() {
MultiblockWithDisplayBase displayBase = this.metaTileEntity instanceof MultiblockWithDisplayBase ? (MultiblockWithDisplayBase) metaTileEntity : null;
int numMaintenanceProblems = displayBase == null || !displayBase.hasMaintenanceMechanics() ? 0 : displayBase.getNumMaintenanceProblems();
Expand Down
21 changes: 9 additions & 12 deletions src/main/java/gregtech/api/recipes/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gregtech.api.recipes.builders.*;
import gregtech.api.recipes.machines.*;
import gregtech.api.sound.GTSounds;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import net.minecraft.init.SoundEvents;
import stanhebben.zenscript.annotations.ZenClass;
Expand All @@ -34,17 +33,15 @@ public class RecipeMaps {
.onRecipeBuild(recipeBuilder -> {
if (recipeBuilder.getFluidInputs().isEmpty()) {
recipeBuilder.fluidInputs(Materials.Oxygen.getFluid(recipeBuilder.duration));
for (Material material : new Material[]{Materials.Argon, Materials.Nitrogen}) {
int plasmaAmount = (int) Math.max(1L, recipeBuilder.duration / (material.getMass() * 16L));
RecipeMaps.ARC_FURNACE_RECIPES.recipeBuilder()
.inputsIngredients(recipeBuilder.getInputs())
.outputs(recipeBuilder.getOutputs())
.duration(Math.max(1, recipeBuilder.duration / 16))
.EUt(recipeBuilder.EUt / 3)
.fluidInputs(material.getPlasma(plasmaAmount))
.fluidOutputs(material.getFluid(plasmaAmount))
.buildAndRegister();
}
int plasmaAmount = (int) Math.max(1L, recipeBuilder.duration / (Materials.Argon.getMass() * 16L));
RecipeMaps.ARC_FURNACE_RECIPES.recipeBuilder()
.inputsIngredients(recipeBuilder.getInputs())
.outputs(recipeBuilder.getOutputs())
.duration(Math.max(1, recipeBuilder.duration / 16))
.EUt(recipeBuilder.EUt / 3)
.fluidInputs(Materials.Argon.getPlasma(plasmaAmount))
.fluidOutputs(Materials.Argon.getFluid(plasmaAmount))
.buildAndRegister();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void register() {
.build();

Arsenic = new Material.Builder(6, "arsenic")
.dust()
.dust().fluid()
.color(0x676756)
.element(Elements.As)
.build();
Expand Down Expand Up @@ -206,9 +206,9 @@ public static void register() {

Darmstadtium = new Material.Builder(27, "darmstadtium")
.ingot().fluid()
.color(0xAAAAAA)
.color(0x578062)
.flags(EXT2_METAL, GENERATE_ROTOR, GENERATE_DENSE)
.element(Elements.Ds)
.setHidden()
.build();

Deuterium = new Material.Builder(28, "deuterium")
Expand Down Expand Up @@ -428,9 +428,9 @@ public static void register() {

Livermorium = new Material.Builder(57, "livermorium")
.ingot().fluid()
.color(0x578062).iconSet(SHINY)
.flags(EXT2_METAL, GENERATE_ROTOR, GENERATE_DENSE)
.color(0xAAAAAA).iconSet(SHINY)
.element(Elements.Lv)
.setHidden()
.build();

Lutetium = new Material.Builder(58, "lutetium")
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public static void register() {
.flags(GENERATE_FOIL)
.element(Elements.Ke)
.cableProperties(GTValues.V[7], 6, 4)
.blastTemp(7500, GasTier.HIGH, VA[LuV], 1500)
.blastTemp(7200, GasTier.HIGH, VA[LuV], 1500)
.build();

Adamantium = new Material.Builder(131, "adamantium")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ protected void addDisplayText(List<ITextComponent> textList) {
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);
tooltip.add(I18n.format("gregtech.machine.fusion_reactor.capacity", calculateEnergyStorageFactor(16) / 1000000L));
tooltip.add(I18n.format("gregtech.machine.fusion_reactor.overclocking"));
}

@Nonnull
Expand All @@ -301,6 +302,16 @@ public FusionRecipeLogic(MetaTileEntityFusionReactor tileEntity) {
super(tileEntity);
}

@Override
protected double getOverclockingDurationDivisor() {
return 2.0D;
}

@Override
protected double getOverclockingVoltageMultiplier() {
return 2.0D;
}

@Override
protected long getMaxVoltage() {
return Math.min(GTValues.V[tier], super.getMaxVoltage());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/loaders/MaterialInfoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void init() {
new MaterialStack(Materials.Rubber, OrePrefix.plate.materialAmount * 2)));

OreDictUnifier.registerOre(MetaTileEntities.HULL[8].getStackForm(), new ItemMaterialInfo(
new MaterialStack(Materials.Livermorium, OrePrefix.plate.materialAmount * 8),
new MaterialStack(Materials.Darmstadtium, OrePrefix.plate.materialAmount * 8),
new MaterialStack(Materials.YttriumBariumCuprate, OrePrefix.cableGtSingle.materialAmount * 2),
new MaterialStack(Materials.Rubber, OrePrefix.plate.materialAmount * 2)));

Expand Down
27 changes: 14 additions & 13 deletions src/main/java/gregtech/loaders/recipe/AssemblyLineLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import gregtech.api.GTValues;
import gregtech.api.recipes.RecipeMaps;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.MarkerMaterials;
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.ore.OrePrefix;
Expand All @@ -22,10 +21,10 @@ public static void init() {
.input(OrePrefix.circuit, MarkerMaterials.Tier.Ultimate)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Ultimate)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Ultimate)
.input(OrePrefix.plate, Materials.Plutonium241)
.input(OrePrefix.plate, Materials.Trinium)
.input(OrePrefix.plateDouble, Materials.Plutonium241)
.input(OrePrefix.plateDouble, Materials.Osmiridium)
.inputs(MetaItems.FIELD_GENERATOR_IV.getStackForm(2))
.inputs(MetaItems.HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(32))
.inputs(MetaItems.ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64))
.input(OrePrefix.wireGtSingle, Materials.IndiumTinBariumTitaniumCuprate, 32)
.fluidInputs(Materials.SolderingAlloy.getFluid(GTValues.L * 8))
.fluidInputs(Materials.NiobiumTitanium.getFluid(GTValues.L * 8))
Expand All @@ -35,33 +34,35 @@ public static void init() {
.buildAndRegister();

RecipeMaps.ASSEMBLY_LINE_RECIPES.recipeBuilder()
.inputs(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.SUPERCONDUCTOR_COIL))
.inputs(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_COIL))
.input(OrePrefix.circuit, MarkerMaterials.Tier.Super)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Super)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Super)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Super)
.input(OrePrefix.plate, Materials.Naquadria)
.input(OrePrefix.plate, Materials.Europium)
.input(OrePrefix.plateDouble, Materials.Naquadria)
.input(OrePrefix.plateDouble, Materials.Europium)
.inputs(MetaItems.FIELD_GENERATOR_LUV.getStackForm(2))
.inputs(MetaItems.HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(48))
.inputs(MetaItems.ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(48))
.inputs(MetaItems.ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(48))
.input(OrePrefix.wireGtSingle, Materials.UraniumRhodiumDinaquadide, 32)
.fluidInputs(Materials.SolderingAlloy.getFluid(GTValues.L * 8))
.fluidInputs(Materials.NaquadahAlloy.getFluid(GTValues.L * 8))
.fluidInputs(Materials.VanadiumGallium.getFluid(GTValues.L * 8))
.outputs(MetaTileEntities.FUSION_REACTOR[1].getStackForm())
.duration(1000)
.EUt(61440)
.buildAndRegister();

RecipeMaps.ASSEMBLY_LINE_RECIPES.recipeBuilder()
.inputs(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.SUPERCONDUCTOR_COIL))
.inputs(MetaBlocks.FUSION_CASING.getItemVariant(BlockFusionCasing.CasingType.FUSION_COIL))
.input(OrePrefix.circuit, MarkerMaterials.Tier.Infinite)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Infinite)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Infinite)
.input(OrePrefix.circuit, MarkerMaterials.Tier.Infinite)
.input(OrePrefix.plate, Materials.NetherStar)
.input(OrePrefix.plate, Materials.Americium)
.inputs(MetaItems.QUANTUM_STAR.getStackForm())
.input(OrePrefix.plateDouble, Materials.Americium)
.inputs(MetaItems.FIELD_GENERATOR_ZPM.getStackForm(2))
.inputs(MetaItems.HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64))
.inputs(MetaItems.ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64))
.inputs(MetaItems.ULTRA_HIGH_POWER_INTEGRATED_CIRCUIT.getStackForm(64))
.input(OrePrefix.wireGtSingle, Materials.EnrichedNaquadahTriniumEuropiumDuranide, 32)
.fluidInputs(Materials.SolderingAlloy.getFluid(GTValues.L * 8))
.fluidInputs(Materials.YttriumBariumCuprate.getFluid(GTValues.L * 8))
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gregtech/loaders/recipe/CraftingComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static void initializeComponents() {
{5, new UnificationEntry(OrePrefix.plate, Materials.TungstenSteel)},
{6, new UnificationEntry(OrePrefix.plate, Materials.RhodiumPlatedPalladium)},
{7, new UnificationEntry(OrePrefix.plate, Materials.NaquadahAlloy)},
{8, new UnificationEntry(OrePrefix.plate, Materials.Livermorium)},
{8, new UnificationEntry(OrePrefix.plate, Materials.Darmstadtium)},
{9, new UnificationEntry(OrePrefix.plate, Materials.Neutronium)},

}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));
Expand Down Expand Up @@ -399,7 +399,7 @@ public static void initializeComponents() {
{5, new UnificationEntry(OrePrefix.rotor, Materials.TungstenSteel)},
{6, new UnificationEntry(OrePrefix.rotor, Materials.RhodiumPlatedPalladium)},
{7, new UnificationEntry(OrePrefix.rotor, Materials.NaquadahAlloy)},
{8, new UnificationEntry(OrePrefix.rotor, Materials.Livermorium)},
{8, new UnificationEntry(OrePrefix.rotor, Materials.Darmstadtium)},

}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/gregtech/loaders/recipe/FuelRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public static void registerFuels() {

//plasma turbine
registerPlasmaFuel(Helium.getPlasma(1), 2560, LV);
registerPlasmaFuel(Nitrogen.getPlasma(1), 4032, LV);
registerPlasmaFuel(Oxygen.getPlasma(1), 4096, LV);
registerPlasmaFuel(Iron.getPlasma(16), 103219, LV);
registerPlasmaFuel(Nickel.getPlasma(16), 106905, LV);
registerPlasmaFuel(Oxygen.getPlasma(1), 3072, LV);
registerPlasmaFuel(Nitrogen.getPlasma(1), 4096, LV);
registerPlasmaFuel(Iron.getPlasma(1), 6144, LV);
registerPlasmaFuel(Nickel.getPlasma(1), 12288, LV);

}

Expand Down
Loading

0 comments on commit 017116a

Please sign in to comment.