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 encore #3213

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
93e4af9
Fix a few exotic plasmas
serenibyss Sep 17, 2024
a005016
Attempt to fix fuel draining issue with some hatch types
serenibyss Sep 17, 2024
d2b55c2
close individual milestone popup on milestone window close
serenibyss Sep 17, 2024
180709d
Fix windows relocating on reopen
serenibyss Sep 17, 2024
cd35189
Merge branch 'master' into godforge-encore
Dream-Master Sep 17, 2024
5d01167
fix nei magmatter amount
GDCloudstrike Sep 17, 2024
ba7a6b2
update mui
serenibyss Sep 19, 2024
ae90bc8
fix respec logic
GDCloudstrike Sep 19, 2024
ec466ed
Merge remote-tracking branch 'origin/godforge-encore' into godforge-e…
GDCloudstrike Sep 19, 2024
6b0d235
Fix a few exotic plasmas
serenibyss Sep 17, 2024
9709dd5
Attempt to fix fuel draining issue with some hatch types
serenibyss Sep 17, 2024
d59feb7
close individual milestone popup on milestone window close
serenibyss Sep 17, 2024
01e0222
Fix windows relocating on reopen
serenibyss Sep 17, 2024
0a6c4a7
fix nei magmatter amount
GDCloudstrike Sep 17, 2024
7d1d4ea
fix respec logic
GDCloudstrike Sep 19, 2024
7fb95fc
Add dev debug upgrade items
serenibyss Sep 20, 2024
d67e02e
shift click to insta-complete upgrade, rclick to respec
serenibyss Sep 20, 2024
4494ba2
Merge remote-tracking branch 'origin/godforge-encore' into godforge-e…
GDCloudstrike Sep 20, 2024
4fd069c
add name for start upgrade
GDCloudstrike Sep 21, 2024
49eb488
improve start upgrade name
serenibyss Sep 21, 2024
f751351
:no_mouth:
serenibyss Sep 21, 2024
017ca8c
Merge branch 'master' into godforge-encore
serenibyss Sep 21, 2024
c60a842
add cosmetics window
GDCloudstrike Sep 22, 2024
2274f06
Merge remote-tracking branch 'origin/godforge-encore' into godforge-e…
GDCloudstrike Sep 22, 2024
abbd06a
Merge branch 'master' into godforge-encore
Dream-Master Sep 24, 2024
b2196b1
add rainbow mode
GDCloudstrike Sep 25, 2024
7e0852f
Merge remote-tracking branch 'origin/godforge-encore' into godforge-e…
GDCloudstrike Sep 25, 2024
8eb0849
fix color preview refreshing and attempt to fix structure weirdness
GDCloudstrike Sep 25, 2024
dca16ad
Merge branch 'master' into godforge-encore
Dream-Master Sep 25, 2024
5005df1
drain correct fluid amount
GDCloudstrike Sep 25, 2024
874c769
mention wireless energy
GDCloudstrike Sep 25, 2024
39f2416
fix smelting module recipe time overflow issues
GDCloudstrike Sep 27, 2024
071448b
fix fuel consumption rounding issues
GDCloudstrike Sep 27, 2024
b5e5407
fix items in material window disappearing after restart
GDCloudstrike Sep 28, 2024
25db96d
rename infinity plasma to be consistent
GDCloudstrike Sep 28, 2024
b8a5184
Merge branch 'master' into godforge-encore
Dream-Master Sep 28, 2024
bcb3b7b
disable hatch filtering on exotic module
GDCloudstrike Sep 29, 2024
b7a1125
fix autobuild rebuilding rings that already got absorbed
GDCloudstrike Sep 29, 2024
0cd2f36
fix typos
GDCloudstrike Sep 29, 2024
88d8155
fix minor text oversight
GDCloudstrike Sep 30, 2024
36296a0
fix e notation formatting on power milestone
serenibyss Sep 30, 2024
cb5d1df
cleanup + refactor milestone formatting
serenibyss Sep 30, 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
19 changes: 13 additions & 6 deletions src/main/java/tectech/loader/recipe/Godforge.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,19 @@ public void run() {
// Single step
ItemStack[] solids_t2_1step = { MaterialsElements.STANDALONE.RHUGNOR.getDust(1),
MaterialsElements.STANDALONE.DRAGON_METAL.getDust(1),
MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getDust(1), Materials.CosmicNeutronium.getDust(1),
Materials.Draconium.getDust(1), Materials.DraconiumAwakened.getDust(1), Materials.Ichorium.getDust(1) };
MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getDust(1), Materials.Bedrockium.getDust(1),
Materials.CosmicNeutronium.getDust(1), Materials.Draconium.getDust(1),
Materials.DraconiumAwakened.getDust(1), Materials.Ichorium.getDust(1), };

FluidStack[] molten_t2_1step = convertToFluid(solids_t2_1step);

