Skip to content

Commit

Permalink
Merge branch 'master' into toolbox-screwdriver-for-programmed-circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Jan 11, 2025
2 parents 1663b87 + 7784cf7 commit 91d26f2
Show file tree
Hide file tree
Showing 83 changed files with 889 additions and 1,039 deletions.
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
dependencies {
api("com.github.GTNewHorizons:StructureLib:1.4.2:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.13-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.15-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.1:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.0-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-518-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.14-gtnh:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.16-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

Expand All @@ -64,7 +64,7 @@ dependencies {
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.9.2:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.10.1:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.11.0-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.16.1:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.16.2:dev") { transitive = false }

compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false}
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.8.2:dev") { transitive = false }
Expand All @@ -88,7 +88,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.3-GTNH:dev") {transitive = false}
// https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels
compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953')
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.2-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.4-GTNH:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.7.0-GTNH:dev") { transitive = false }
Expand Down
37 changes: 17 additions & 20 deletions src/main/java/bartworks/API/recipe/BacterialVatFrontend.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package bartworks.API.recipe;

import java.util.Arrays;
import static gregtech.api.util.GTRecipeConstants.GLASS;

import java.util.List;

import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -10,25 +11,23 @@

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

import bartworks.common.tileentities.multis.MTEBioVat;
import gregtech.api.enums.GTValues;
import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.RecipeMapFrontend;
import gregtech.api.util.GTRecipeConstants;
import gregtech.api.util.MethodsReturnNonnullByDefault;
import gregtech.api.util.recipe.Sievert;
import gregtech.nei.GTNEIDefaultHandler;
import gregtech.nei.RecipeDisplayInfo;
import gregtech.nei.formatter.INEISpecialInfoFormatter;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class BacterialVatFrontend extends RecipeMapFrontend {

public BacterialVatFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
NEIRecipePropertiesBuilder neiPropertiesBuilder) {
super(
uiPropertiesBuilder,
neiPropertiesBuilder.neiSpecialInfoFormatter(new BacterialVatSpecialValueFormatter()));
super(uiPropertiesBuilder, neiPropertiesBuilder);
}

@Override
Expand Down Expand Up @@ -75,21 +74,19 @@ private void drawFluidOverlay(GTNEIDefaultHandler.FixedPositionedStack stack) {
super.drawNEIOverlayForOutput(stack);
}

private static class BacterialVatSpecialValueFormatter implements INEISpecialInfoFormatter {

@Override
public List<String> format(RecipeDisplayInfo recipeInfo) {
int[] tSpecialA = MTEBioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue);
String glassTier = StatCollector.translateToLocalFormatted("nei.biovat.0.name", GTValues.VN[tSpecialA[0]]);
String sievert = "";
if (!(tSpecialA[3] == 0)) {
if (tSpecialA[2] == 1) {
sievert = StatCollector.translateToLocalFormatted("nei.biovat.1.name", tSpecialA[3]);
} else {
sievert = StatCollector.translateToLocalFormatted("nei.biovat.2.name", tSpecialA[3]);
}
@Override
protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {
int glassTier = recipeInfo.recipe.getMetadataOrDefault(GLASS, 3);
Sievert data = recipeInfo.recipe.getMetadataOrDefault(GTRecipeConstants.SIEVERT, new Sievert(0, false));
int sievert = data.sievert;
boolean isExact = data.isExact;
recipeInfo.drawText(StatCollector.translateToLocalFormatted("nei.biovat.0.name", GTValues.VN[glassTier]));
if (sievert != 0) {
if (!isExact) {
recipeInfo.drawText(StatCollector.translateToLocalFormatted("nei.biovat.1.name", sievert));
} else {
recipeInfo.drawText(StatCollector.translateToLocalFormatted("nei.biovat.2.name", sievert));
}
return Arrays.asList(glassTier, sievert);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class BartWorksRecipeMaps {
.specialSlotSensitive()
.progressBar(GTUITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER)
.build();
public static final RecipeMap<RecipeMapBackend> radioHatchRecipes = RecipeMapBuilder.of("bw.recipe.radhatch")
public static final RecipeMap<RecipeMapBackend> radioHatchFakeRecipes = RecipeMapBuilder.of("bw.recipe.radhatch")
.maxIO(1, 0, 0, 0)
.minInputs(1, 0)
.slotOverlays((index, isFluid, isOutput, isSpecial) -> BWUITextures.OVERLAY_SLOT_ROD)
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/bartworks/API/recipe/RadioHatchFrontend.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

import net.minecraft.util.StatCollector;

import bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
import gregtech.api.recipe.BasicUIPropertiesBuilder;
import gregtech.api.recipe.NEIRecipePropertiesBuilder;
import gregtech.api.recipe.RecipeMapFrontend;
import gregtech.api.util.GTRecipeConstants;
import gregtech.api.util.MethodsReturnNonnullByDefault;
import gregtech.api.util.recipe.Sievert;
import gregtech.nei.RecipeDisplayInfo;
import gregtech.nei.formatter.INEISpecialInfoFormatter;

Expand All @@ -33,13 +36,14 @@ private static class RadioHatchSpecialInfoFormatter implements INEISpecialInfoFo

@Override
public List<String> format(RecipeDisplayInfo recipeInfo) {
int radioLevel = recipeInfo.recipe.mEUt;
int amount = recipeInfo.recipe.mDuration;
long time = recipeInfo.recipe.mSpecialValue;
Sievert data = recipeInfo.recipe.getMetadataOrDefault(GTRecipeConstants.SIEVERT, new Sievert(0));
int radioLevel = data.sievert;
int mass = recipeInfo.recipe.getMetadataOrDefault(GTRecipeConstants.MASS, 0);
long time = GT_MetaTileEntity_RadioHatch.calcDecayTicks(radioLevel);
return Arrays.asList(
StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel),
StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount),
StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0));
StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass),
StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * mass / 20.0));
}
}
}
15 changes: 7 additions & 8 deletions src/main/java/bartworks/common/loaders/BioRecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

