Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godforge hangover #3396

Merged
merged 58 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7c3b73d
Fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/1…
serenibyss Oct 21, 2024
a7b6d38
fix nbt saving issue
serenibyss Oct 21, 2024
ae85124
fix color interpolation on some cycle rate values
serenibyss Oct 21, 2024
0662f1b
fix nbt issue with ring amount
serenibyss Oct 21, 2024
fa58703
Merge branch 'master' into godforge-hangover
serenibyss Oct 21, 2024
ea8ff76
fix missed localization
serenibyss Oct 21, 2024
bf1449d
fix render data defaults on break+replace
serenibyss Oct 22, 2024
b3107b6
update my custom preset, fix import
serenibyss Oct 22, 2024
1f4dfc6
spotless, cleanup
serenibyss Oct 22, 2024
eeb760d
cleanup multi tooltip code
serenibyss Oct 22, 2024
7148c95
fix lang typo
serenibyss Oct 22, 2024
de04ec5
fix rainbow icon size
GDCloudstrike Oct 22, 2024
d36e744
add my preset
GDCloudstrike Oct 22, 2024
cd65ce4
update my star color icon
serenibyss Oct 22, 2024
17444f4
add possible inputs window to exotic module
GDCloudstrike Oct 24, 2024
580a1ae
fix display itemstacks changing stacksize
GDCloudstrike Oct 25, 2024
0372af1
enable exotic module batch mode
GDCloudstrike Oct 25, 2024
fcb5662
fix screwdriver render disabling toggle
serenibyss Oct 31, 2024
b1bf7cc
improve nbt further, save formatting mode
serenibyss Oct 31, 2024
6b1af97
Merge branch 'master' into godforge-hangover
serenibyss Oct 31, 2024
a87154b
replace power switch with cosmetic menu
GDCloudstrike Oct 31, 2024
171993c
change default formatting mode to commas
serenibyss Oct 31, 2024
3282d56
clean up exotic module modloaded checks
serenibyss Nov 1, 2024
ebe35ab
fix star size/spin render updating
serenibyss Nov 1, 2024
bc0cc15
move GodforgeMath class to godforge package
serenibyss Nov 1, 2024
0f390d2
clean up upgrade tree ui window creation
serenibyss Nov 1, 2024
97f2aeb
clean up readability further
serenibyss Nov 1, 2024
7c07f9f
start on upgrade refactor
serenibyss Nov 1, 2024
d55f27f
cleanup, fix forward reference design issue
serenibyss Nov 1, 2024
59be2bd
fix missing window size call on END upgrade
serenibyss Nov 1, 2024
9d19dc1
refactor graviton shard ejection button
serenibyss Nov 1, 2024
e770ca8
remove power button remnants
GDCloudstrike Nov 1, 2024
93b6950
finish upgrades refactor
serenibyss Nov 1, 2024
becc460
more cleanup
serenibyss Nov 2, 2024
f908638
redo manual insertion window logic
serenibyss Nov 2, 2024
1fafc5e
tiny cleanup
serenibyss Nov 2, 2024
1dac7e0
reformat file layout slightly
serenibyss Nov 2, 2024
839363f
Merge branch 'master' into godforge-hangover
serenibyss Nov 2, 2024
ad3822c
clean up annotations
serenibyss Nov 2, 2024
fd866c4
add full upgrade tree syncer
GDCloudstrike Nov 6, 2024
899241a
add base statistics window
GDCloudstrike Nov 6, 2024
08dc0e7
fix nbt saving issue
GDCloudstrike Nov 7, 2024
5e3dc4e
improve stored fuel text positioning
GDCloudstrike Nov 7, 2024
0addce2
simplify grid line code
GDCloudstrike Nov 7, 2024
c7ee297
add parameter descriptions
GDCloudstrike Nov 8, 2024
f71d6fb
fix exoticizer ignoring input fluid amounts
GDCloudstrike Nov 9, 2024
94dc032
minor upgrade description change
GDCloudstrike Nov 17, 2024
b667983
Fix IMKG formula description
serenibyss Nov 18, 2024
04c0aae
reword IMKG description, fix SEFCP description
serenibyss Nov 18, 2024
bb908e5
move away from classicHatches() for multi parts
serenibyss Nov 18, 2024
8e6a1de
improve window handling
serenibyss Nov 21, 2024
b1dfe17
Merge branch 'master' into godforge-hangover
GDCloudstrike Nov 21, 2024
b3479a0
add nei window for upgrade costs
GDCloudstrike Nov 22, 2024
bcf92b3
improve upgrade nei page text centering
serenibyss Nov 23, 2024
af909f8
allow manual insertion slots to open NEI on click
serenibyss Nov 26, 2024
5bc3d23
remove breakdown tooltip (put on ice for now)
GDCloudstrike Nov 27, 2024
a6ab9e9
Merge branch 'master' into godforge-hangover
GDCloudstrike Nov 28, 2024
b1596ce
Merge branch 'master' into godforge-hangover
Dream-Master Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/gregtech/api/gui/modularui/GTUITextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ public static FallbackableUITexture fallbackableProgressbar(String name, UITextu
public static final UITexture PICTURE_SLOTS_HOLO_3BY3 = UITexture
.fullImage(GregTech.ID, "gui/picture/slots_holo_3by3");
public static final UITexture PICTURE_ARROW_DOUBLE = UITexture.fullImage(GregTech.ID, "gui/picture/arrow_double");
public static final UITexture PICTURE_ARROW_GRAY = UITexture.fullImage(GregTech.ID, "gui/picture/arrow_gray");
public static final UITexture PICTURE_SUPER_BUFFER = UITexture.fullImage(GregTech.ID, "gui/picture/super_buffer");
public static final UITexture PICTURE_SQUARE_LIGHT_GRAY = UITexture
.fullImage(GregTech.ID, "gui/picture/square_light_gray");
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/gregtech/api/util/GTRecipeConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ public class GTRecipeConstants {
public static final RecipeMetadataKey<Boolean> FOG_PLASMA_MULTISTEP = SimpleRecipeMetadataKey
.create(Boolean.class, "fog_plasma_multistep");

/**
* FOG Shortened upgrade name.
*/
public static final RecipeMetadataKey<String> FOG_UPGRADE_NAME_SHORT = SimpleRecipeMetadataKey
.create(String.class, "fog_plasma_upgrade_name_short");

/**
* DEFC Casing tier.
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tectech/loader/recipe/BaseRecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ public void run() {
} else {
Godforge.runDevEnvironmentRecipes();
}
Godforge.addFakeUpgradeCostRecipes();
}
}
220 changes: 147 additions & 73 deletions src/main/java/tectech/loader/recipe/Godforge.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import static gregtech.api.util.GTRecipeConstants.FOG_EXOTIC_TIER;
import static gregtech.api.util.GTRecipeConstants.FOG_PLASMA_MULTISTEP;
import static gregtech.api.util.GTRecipeConstants.FOG_PLASMA_TIER;
import static gregtech.api.util.GTRecipeConstants.FOG_UPGRADE_NAME_SHORT;
import static tectech.recipe.TecTechRecipeMaps.godforgeExoticMatterRecipes;
import static tectech.recipe.TecTechRecipeMaps.godforgePlasmaRecipes;
import static tectech.util.GodforgeMath.getRandomIntInRange;
import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.getRandomIntInRange;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -26,6 +27,8 @@
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;

import org.apache.commons.lang3.ArrayUtils;

import goodgenerator.items.GGMaterial;
import goodgenerator.util.ItemRefer;
import gregtech.api.enums.GTValues;
Expand All @@ -47,6 +50,7 @@
import it.unimi.dsi.fastutil.ints.IntList;
import tectech.recipe.TecTechRecipeMaps;
import tectech.thing.CustomItemList;
import tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade;

public class Godforge implements Runnable {

Expand All @@ -55,7 +59,6 @@ public class Godforge implements Runnable {
public static final HashMap<ItemStack, Integer> exoticModulePlasmaItemMap = new HashMap<>();
public static final HashMap<FluidStack, Integer> exoticModulePlasmaFluidMap = new HashMap<>();
public static final HashMap<ItemStack, Integer> exoticModuleMagmatterItemMap = new HashMap<>();
public static final HashMap<Integer, ItemStack[]> godforgeUpgradeMats = new HashMap<>();
public static final List<ItemStack> quarkGluonFluidItemsForNEI = new ArrayList<>();
public static final List<ItemStack> quarkGluonItemsForNEI = new ArrayList<>();
public static final List<ItemStack> magmatterTimeFluidItemsForNEI = new ArrayList<>();
Expand Down Expand Up @@ -688,83 +691,154 @@ public void run() {

// Godforge upgrade materials
if (EternalSingularity.isModLoaded() && GalaxySpace.isModLoaded()) {
godforgeUpgradeMats.put(
0,
new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUIVBase, 64),
ItemList.SuperconductorComposite.get(32),
GGMaterial.metastableOganesson.get(OrePrefixes.gearGt, 16),
getModItem(EternalSingularity.ID, "eternal_singularity", 8L), ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L) });

godforgeUpgradeMats.put(
5,
new ItemStack[] { GregtechItemList.Mega_AlloyBlastSmelter.get(16L),
ItemList.Casing_Coil_Hypogen.get(64L),
CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(32L),
getModItem(EternalSingularity.ID, "eternal_singularity", 16L),
ItemRefer.Field_Restriction_Coil_T3.get(48), ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L) });

godforgeUpgradeMats.put(
7,
new ItemStack[] { CustomItemList.Godforge_StellarEnergySiphonCasing.get(8),
GregtechItemList.FusionComputer_UV3.get(8), GregtechItemList.Casing_Fusion_Internal2.get(64),
getModItem(GalaxySpace.ID, "item.DysonSwarmParts", 64, 3), MaterialsAlloy.QUANTUM.getPlateDense(48),
MaterialsElements.STANDALONE.RHUGNOR.getGear(32),
getModItem(EternalSingularity.ID, "eternal_singularity", 16L), ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L) });

godforgeUpgradeMats.put(
11,
new ItemStack[] { CustomItemList.Godforge_StellarEnergySiphonCasing.get(16),
ItemRefer.Compact_Fusion_MK5.get(2), ItemRefer.Compact_Fusion_Coil_T4.get(64),
CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(16),
ItemList.Machine_Multi_TranscendentPlasmaMixer.get(4),
MaterialsElements.STANDALONE.RHUGNOR.getGear(64),
GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.Ichorium, 64),
getModItem(EternalSingularity.ID, "eternal_singularity", 32L), ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L) });

godforgeUpgradeMats.put(
26,
new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUMVBase, 64),
MaterialsElements.STANDALONE.HYPOGEN.getFrameBox(64),
MaterialsElements.STANDALONE.DRAGON_METAL.getFrameBox(64),
CustomItemList.EOH_Reinforced_Spatial_Casing.get(64),
CustomItemList.EOH_Infinite_Energy_Casing.get(8), ItemList.ZPM6.get(2),
ItemList.Field_Generator_UMV.get(32) });

godforgeUpgradeMats.put(
29,
new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.WhiteDwarfMatter, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.BlackDwarfMatter, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Eternity, 16),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Universium, 2),
CustomItemList.EOH_Infinite_Energy_Casing.get(64),
CustomItemList.StabilisationFieldGeneratorTier5.get(16), ItemList.ZPM6.get(6),
ItemList.Field_Generator_UMV.get(64) });

godforgeUpgradeMats.put(
30,
new ItemStack[] { CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(32),
CustomItemList.Godforge_StellarEnergySiphonCasing.get(64),
CustomItemList.StabilisationFieldGeneratorTier6.get(48),
ItemList.Transdimensional_Alignment_Matrix.get(8), ItemList.ZPM6.get(16),
ItemList.Robot_Arm_UMV.get(64), ItemList.Conveyor_Module_UMV.get(64) });
ForgeOfGodsUpgrade.START.addExtraCost(
GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUIVBase, 64),
ItemList.SuperconductorComposite.get(32),
GGMaterial.metastableOganesson.get(OrePrefixes.gearGt, 16),
getModItem(EternalSingularity.ID, "eternal_singularity", 8L),
ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L));

ForgeOfGodsUpgrade.FDIM.addExtraCost(
GregtechItemList.Mega_AlloyBlastSmelter.get(16L),
ItemList.Casing_Coil_Hypogen.get(64L),
CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(32L),
getModItem(EternalSingularity.ID, "eternal_singularity", 16L),
ItemRefer.Field_Restriction_Coil_T3.get(48),
ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L));

ForgeOfGodsUpgrade.GPCI.addExtraCost(
CustomItemList.Godforge_StellarEnergySiphonCasing.get(8),
GregtechItemList.FusionComputer_UV3.get(8),
GregtechItemList.Casing_Fusion_Internal2.get(64),
getModItem(GalaxySpace.ID, "item.DysonSwarmParts", 64, 3),
MaterialsAlloy.QUANTUM.getPlateDense(48),
MaterialsElements.STANDALONE.RHUGNOR.getGear(32),
getModItem(EternalSingularity.ID, "eternal_singularity", 16L),
ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L));

ForgeOfGodsUpgrade.QGPIU.addExtraCost(
CustomItemList.Godforge_StellarEnergySiphonCasing.get(16),
ItemRefer.Compact_Fusion_MK5.get(2),
ItemRefer.Compact_Fusion_Coil_T4.get(64),
CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(16),
ItemList.Machine_Multi_TranscendentPlasmaMixer.get(4),
MaterialsElements.STANDALONE.RHUGNOR.getGear(64),
GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.Ichorium, 64),
getModItem(EternalSingularity.ID, "eternal_singularity", 32L),
ItemList.Robot_Arm_UIV.get(64L),
ItemList.Field_Generator_UEV.get(64L));

ForgeOfGodsUpgrade.CD.addExtraCost(
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUMVBase, 64),
MaterialsElements.STANDALONE.HYPOGEN.getFrameBox(64),
MaterialsElements.STANDALONE.DRAGON_METAL.getFrameBox(64),
CustomItemList.EOH_Reinforced_Spatial_Casing.get(64),
CustomItemList.EOH_Infinite_Energy_Casing.get(8),
ItemList.ZPM6.get(2),
ItemList.Field_Generator_UMV.get(32));

ForgeOfGodsUpgrade.EE.addExtraCost(
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.WhiteDwarfMatter, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.BlackDwarfMatter, 64),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Eternity, 16),
GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Universium, 2),
CustomItemList.EOH_Infinite_Energy_Casing.get(64),
CustomItemList.StabilisationFieldGeneratorTier5.get(16),
ItemList.ZPM6.get(6),
ItemList.Field_Generator_UMV.get(64));

ForgeOfGodsUpgrade.END.addExtraCost(
CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(32),
CustomItemList.Godforge_StellarEnergySiphonCasing.get(64),
CustomItemList.StabilisationFieldGeneratorTier6.get(48),
ItemList.Transdimensional_Alignment_Matrix.get(8),
ItemList.ZPM6.get(16),
ItemList.Robot_Arm_UMV.get(64),
ItemList.Conveyor_Module_UMV.get(64));
}

}

public static void runDevEnvironmentRecipes() {
// put something in here to not crash the game in dev environment when opening the manual insertion window
godforgeUpgradeMats.put(0, new ItemStack[] { new ItemStack(Blocks.cobblestone, 4) });
godforgeUpgradeMats.put(5, new ItemStack[] { new ItemStack(Blocks.cobblestone, 8) });
godforgeUpgradeMats.put(7, new ItemStack[] { new ItemStack(Blocks.cobblestone, 12) });
godforgeUpgradeMats.put(11, new ItemStack[] { new ItemStack(Blocks.cobblestone, 16) });
godforgeUpgradeMats.put(26, new ItemStack[] { new ItemStack(Blocks.cobblestone, 32) });
godforgeUpgradeMats.put(29, new ItemStack[] { new ItemStack(Blocks.cobblestone, 48) });
godforgeUpgradeMats.put(30, new ItemStack[] { new ItemStack(Blocks.cobblestone, 64) });
ForgeOfGodsUpgrade.START.addExtraCost(
new ItemStack(Blocks.cobblestone, 4),
new ItemStack(Blocks.dirt, 12),
new ItemStack(Blocks.diamond_block, 8),
new ItemStack(Blocks.gold_block, 32));
ForgeOfGodsUpgrade.FDIM.addExtraCost(new ItemStack(Blocks.cobblestone, 8));
ForgeOfGodsUpgrade.GPCI.addExtraCost(new ItemStack(Blocks.cobblestone, 12));
ForgeOfGodsUpgrade.QGPIU.addExtraCost(new ItemStack(Blocks.cobblestone, 16));
ForgeOfGodsUpgrade.CD.addExtraCost(new ItemStack(Blocks.cobblestone, 32));
ForgeOfGodsUpgrade.EE.addExtraCost(new ItemStack(Blocks.cobblestone, 48));
ForgeOfGodsUpgrade.END.addExtraCost(new ItemStack(Blocks.cobblestone, 64));
}

public static void addFakeUpgradeCostRecipes() {
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.START.getExtraCost()))
.itemOutputs(
CustomItemList.Godforge_GravitonFlowModulatorTier1.get(1),
CustomItemList.Machine_Multi_SmeltingModule.get(1))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.START.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.FDIM.getExtraCost()))
.itemOutputs(CustomItemList.Machine_Multi_MoltenModule.get(1))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.FDIM.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.GPCI.getExtraCost()))
.itemOutputs(CustomItemList.Machine_Multi_PlasmaModule.get(1))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.GPCI.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.QGPIU.getExtraCost()))
.itemOutputs(CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(1))
.fluidOutputs(MaterialsUEVplus.QuarkGluonPlasma.getFluid(1000))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.QGPIU.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.CD.getExtraCost()))
.itemOutputs(CustomItemList.Godforge_GravitonFlowModulatorTier2.get(1))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.CD.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.EE.getExtraCost()))
.itemOutputs(CustomItemList.Godforge_GravitonFlowModulatorTier3.get(1))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.EE.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
GTValues.RA.stdBuilder()
.itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.END.getExtraCost()))
.itemOutputs(MaterialsUEVplus.GravitonShard.getGems(1))
.fluidOutputs(MaterialsUEVplus.MagMatter.getMolten(576), Materials.Neutronium.getPlasma(1000))
.duration(1)
.eut(1)
.metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.END.getShortNameText())
.fake()
.addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes);
}

public static void initMoltenModuleRecipes() {
Expand Down
74 changes: 74 additions & 0 deletions src/main/java/tectech/recipe/GodforgeUpgradeCostFrontend.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package tectech.recipe;

import static gregtech.api.util.GTRecipeConstants.FOG_UPGRADE_NAME_SHORT;

import java.util.List;

import javax.annotation.ParametersAreNonnullByDefault;

import net.minecraft.client.Minecraft;
import net.minecraft.util.EnumChatFormatting;

import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;

import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.RecipeMapFrontend;
import gregtech.api.util.MethodsReturnNonnullByDefault;
import gregtech.common.gui.modularui.UIHelper;
import gregtech.nei.RecipeDisplayInfo;
import tectech.thing.gui.TecTechUITextures;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class GodforgeUpgradeCostFrontend extends RecipeMapFrontend {

public GodforgeUpgradeCostFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
NEIRecipePropertiesBuilder neiPropertiesBuilder) {
super(uiPropertiesBuilder, neiPropertiesBuilder);
}

@Override
public void addGregTechLogo(ModularWindow.Builder builder, Pos2d windowOffset) {
builder.widget(
new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_GODFORGE_LOGO)
.setSize(18, 18)
.setPos(new Pos2d(151, 63).add(windowOffset)));
}

@Override
public List<Pos2d> getItemInputPositions(int itemInputCount) {
return UIHelper.getGridPositions(itemInputCount, 8, 17, 4);
}

@Override
public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
return UIHelper.getGridPositions(itemOutputCount, 116, 26, 1);
}

@Override
public List<Pos2d> getFluidOutputPositions(int fluidOutputCount) {
return UIHelper.getGridPositions(fluidOutputCount, 134, 26, 1);
}

@Override
protected void drawDurationInfo(RecipeDisplayInfo recipeInfo) {}

@Override
protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {}

@Override
protected void drawSpecialInfo(RecipeDisplayInfo recipeInfo) {
String upgradeName = recipeInfo.recipe.getMetadataOrDefault(FOG_UPGRADE_NAME_SHORT, "");
int width = Minecraft.getMinecraft().fontRenderer.getStringWidth(upgradeName);
if (width % 2 == 1) width -= 1;
int xOffset = 18 - width / 2 - 1;
recipeInfo.drawText(" ", 83, -76);
recipeInfo.drawText(
EnumChatFormatting.BLUE.toString() + EnumChatFormatting.UNDERLINE + EnumChatFormatting.BOLD + upgradeName,
110 + xOffset,
0);
}
}
12 changes: 12 additions & 0 deletions src/main/java/tectech/recipe/TecTechRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,16 @@ public static void init() {}
.logoPos(151, 63)
.build();

public static final RecipeMap<RecipeMapBackend> godforgeFakeUpgradeCostRecipes = RecipeMapBuilder
.of("gt.recipe.upgrade_costs")
.maxIO(12, 2, 0, 2)
.addSpecialTexture(83, 38, 30, 13, GTUITextures.PICTURE_ARROW_GRAY)
.dontUseProgressBar()
.neiTransferRect(83, 38, 30, 13)
.frontend(GodforgeUpgradeCostFrontend::new)
.neiHandlerInfo(
builder -> builder.setDisplayStack(CustomItemList.Machine_Multi_ForgeOfGods.get(1))
.setHeight(100))
.build();

}
Loading