FluidStack[] solid_plasmas_t2_1step = {
new FluidStack(MaterialsElements.STANDALONE.RHUGNOR.getPlasma(), 144),
new FluidStack(MaterialsElements.STANDALONE.DRAGON_METAL.getPlasma(), 144),
new FluidStack(MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getPlasma(), 144),
Materials.CosmicNeutronium.getPlasma(144), Materials.Draconium.getPlasma(144),
Materials.DraconiumAwakened.getPlasma(144), Materials.Ichorium.getPlasma(144) };
Materials.Bedrockium.getPlasma(144), Materials.CosmicNeutronium.getPlasma(144),
Materials.Draconium.getPlasma(144), Materials.DraconiumAwakened.getPlasma(144),
Materials.Ichorium.getPlasma(144), };

for (int i = 0; i < solids_t2_1step.length; i++) {
GTValues.RA.stdBuilder()
Expand Down Expand Up @@ -340,14 +342,16 @@ public void run() {

// Multi-step
ItemStack[] solids_t2_xstep = { MaterialsElements.STANDALONE.HYPOGEN.getDust(1),
Materials.Tritanium.getDust(1), Materials.Flerovium.getDust(1), Materials.Neutronium.getDust(1) };
Materials.Tritanium.getDust(1), Materials.Flerovium.getDust(1), Materials.Neutronium.getDust(1),
Materials.Infinity.getDust(1), MaterialsUEVplus.SixPhasedCopper.getDust(1), };

FluidStack[] molten_t2_xstep = convertToFluid(solids_t2_xstep);

FluidStack[] solid_plasmas_t2_xstep = {
new FluidStack(MaterialsElements.STANDALONE.HYPOGEN.getPlasma(), 144),
Materials.Tritanium.getPlasma(144), Materials.Flerovium.getPlasma(144),
Materials.Neutronium.getPlasma(144), };
Materials.Neutronium.getPlasma(144), Materials.Infinity.getPlasma(144),
MaterialsUEVplus.SixPhasedCopper.getPlasma(144), };

for (int i = 0; i < solids_t2_xstep.length; i++) {
GTValues.RA.stdBuilder()
Expand Down Expand Up @@ -653,6 +657,9 @@ public void run() {
exoticModuleMagmatterItemMap.put(Materials.Ichorium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Neutronium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Flerovium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Bedrockium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Infinity.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(MaterialsUEVplus.SixPhasedCopper.getDustTiny(1), 100000);
serenibyss marked this conversation as resolved.
Show resolved Hide resolved

// GT++ materials
exoticModuleMagmatterItemMap.put(MaterialsElements.STANDALONE.CELESTIAL_TUNGSTEN.getTinyDust(1), 100000);
Expand Down
111 changes: 52 additions & 59 deletions src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import static gregtech.api.util.GTModHandler.getModItem;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import static gregtech.api.util.GTUtility.filterValidMTEs;
import static gregtech.api.util.GTUtility.formatNumbers;
import static java.lang.Math.floor;
import static java.lang.Math.log;
Expand Down Expand Up @@ -60,6 +61,7 @@
import com.gtnewhorizons.modularui.api.math.MainAxisAlignment;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.math.Size;
import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.api.widget.IWidgetBuilder;
Expand Down Expand Up @@ -97,7 +99,6 @@
import gregtech.api.util.IGTHatchAdder;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.common.tileentities.machines.MTEHatchInputBusME;
import gregtech.common.tileentities.machines.MTEHatchInputME;
import gregtech.common.tileentities.machines.MTEHatchOutputBusME;
import tectech.TecTech;
import tectech.loader.TecTechConfig;
Expand Down Expand Up @@ -409,14 +410,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (ticker % (5 * SECONDS) == 0) {
ticker = 0;
startRecipeProcessing();
FluidStack[] fluidInHatch = null;
boolean fuelDrained = false;
if (mInputHatches != null && mInputHatches.size() != 0) {
fluidInHatch = this.getStoredFluids()
.toArray(new FluidStack[0]);
}
int maxModuleCount = 8;

int maxModuleCount = 8;
if (upgrades[26]) {
maxModuleCount += 4;
}
Expand Down Expand Up @@ -452,37 +447,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
createRenderer();
}
} else {
fuelConsumption = (long) calculateFuelConsumption(this) * 5 * (batteryCharging ? 2 : 1);
if (fluidInHatch != null && fuelConsumption < Integer.MAX_VALUE) {
for (FluidStack fluid : fluidInHatch) {
if (fluid.isFluidEqual(validFuelList.get(selectedFuelType))) {
FluidStack fluidNeeded = new FluidStack(
validFuelList.get(selectedFuelType),
(int) fuelConsumption);
FluidStack fluidReal;
if (mInputHatches.get(0) instanceof MTEHatchInputME meHatch) {
fluidReal = meHatch.drain(ForgeDirection.UNKNOWN, fluidNeeded, true);
} else {
fluidReal = mInputHatches.get(0)
.drain(fluidNeeded.amount, true);
}
if (fluidReal == null || fluidReal.amount < fluidNeeded.amount) {
reduceBattery(fuelConsumptionFactor);
} else {
totalFuelConsumed += getFuelFactor();
if (batteryCharging) {
increaseBattery(fuelConsumptionFactor);
}
}
fuelDrained = true;
}
}
if (!fuelDrained) {
reduceBattery(fuelConsumptionFactor);
}
} else {
reduceBattery(fuelConsumptionFactor);
}
drainFuel();
}
}

Expand Down Expand Up @@ -525,6 +490,34 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
}
}