import static bartworks.API.recipe.BartWorksRecipeMaps.bacterialVatRecipes;
import static bartworks.API.recipe.BartWorksRecipeMaps.bioLabRecipes;
import static bartworks.util.BWRecipes.computeSieverts;
import static gregtech.api.enums.Mods.CropsPlusPlus;
import static gregtech.api.util.GTRecipeBuilder.MINUTES;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import static gregtech.api.util.GTRecipeBuilder.TICKS;
import static gregtech.api.util.GTRecipeConstants.SIEVERTS;
import static gregtech.api.util.GTRecipeConstants.GLASS;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
Expand Down Expand Up @@ -132,7 +131,7 @@ public static void registerWaterBasedBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.CommonYeast))
.fluidInputs(new FluidStack(fluidStack, 100))
.fluidOutputs(FluidRegistry.getFluidStack("potion.ghp", 1))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(17 * SECONDS + 10 * TICKS)
.eut(TierEU.RECIPE_EV)
.noOptimize()
Expand All @@ -144,7 +143,7 @@ public static void registerWaterBasedBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.WhineYeast))
.fluidInputs(new FluidStack(fluidStack, 100))
.fluidOutputs(FluidRegistry.getFluidStack("potion.wine", 12))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(10 * SECONDS)
.eut(TierEU.RECIPE_MV)
.noOptimize()
Expand All @@ -158,7 +157,7 @@ public static void registerWaterBasedBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.BeerYeast))
.fluidInputs(new FluidStack(fluidStack, 100))
.fluidOutputs(FluidRegistry.getFluidStack("potion.beer", 5))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(30 * SECONDS)
.eut(TierEU.RECIPE_LV)
.noOptimize()
Expand All @@ -169,7 +168,7 @@ public static void registerWaterBasedBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.BeerYeast))
.fluidInputs(new FluidStack(fluidStack, 100))
.fluidOutputs(FluidRegistry.getFluidStack("potion.darkbeer", 10))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(30 * SECONDS)
.eut(TierEU.RECIPE_LV)
.noOptimize()
Expand All @@ -184,7 +183,7 @@ public static void registerBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.WhineYeast))
.fluidInputs(FluidRegistry.getFluidStack("potion.grapejuice", 100))
.fluidOutputs(FluidRegistry.getFluidStack("potion.wine", 12))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(20 * SECONDS)
.eut(TierEU.RECIPE_LV)
.noOptimize()
Expand All @@ -194,7 +193,7 @@ public static void registerBacterialVatRecipes() {
.special(BioItemList.getPetriDish(BioCultureLoader.anaerobicOil))
.fluidInputs(Materials.FermentedBiomass.getFluid(10000))
.fluidOutputs(new FluidStack(FluidLoader.fulvicAcid, 1000))
.metadata(SIEVERTS, computeSieverts(0, 3, false, false, false))
.metadata(GLASS, 3)
.duration(2 * MINUTES + 17 * SECONDS + 8 * TICKS)
.eut(TierEU.RECIPE_LV)
.noOptimize()
Expand Down
Loading

0 comments on commit 91d26f2

Please sign in to comment.