Skip to content

Commit

Permalink
Merge branch 'master' into pcb
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Dec 23, 2024
2 parents 935583a + 4cdf1e2 commit fff4148
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 792 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
dependencies {
api("com.github.GTNewHorizons:StructureLib:1.4.0:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.0-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.2-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizons.modularui.api.math.Alignment;
import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;

import goodgenerator.blocks.tileEntity.base.MTETooltipMultiBlockBaseEM;
import goodgenerator.loader.Loaders;
Expand Down Expand Up @@ -78,6 +83,7 @@ public class MTELargeEssentiaSmeltery extends MTETooltipMultiBlockBaseEM
protected int nodePower = 0;
protected int nodePurificationEfficiency = 0;
protected int nodeIncrease = 0;
protected int nodePowerDisplay;

private IStructureDefinition<MTELargeEssentiaSmeltery> multiDefinition = null;
private final ArrayList<MTEEssentiaOutputHatch> mEssentiaOutputHatches = new ArrayList<>();
Expand Down Expand Up @@ -299,6 +305,30 @@ protected void runMachine(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.runMachine(aBaseMetaTileEntity, aTick);
}

protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {
super.drawTexts(screenElements, inventorySlot);

screenElements
.widget(
new TextWidget()
.setStringSupplier(
() -> EnumChatFormatting.WHITE + "Requires "
+ EnumChatFormatting.YELLOW
+ numberFormat.format(nodePowerDisplay)
+ EnumChatFormatting.WHITE
+ " total "
+ EnumChatFormatting.AQUA
+ "Aqua"
+ EnumChatFormatting.WHITE
+ " and "
+ EnumChatFormatting.RED
+ "Ignis "
+ EnumChatFormatting.WHITE
+ "centivis to function.")
.setTextAlignment((Alignment.CenterLeft)))
.widget(new FakeSyncWidget.IntegerSyncer(this::expectedPower, val -> nodePowerDisplay = val));
}

@Override
public @NotNull CheckRecipeResult checkProcessing_EM() {
if (!isFullPower()) return SimpleCheckRecipeResult.ofFailure("node_too_small");
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 @@ -207,6 +207,12 @@ public class GTRecipeConstants {
public static final RecipeMetadataKey<Integer> LFTR_OUTPUT_POWER = SimpleRecipeMetadataKey
.create(Integer.class, "lftr_output_power");

/**
* Sparge Tower maximum byproduct outputs.
*/
public static final RecipeMetadataKey<Integer> SPARGE_MAX_BYPRODUCT = SimpleRecipeMetadataKey
.create(Integer.class, "sparge_max_byproduct");

/**
* Research Station data.
*/
Expand Down
90 changes: 0 additions & 90 deletions src/main/java/gregtech/api/util/GasSpargingRecipe.java

This file was deleted.

44 changes: 0 additions & 44 deletions src/main/java/gregtech/api/util/GasSpargingRecipeMap.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/gregtech/common/items/ItemComb.java
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ public void registerOreDict() {
}
}

enum Voltage {
public enum Voltage {

ULV,
LV,
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ public class GTPPRecipeMaps {
(index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CAULDRON : null)
.progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE)
.build();
public static final RecipeMap<RecipeMapBackend> spargeTowerFakeRecipes = RecipeMapBuilder
.of("gtpp.recipe.spargetower")
public static final RecipeMap<RecipeMapBackend> spargeTowerRecipes = RecipeMapBuilder
.of("gtpp.recipe.lftr.sparging")
.frontend(SpargeTowerFrontend::new)
.disableOptimize()
.maxIO(0, 0, 9, 9)
.disableRegisterNEI()
.build();
public static final RecipeMap<RecipeMapBackend> advancedFreezerRecipes = RecipeMapBuilder
.of("gtpp.recipe.cryogenicfreezer")
Expand Down
66 changes: 66 additions & 0 deletions src/main/java/gtPlusPlus/api/recipe/SpargeTowerFrontend.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package gtPlusPlus.api.recipe;

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

import java.util.List;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

import codechicken.nei.PositionedStack;
import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.maps.FluidOnlyFrontend;
import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;
import gregtech.nei.GTNEIDefaultHandler;

public class SpargeTowerFrontend extends FluidOnlyFrontend {

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

protected List<String> handleNEIByproductTooltip(ItemStack stack, List<String> currentTip, GTRecipe recipe) {
int maximumByproducts = recipe.getMetadataOrDefault(SPARGE_MAX_BYPRODUCT, 0);
FluidStack spargeGas = recipe.mFluidInputs[0];
if (stack.isItemEqual(GTUtility.getFluidDisplayStack(spargeGas.getFluid()))) {
currentTip.add("The amount returned is the remainder after all other outputs.");
currentTip.add("Maximum Output: " + spargeGas.amount + "L");
return currentTip;
}
for (int i = 2; i < recipe.mFluidOutputs.length; i++) {
if (stack.isItemEqual(GTUtility.getFluidDisplayStack(recipe.mFluidOutputs[i].getFluid()))) {
currentTip.add("Maximum Output: " + maximumByproducts + "L");
}
}
return currentTip;
}

@Override
public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip,
GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) {
GTRecipe recipe = neiCachedRecipe.mRecipe;
for (PositionedStack pStack : neiCachedRecipe.mInputs) {
if (stack == pStack.item) {
if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) {
currentTip = handleNEIItemInputTooltip(
currentTip,
(GTNEIDefaultHandler.FixedPositionedStack) pStack);
}
break;
}
}
for (PositionedStack pStack : neiCachedRecipe.mOutputs) {
if (stack == pStack.item) {
if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) {
currentTip = handleNEIByproductTooltip(stack, currentTip, recipe);
}
break;
}
}
return currentTip;
}

}
Loading

0 comments on commit fff4148

Please sign in to comment.