Skip to content

Commit

Permalink
Start rework of ProcessingLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Dijkstra committed Jan 29, 2025
2 parents 671a131 + 980b664 commit 392c2a8
Show file tree
Hide file tree
Showing 858 changed files with 10,543 additions and 12,054 deletions.
40 changes: 20 additions & 20 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
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.27-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.6: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.12-gtnh:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-533-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.28-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

compileOnlyApi('com.github.GTNewHorizons:ThaumicTinkerer:2.11.1:dev')
compileOnlyApi('com.github.GTNewHorizons:ThaumicTinkerer:2.11.2:dev')
compileOnlyApi("com.github.GTNewHorizons:Mobs-Info:0.5.0-GTNH:dev")
compileOnlyApi("com.github.GTNewHorizons:Navigator:1.0.15:dev")
implementation('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive=false}
Expand All @@ -58,46 +58,46 @@ dependencies {

compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.59:dev")

compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta28:api') { transitive = false }
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta30:api') { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.4:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.42:dev") { transitive = false }
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.3: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 }
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.8.3:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.28:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.4.0:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.106-GTNH:dev") { transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.3.1-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.13.3-GTNH:dev")
compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.3.4-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.13.8-GTNH:dev")

compileOnly("com.github.GTNewHorizons:Chisel:2.16.1-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.16.2-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Translocators:1.3.0:dev") { transitive = false }
compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false }
implementation("com.github.GTNewHorizons:Hodgepodge:2.6.13:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.12.3-GTNH:dev') { transitive = false }
implementation("com.github.GTNewHorizons:Hodgepodge:2.6.23:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.12.5-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:HoloInventory:2.5.0-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150')
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.2-GTNH:dev") {transitive = false}
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.4-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:BloodMagic:1.7.0:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.5-GTNH:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.5: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 }
compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612")

compileOnly('com.github.GTNewHorizons:SC2:2.3.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Binnie:2.5.2:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Binnie:2.5.4:dev') {transitive = false}
compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:BlockRenderer6343:1.3.0:dev'){transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:BlockRenderer6343:1.3.2:dev'){transitive=false}

compileOnly("com.google.auto.value:auto-value-annotations:1.10.1") { transitive = false }
annotationProcessor("com.google.auto.value:auto-value:1.10.1")
Expand All @@ -106,7 +106,7 @@ dependencies {
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.10.1:dev")
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:neiaddons:1.16.0:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:MagicBees:2.9.0-GTNH:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.5.2:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.5.4:dev')

testImplementation(platform('org.junit:junit-bom:5.9.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
}


4 changes: 2 additions & 2 deletions src/main/java/bartworks/API/GlassTier.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public static void addCustomGlass(String modname, String unlocalisedBlockName, i

public static void addCustomGlass(@NotNull Block block, int meta, int tier) {
Objects.requireNonNull(block, "Glass block cannot be null");
GlassTier.glasses.put(new BlockMetaPair(block, (byte) meta), tier);
GlassTier.glasses.put(new BlockMetaPair(block, meta), tier);
}

public static HashMap<BlockMetaPair, Integer> getGlassMap() {
return glasses;
}

public static int getGlassTier(Block block, int meta) {
return glasses.getOrDefault(new BlockMetaPair(block, (byte) meta), 0);
return glasses.getOrDefault(new BlockMetaPair(block, meta), 0);
}

public static class BlockMetaPair {
Expand Down
45 changes: 25 additions & 20 deletions src/main/java/bartworks/API/recipe/BacterialVatFrontend.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package bartworks.API.recipe;

import java.util.Arrays;
import static gregtech.api.util.GTRecipeConstants.GLASS;
import static gregtech.api.util.GTUtility.getTierNameWithParentheses;
import static gregtech.api.util.GTUtility.trans;

import java.util.List;

import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -10,25 +13,24 @@

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.GTUtility;
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 +77,24 @@ 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) {
long eut = recipeInfo.recipe.mEUt;
long duration = recipeInfo.recipe.mDuration;
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(trans("152", "Total: ") + GTUtility.formatNumbers(eut * duration) + " EU");
recipeInfo.drawText(
trans("153", "Usage: ") + GTUtility.formatNumbers(eut) + " EU/t" + getTierNameWithParentheses(eut));
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));
}
}
}
11 changes: 4 additions & 7 deletions src/main/java/bartworks/common/items/ItemCircuitProgrammer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import bartworks.util.BWUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTechAPI;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
Expand All @@ -63,12 +62,10 @@ public ItemCircuitProgrammer() {
this.setNoRepair();
this.setHasSubtypes(false);
this.setCreativeTab(MainMod.BWT);
GregTechAPI.registerCircuitProgrammer(
s -> s.getItem() instanceof ItemCircuitProgrammer && ElectricItem.manager.canUse(s, COST_PER_USE),
(s, p) -> {
ElectricItem.manager.use(s, COST_PER_USE, p);
return s;
});
}

public void useItem(ItemStack stack, EntityPlayer player) {
ElectricItem.manager.use(stack, COST_PER_USE, player);
}

@Override
Expand Down
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
2 changes: 2 additions & 0 deletions src/main/java/bartworks/common/loaders/FluidLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public static void run() {

public static Fluid createAndRegisterFluid(String Name, Color color) {
return GTFluidFactory.builder(Name)
.withLocalizedName(Name)
.withTextureName("molten.autogenerated")
.withColorRGBA(
new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
Expand All @@ -134,6 +135,7 @@ public static Fluid createAndRegisterFluid(String Name, Color color) {

public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) {
return GTFluidFactory.builder(Name)
.withLocalizedName(Name)
.withTextureName("molten.autogenerated")
.withColorRGBA(
new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
Expand Down
Loading

0 comments on commit 392c2a8

Please sign in to comment.