Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Forge of the Gods (#225)
Browse files Browse the repository at this point in the history
* Initial commit

* Graviton Modulation Casings

* It forms

* testing cursed things, will rework soon

* test better recipe check

* get rid of cursed stuff

* fix OC

* parameter shenanigans

* fuel input hatch

* redo fuel drain

* fluid output

* add blocks

* run on preload

* dependency bump

* preliminary structure works

* fix some misc things

* New class

* Fix build issue

* 1 hatch

* Cleaning up code with seperate class for structure string

* start on modules

* Spotless + Smelting Module Class + BaseModule Changes

* Remove useless import

* ...

* protected

* trying module things

* add checkRecipe, remove some redundant stuff

* Initial commit

* Graviton Modulation Casings

* It forms

* testing cursed things, will rework soon

* test better recipe check

* get rid of cursed stuff

* fix OC

* parameter shenanigans

* fuel input hatch

* redo fuel drain

* fluid output

* add blocks

* run on preload

* preliminary structure works

* fix some misc things

* New class

* 1 hatch

* start on modules

* Fix build issue

* Cleaning up code with seperate class for structure string

* Spotless + Smelting Module Class + BaseModule Changes

* Remove useless import

* protected

* trying module things

* add checkRecipe, remove some redundant stuff

* ...

* New Classes + Modules

* Recipe Maps

* fix deps

* recipe map fixes

* make modules connect

* spotless

* remove recipe functionality + misc cleanup

* parallel parameter

* remove unneeded check

* fix item to fluid conversion + remove parameter

* outputs appear now

* remove parallel param

* improve scanner info

* parameter adjustment + add onRemoval

* parameter followup

* plasma module (almost) fully works

* attempt at fixing param

* Fixes & stuff

* Recommendation fixes

* tooltip upgrade

* Spotless for clean

* plasma recipe map

* recipe adder

* first recipes

* use new recipe map

* Recipe map change stuff

* recipe map fixes

* some quick fixes

* Spotless

* fix null checks

* batch size

* add input separation

* add batch mode parameter and functionality

* spotless

* first recipe addition loops

* start on ui (add button)

* spotless

* add rendering block

* render tile

* more rendering

* summon render block

* spotless again

* greyscale

* lighter

* why is rendering a pain

* fix merge conflicts

* is this the conflict?

* spotless

* merge conflict again :pensib:

* start on upgrade gui

* more upgrade gui things

* saving

* resolve merge conflicts & crashes

* redo added blocks + add new ones + some tooltip stuff

* more tooltip stuff

* one more casing

* forgot this

* redo module processing logic

* migrate to wirelessNetworkManager

* quark gluon -> exotic

* forgot achievements

* adjust plasma module recipemap to prepare for upgrades

* migrate to nice mui gui

* some more plasma recipemap changes

* eve more plasma recipemap changes, yay

* everyone loves plasma recipemap changes

* they never end, do they

* exotic module recipes (wip)

* exotic module recipe processing (mostly works)

* prevent duplicate materials

* make input sizes random

* fix gt++ material conversions

* nbt data things

* start on magmatter mode + misc stuff

* more magmatter work

* no need for putIfAbsent + added awdr and runite

* load recipemap from nbt

* getFluidsStored -> inputFluids

* add upgrades and make them scrollable

* assign window colors to upgrades

* green background

* green background

* redo upgrade IDs and add boolean array for storing whether they are active

* implement system to restrict the order which upgrades can be bought in

* add split functionality

* switch to constants

* reset button tooltip + change texture of upgrade if active

* some cleanup + new fuel config

* button BGs, altered power switch + localisation

* fuel config window + save everything to nbt + random stuff

* new helper class + fuel calculations

* heat calculations + some molten module logic adjustments

* more calculations, fuel hatch removal, transfer values to modules, internal fuel battery

* use values in module processing

* switch to UUID

* switch to numericWidget

* fix speedbonus being infinite sometimes

* move method over to godforgeMath + very minor exotic module changes

* remove this so it actually loads

* new texture

* switch to processInitialSettings

* remove wireless energy things

* add furnace mode

* mode localisation

* remove author tag

* scala bad (switch away from scala arrays)

* nuke all star imports (& godforge recipemap)

* minor wording changes

* add mod checks

* mod check

* revert star textures

* return widget

* dont return object types

* forgot I even enabled debug, whoops

* remove unnecessary GL11 calls

---------

Co-authored-by: TheEpicGamer274 <[email protected]>
Co-authored-by: GTNH-Colen <[email protected]>
Co-authored-by: BlueWeabo <[email protected]>
  • Loading branch information
4 people authored Mar 11, 2024
1 parent 5d8119a commit b03e638
Show file tree
Hide file tree
Showing 57 changed files with 7,449 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/github/technus/tectech/TecTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.github.technus.tectech.loader.MainLoader;
import com.github.technus.tectech.loader.TecTechConfig;
import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
import com.github.technus.tectech.loader.thing.MuTeLoader;
import com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData;
import com.github.technus.tectech.proxy.CommonProxy;
import com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage;
Expand Down Expand Up @@ -87,6 +88,7 @@ public void PreLoad(FMLPreInitializationEvent PreEvent) {

TecTechRecipeMaps.init();
MainLoader.preLoad();
new MuTeLoader().run();
}

@Mod.EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static Materials getOrDefault(String name, Materials def) {
}

public void run() {

new Godforge().run();
// todo: Move those recipes in NHCore
if (NewHorizonsCoreMod.isModLoaded()) {
new Assembler().run();
Expand All @@ -44,6 +44,5 @@ public void run() {
new Extractor().run();
new ResearchStationAssemblyLine().run();
}

}
}
428 changes: 428 additions & 0 deletions src/main/java/com/github/technus/tectech/loader/recipe/Godforge.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Computer;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_DataBank;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_EyeOfHarmony;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_ForgeOfGods;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Infuser;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Microwave;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_MoltenModule;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_PlasmaModule;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_QuarkGluonPlasmaModule;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Research;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_SmeltingModule;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Switch;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_TeslaCoil;
import static com.github.technus.tectech.thing.CustomItemList.Machine_Multi_Transformer;
Expand Down Expand Up @@ -314,6 +319,7 @@
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Uncertainty;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_WirelessMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_EyeOfHarmony;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_ForgeOfGods;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_computer;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_dataBank;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_infuser;
Expand All @@ -322,6 +328,10 @@
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_transformer;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_microwave;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_teslaCoil;
import com.github.technus.tectech.thing.metaTileEntity.multi.godforge_modules.GT_MetaTileEntity_EM_ExoticModule;
import com.github.technus.tectech.thing.metaTileEntity.multi.godforge_modules.GT_MetaTileEntity_EM_MoltenModule;
import com.github.technus.tectech.thing.metaTileEntity.multi.godforge_modules.GT_MetaTileEntity_EM_PlasmaModule;
import com.github.technus.tectech.thing.metaTileEntity.multi.godforge_modules.GT_MetaTileEntity_EM_SmeltingModule;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_PipeBlock_Data;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_PipeBlock_Energy;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data;
Expand Down Expand Up @@ -2025,6 +2035,21 @@ public void run() {
Machine_Multi_EyeOfHarmony.set(
new GT_MetaTileEntity_EM_EyeOfHarmony(15410, "multimachine.em.eye_of_harmony", "Eye of Harmony")
.getStackForm(1L));
Machine_Multi_ForgeOfGods.set(
new GT_MetaTileEntity_EM_ForgeOfGods(15411, "multimachine.em.forge_of_gods", "Forge of the Gods")
.getStackForm(1L));
Machine_Multi_SmeltingModule.set(
new GT_MetaTileEntity_EM_SmeltingModule(15412, "multimachine.em.smelting_module", "Smelting Module")
.getStackForm(1L));
Machine_Multi_MoltenModule.set(
new GT_MetaTileEntity_EM_MoltenModule(15413, "multimachine.em.molten_module", "Molten Module")
.getStackForm(1L));
Machine_Multi_PlasmaModule.set(
new GT_MetaTileEntity_EM_PlasmaModule(15414, "multimachine.em.plasma_module", "Plasma Module")
.getStackForm(1L));
Machine_Multi_QuarkGluonPlasmaModule.set(
new GT_MetaTileEntity_EM_ExoticModule(15415, "multimachine.em.exotic_module", "Exotic Matter Module")
.getStackForm(1L));

// ===================================================================================================
// Hatches
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.technus.tectech.loader.thing;

import com.github.technus.tectech.TecTech;

public class MuTeLoader implements Runnable {

@Override
public void run() {
TecTech.LOGGER.info("TecTech: Registering MultiTileEntities");
registerMachines();
registerCasings();
}

private static void registerMachines() {

}

private static void registerCasings() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
import static com.github.technus.tectech.TecTech.tectechTexturePage1;

import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.thing.block.GodforgeGlassBlock;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.ReactorSimBlock;
import com.github.technus.tectech.thing.block.TileEyeOfHarmony;
import com.github.technus.tectech.thing.block.TileForgeOfGods;
import com.github.technus.tectech.thing.casing.GT_Block_CasingsBA0;
import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT;
import com.github.technus.tectech.thing.casing.GodforgeCasings;
import com.github.technus.tectech.thing.casing.SpacetimeCompressionFieldCasing;
import com.github.technus.tectech.thing.casing.StabilisationFieldCasing;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
Expand Down Expand Up @@ -36,6 +39,7 @@ public class ThingsLoader implements Runnable {
public void run() {

GameRegistry.registerTileEntity(TileEyeOfHarmony.class, MODID + ":EyeOfHarmonyRenderBlock");
GameRegistry.registerTileEntity(TileForgeOfGods.class, MODID + ":ForgeOfGodsRenderBlock");

if (Textures.BlockIcons.casingTexturePages[tectechTexturePage1] == null) {
Textures.BlockIcons.casingTexturePages[tectechTexturePage1] = new ITexture[128];
Expand All @@ -60,6 +64,12 @@ public void run() {

TT_Container_Casings.StabilisationFieldGenerators = new StabilisationFieldCasing();

TT_Container_Casings.GodforgeCasings = new GodforgeCasings();
TecTech.LOGGER.info("Godforge blocks registered.");

GodforgeGlassBlock.run();
TecTech.LOGGER.info("Godforge Glass registered");

QuantumGlassBlock.run();
TecTech.LOGGER.info("Quantum Glass registered");

Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.github.technus.tectech.TecTech.RANDOM;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.eyeOfHarmonyRenderBlock;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.forgeOfGodsRenderBlock;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiNewChat;
Expand All @@ -17,9 +18,14 @@
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.rendering.EOH.EOH_ItemRenderer;
import com.github.technus.tectech.rendering.EOH.EOH_TESR;
import com.github.technus.tectech.thing.block.GodforgeGlassBlock;
import com.github.technus.tectech.thing.block.GodforgeGlassRender;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumGlassRender;
import com.github.technus.tectech.thing.block.RenderForgeOfGods;
import com.github.technus.tectech.thing.block.TileEyeOfHarmony;
import com.github.technus.tectech.thing.block.TileForgeOfGods;
import com.github.technus.tectech.thing.item.RenderForgeOfGodsItem;
import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;

import cpw.mods.fml.client.FMLClientHandler;
Expand All @@ -33,11 +39,16 @@ public class ClientProxy extends CommonProxy {
public void registerRenderInfo() {
QuantumGlassBlock.renderID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(QuantumGlassBlock.renderID, new QuantumGlassRender());
GodforgeGlassBlock.renderID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(GodforgeGlassBlock.renderID, new GodforgeGlassRender());

MinecraftForgeClient
.registerItemRenderer(Item.getItemFromBlock(eyeOfHarmonyRenderBlock), new EOH_ItemRenderer());
MinecraftForgeClient
.registerItemRenderer(Item.getItemFromBlock(forgeOfGodsRenderBlock), new RenderForgeOfGodsItem());

ClientRegistry.bindTileEntitySpecialRenderer(TileEyeOfHarmony.class, new EOH_TESR());
ClientRegistry.bindTileEntitySpecialRenderer(TileForgeOfGods.class, new RenderForgeOfGods());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.github.technus.tectech.recipe;

import static gregtech.api.util.GT_Utility.trans;

import java.util.Collections;
import java.util.List;

import javax.annotation.ParametersAreNonnullByDefault;

import com.gtnewhorizons.modularui.api.math.Pos2d;

import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.RecipeMapFrontend;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.MethodsReturnNonnullByDefault;
import gregtech.nei.RecipeDisplayInfo;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class GodforgeExoticFrontend extends RecipeMapFrontend {

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

@Override
public List<Pos2d> getItemInputPositions(int itemInputCount) {
return Collections.singletonList(new Pos2d(52, 33));
}

@Override
public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
return Collections.singletonList(new Pos2d(106, 33));
}

@Override
protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {
long eut = recipeInfo.recipe.mEUt;
long duration = recipeInfo.recipe.mDuration;
recipeInfo.drawText(trans("152", "Total: ") + GT_Utility.formatNumbers(eut * duration) + " EU");
recipeInfo.drawText(trans("153", "Usage: ") + GT_Utility.formatNumbers(eut) + " EU/t");
recipeInfo.drawText(trans("158", "Time: ") + GT_Utility.formatNumbers(duration / 20) + " secs");

}

@Override
protected void drawDurationInfo(RecipeDisplayInfo recipeInfo) {}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.github.technus.tectech.recipe;

import static gregtech.api.util.GT_Utility.trans;
import static net.minecraft.util.StatCollector.translateToLocal;

import java.util.Collections;
import java.util.List;

import javax.annotation.ParametersAreNonnullByDefault;

import com.gtnewhorizons.modularui.api.math.Pos2d;

import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.RecipeMapFrontend;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.MethodsReturnNonnullByDefault;
import gregtech.nei.RecipeDisplayInfo;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class GodforgePlasmaFrontend extends RecipeMapFrontend {

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

@Override
public List<Pos2d> getItemInputPositions(int itemInputCount) {
return Collections.singletonList(new Pos2d(52, 33));
}

@Override
public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
return Collections.singletonList(new Pos2d(106, 33));
}

@Override
protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {
long eut = recipeInfo.recipe.mEUt;
long duration = recipeInfo.recipe.mDuration;
String multistep = "No";
if (recipeInfo.recipe.mSpecialItems.toString().equals("true")) {
multistep = "Yes";
}
String requiredUpgrade = switch (recipeInfo.recipe.mSpecialValue) {
case 1 -> "T4-T5";
case 2 -> "Exotic";
default -> "T1-T3";
};

recipeInfo.drawText(trans("152", "Total: ") + GT_Utility.formatNumbers(eut * duration) + " EU");
recipeInfo.drawText(trans("153", "Usage: ") + GT_Utility.formatNumbers(eut) + " EU/t");
recipeInfo.drawText(trans("158", "Time: ") + GT_Utility.formatNumbers(duration / 20) + " secs");
recipeInfo.drawText(translateToLocal("gt.blockmachines.multimachine.FOG.plasmamultistep") + ": " + multistep);
recipeInfo.drawText(
translateToLocal("gt.blockmachines.multimachine.FOG.plasmarecipetier") + ": " + requiredUpgrade);
}

@Override
protected void drawDurationInfo(RecipeDisplayInfo recipeInfo) {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,91 @@ public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem,
return true;
}

public static boolean addFOGPlasmaRecipe(ItemStack[] itemInputs, FluidStack[] fluidOutputs, int machineDuration,
int machineEUt, boolean multiStep, int recipeTier) {
if (itemInputs == null) {
itemInputs = nullItem;
}

TecTechRecipeMaps.godforgePlasmaRecipes.addRecipe(
false,
itemInputs,
null,
multiStep,
null,
fluidOutputs,
machineDuration,
machineEUt,
recipeTier);
return true;
}

public static boolean addFOGPlasmaRecipe(FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int machineDuration,
int machineEUt, boolean multiStep, int recipeTier) {

if (fluidInputs == null) {
fluidInputs = nullFluid;
}

TecTechRecipeMaps.godforgePlasmaRecipes.addRecipe(
false,
null,
null,
multiStep,
fluidInputs,
fluidOutputs,
machineDuration,
machineEUt,
recipeTier);
return true;
}

public static boolean addFOGExoticFakeRecipe(Object[] itemInputs, Object[] fluidInputs, FluidStack[] fluidOutputs,
int machineDuration, int machineEUt, int recipeTier) {

if (itemInputs == null) {
itemInputs = nullItem;
}

if (fluidInputs == null) {
fluidInputs = nullFluid;
}

ItemStack[] inputItems = new ItemStack[itemInputs.length];
ItemStack[][] itemAlts = new ItemStack[itemInputs.length][];
for (int i = 0; i < itemInputs.length; i++) {
Object obj = itemInputs[i];
if (obj instanceof ItemStack) {
inputItems[i] = (ItemStack) obj;
itemAlts[i] = null;
} else if (obj instanceof ItemStack[]stacks) {
if (stacks.length > 0) {
inputItems[i] = stacks[0];
itemAlts[i] = Arrays.copyOf(stacks, stacks.length);
}
}
}

FluidStack[] inputFluids = new FluidStack[fluidInputs.length];
for (int i = 0; i < fluidInputs.length; i++) {
Object obj = fluidInputs[i];
if (obj instanceof FluidStack[]stacks) {
inputFluids[i] = stacks[0];
}
}

TecTechRecipeMaps.godforgeExoticMatterRecipes.addFakeRecipe(
false,
inputItems,
null,
null,
inputFluids,
fluidOutputs,
machineDuration,
machineEUt,
recipeTier,
itemAlts,
false);
return true;
}
}
Loading

0 comments on commit b03e638

Please sign in to comment.