private void drainFuel() {
fuelConsumption = (long) calculateFuelConsumption(this) * 5 * (batteryCharging ? 2 : 1);
if (fuelConsumption >= Integer.MAX_VALUE) {
reduceBattery(fuelConsumptionFactor);
return;
}

FluidStack fuelToDrain = validFuelList.get(selectedFuelType)
.copy();
for (MTEHatchInput hatch : filterValidMTEs(mInputHatches)) {
FluidStack drained = hatch.drain(ForgeDirection.UNKNOWN, fuelToDrain, true);
if (drained == null) {
continue;
}

fuelToDrain.amount -= drained.amount;

if (fuelToDrain.amount == 0) {
totalFuelConsumed += getFuelFactor();
if (batteryCharging) {
increaseBattery(fuelConsumptionFactor);
}
return;
}
}
reduceBattery(fuelConsumptionFactor);
}

public boolean addModuleToMachineList(IGregTechTileEntity tileEntity, int baseCasingIndex) {
if (tileEntity == null) {
return false;
Expand Down Expand Up @@ -1269,6 +1262,14 @@ protected ModularWindow createMilestoneWindow(final EntityPlayer player) {
.setPos(233, 215))
.widget(
ButtonWidget.closeWindowButton(true)
.setOnClick((data, widget) -> {
if (!widget.isClient()) {
widget.getWindow()
.closeWindow();
widget.getContext()
.closeWindow(INDIVIDUAL_MILESTONE_WINDOW_ID);
}
})
.setPos(382, 6));
return builder.build();
}
Expand Down Expand Up @@ -1379,15 +1380,7 @@ protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer playe
private Widget createMilestoneButton(int milestoneID, int width, int height, Pos2d pos) {
return new ButtonWidget().setOnClick((clickData, widget) -> {
currentMilestoneID = milestoneID;
if (!widget.isClient()) {
if (widget.getContext()
.isWindowOpen(INDIVIDUAL_MILESTONE_WINDOW_ID)) {
widget.getContext()
.closeWindow(INDIVIDUAL_MILESTONE_WINDOW_ID);
}
widget.getContext()
.openSyncedWindow(INDIVIDUAL_MILESTONE_WINDOW_ID);
}
reopenWindow(widget, INDIVIDUAL_MILESTONE_WINDOW_ID);
})
.setSize(width, height)
.setBackground(() -> switch (milestoneID) {
Expand Down Expand Up @@ -2193,17 +2186,7 @@ private Widget createUpgradeBox(int upgradeID, int colorCode, int milestone, int
followupUpgrades = followingUpgradeIDs;
isUpradeSplitStart = isStartOfSplit;
doesCurrentUpgradeRequireExtraMats = requiresExtraMaterials;
if (!widget.isClient()) {
// unfortunately this is the easiest way to prevent this window desyncing. it causes the window to
// reposition itself on the screen which would be a good thing to not do.
if (widget.getContext()
.isWindowOpen(INDIVIDUAL_UPGRADE_WINDOW_ID)) {
widget.getContext()
.closeWindow(INDIVIDUAL_UPGRADE_WINDOW_ID);
}
widget.getContext()
.openSyncedWindow(INDIVIDUAL_UPGRADE_WINDOW_ID);
}
reopenWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID);
})
.setSize(40, 15)
.setBackground(() -> {
Expand Down Expand Up @@ -2678,6 +2661,16 @@ protected ModularWindow createSpecialThanksWindow(final EntityPlayer player) {
return builder.build();
}

private void reopenWindow(Widget widget, int windowId) {
if (!widget.isClient()) {
ModularUIContext ctx = widget.getContext();
if (ctx.isWindowOpen(windowId)) {
ctx.closeWindow(windowId);
}
ctx.openSyncedWindow(windowId);
}
}

private DynamicPositionedRow delenoName() {
DynamicPositionedRow nameRow = new DynamicPositionedRow();
String deleno = translateToLocal("gt.blockmachines.multimachine.FOG.deleno");
Expand Down