From bb395bef90c617d718841eb70c0fcc658119c58d Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Tue, 3 Sep 2024 16:20:26 +0200 Subject: [PATCH 1/3] bump gt, remove detrav dep, rename --- dependencies.gradle | 3 +- .../circuits/CircuitLineHandler.java | 6 +-- .../gregtech5/circuits/CircuitRecipe.java | 10 ++--- .../gregtech5/circuits/GregTechCircuits.java | 4 +- .../gregtech5/circuits/RecipeHandler.java | 6 +-- .../gregtech5/lenses/RecipeHandler.java | 4 +- .../materialparts/DiagramFactory.java | 8 ++-- .../materialparts/HeatingCoilHandler.java | 4 +- .../materialtools/GregTechMaterialTools.java | 14 +++---- .../materialtools/RecipeHandler.java | 26 ++++++------ .../oreprocessing/DiagramBuilder.java | 4 +- .../oreprocessing/GregTechOreProcessing.java | 6 +-- .../oreprocessing/RecipeHandler.java | 14 +++---- .../GregTechRecipeDebugger.java | 6 +-- .../recipedebugger/RecipeHandler.java | 18 ++++----- .../util/bartworks/BartWorksOreDictUtil.java | 4 +- .../util/gregtech5/GregTechFluidDictUtil.java | 6 +-- .../util/gregtech5/GregTechOreDictUtil.java | 12 +++--- .../util/gregtech5/GregTechRecipeUtil.java | 40 +++++++++---------- 19 files changed, 97 insertions(+), 98 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 68320ab..c446493 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,9 +6,8 @@ dependencies { api('com.github.GTNewHorizons:NotEnoughItems:2.6.26-GTNH:dev') - api('com.github.GTNewHorizons:DetravScannerMod:1.8.1:dev') {transitive=false} api('com.github.GTNewHorizons:EnderStorage:1.6.0:dev') {transitive=false} - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.33:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.56:dev') api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.9:dev') compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev') diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitLineHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitLineHandler.java index 780a4fe..bff06a9 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitLineHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitLineHandler.java @@ -25,7 +25,7 @@ import com.google.common.collect.Sets; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GTModHandler; class CircuitLineHandler { @@ -159,7 +159,7 @@ void initialize() { .setStartTier(0) .addCircuits( GregTechOreDictUtil.getComponent(ItemList.Circuit_Primitive), - ItemComponent.create(GT_ModHandler.getIC2Item("electronicCircuit", 1L)), + ItemComponent.create(GTModHandler.getIC2Item("electronicCircuit", 1L)), GregTechOreDictUtil.getComponent(ItemList.Circuit_Good)) .build()); circuitLinesBuilder @@ -172,7 +172,7 @@ void initialize() { .addCircuits( GregTechOreDictUtil.getComponent(ItemList.Circuit_Basic), GregTechOreDictUtil.getComponent(ItemList.Circuit_Integrated_Good), - ItemComponent.create(GT_ModHandler.getIC2Item("advancedCircuit", 1L))) + ItemComponent.create(GTModHandler.getIC2Item("advancedCircuit", 1L))) .build()); circuitLinesBuilder.add( CircuitLine.builder() diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitRecipe.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitRecipe.java index d5ec62c..5a4ac45 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitRecipe.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/CircuitRecipe.java @@ -24,7 +24,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Table; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; /** * This class holds all of the valid input permutations for a given circuit's recipes in the circuit assembling machine. @@ -34,11 +34,11 @@ abstract class CircuitRecipe { static final int MAX_ITEM_INPUTS = 6; - /** Helper class that holds display components describing a {@link GT_Recipe}. */ + /** Helper class that holds display components describing a {@link GTRecipe}. */ @AutoValue abstract static class Recipe { - private static Recipe create(GT_Recipe recipe) { + private static Recipe create(GTRecipe recipe) { ImmutableList.Builder> itemInputsBuilder = ImmutableList.builder(); for (ItemStack itemStack : recipe.mInputs) { if (itemStack == null) { @@ -168,7 +168,7 @@ static CircuitRecipe create(int itemInputsSize, Collection recipes) { output); } - static List buildCircuitRecipes(Iterable rawRecipes) { + static List buildCircuitRecipes(Iterable rawRecipes) { // TODO for now, we assume that all recipes with the same number of ingredients and the same // output stack size are permutations of the same recipe. // If this stops being true, then we'll need to add handling for that. @@ -176,7 +176,7 @@ static List buildCircuitRecipes(Iterable rawRecipes) { // Table of recipe input size, recipe output stack size to set of recipes. Table> recipeTable = HashBasedTable.create(); - for (GT_Recipe rawRecipe : rawRecipes) { + for (GTRecipe rawRecipe : rawRecipes) { Recipe recipe = Recipe.create(rawRecipe); int row = recipe.itemInputsSize(); int column = recipe.outputStackSize(); diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/GregTechCircuits.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/GregTechCircuits.java index acf2f07..eff6aae 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/GregTechCircuits.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/GregTechCircuits.java @@ -14,7 +14,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; public final class GregTechCircuits implements DiagramGenerator { @@ -71,7 +71,7 @@ static DisplayComponent buildCircuitDisplayComponent(ItemComponent circuit, int return DisplayComponent.builder(circuit) .setAdditionalTooltip( Tooltip.create( - Lang.GREGTECH_5_CIRCUITS.transf("tierlabel", GT_Values.VN[tier]), + Lang.GREGTECH_5_CIRCUITS.transf("tierlabel", GTValues.VN[tier]), Tooltip.INFO_FORMATTING)) .build(); } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/RecipeHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/RecipeHandler.java index cf724b0..1989122 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/RecipeHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/circuits/RecipeHandler.java @@ -18,7 +18,7 @@ import com.google.common.collect.MultimapBuilder; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; class RecipeHandler { @@ -50,8 +50,8 @@ void initialize() { .map(DisplayComponent::component).map(ItemComponent.class::cast).collect(Collectors.toSet()); Set allCircuits = circuitLineHandler.allCircuits(); - ListMultimap circuitRecipes = MultimapBuilder.hashKeys().arrayListValues().build(); - for (GT_Recipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) { + ListMultimap circuitRecipes = MultimapBuilder.hashKeys().arrayListValues().build(); + for (GTRecipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) { ItemComponent output = (ItemComponent) Iterables .getOnlyElement(GregTechRecipeUtil.buildComponentsFromItemOutputs(recipe)).component(); diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/lenses/RecipeHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/lenses/RecipeHandler.java index e8e71e1..b0d4d45 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/lenses/RecipeHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/lenses/RecipeHandler.java @@ -24,7 +24,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; class RecipeHandler { @@ -106,7 +106,7 @@ void initialize() { } } - void handleRecipe(GT_Recipe recipe) { + void handleRecipe(GTRecipe recipe) { // We need to be able to mark lens-specific recipes with '*', so we can't show any recipe // input formatting. So use plain ItemComponent here. // TODO if we ever do need the recipe input formatting, we'll need to change something here. diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/DiagramFactory.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/DiagramFactory.java index f47cf71..1ba3656 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/DiagramFactory.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/DiagramFactory.java @@ -34,8 +34,8 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; class DiagramFactory { @@ -118,9 +118,9 @@ private void insertIntoSlot(Diagram.Builder builder, Materials material) { } void initialize() { - for (GT_Recipe ebfRecipe : RecipeMaps.blastFurnaceRecipes.getAllRecipes()) { + for (GTRecipe ebfRecipe : RecipeMaps.blastFurnaceRecipes.getAllRecipes()) { for (ItemStack output : ebfRecipe.mOutputs) { - ItemData outData = GT_OreDictUnificator.getAssociation(output); + ItemData outData = GTOreDictUnificator.getAssociation(output); if ((outData != null) && outData.hasValidMaterialData() && outData.hasValidPrefixData() && (outData.mPrefix == OrePrefixes.ingot || outData.mPrefix == OrePrefixes.ingotHot)) { diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/HeatingCoilHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/HeatingCoilHandler.java index 7fb7bab..e115afc 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/HeatingCoilHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialparts/HeatingCoilHandler.java @@ -8,7 +8,7 @@ import com.google.common.collect.ImmutableSortedMap; import gregtech.api.enums.ItemList; -import gregtech.common.blocks.GT_Block_Casings5; +import gregtech.common.blocks.BlockCasings5; class HeatingCoilHandler { @@ -51,7 +51,7 @@ void initialize() { ImmutableSortedMap.Builder builder = ImmutableSortedMap.naturalOrder(); for (ItemList item : HEATING_COILS) { ItemStack itemStack = item.get(1); - long heat = GT_Block_Casings5.getCoilHeatFromDamage(ItemComponent.getItemDamage(itemStack)).getHeat(); + long heat = BlockCasings5.getCoilHeatFromDamage(ItemComponent.getItemDamage(itemStack)).getHeat(); builder.put(heat, ItemComponent.create(itemStack)); } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/GregTechMaterialTools.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/GregTechMaterialTools.java index 7bcb688..8db4953 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/GregTechMaterialTools.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/GregTechMaterialTools.java @@ -23,16 +23,16 @@ import com.google.common.collect.Lists; import gregtech.api.enums.Materials; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; import gregtech.api.objects.ItemData; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.ID_MetaTool_01; +import gregtech.common.items.IDMetaTool01; +import gregtech.common.items.MetaGeneratedTool01; public final class GregTechMaterialTools implements DiagramGenerator { public static final ItemComponent ICON = ItemComponent.createWithNbt( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(ID_MetaTool_01.HARDHAMMER.ID, 1, Materials.Aluminium, Materials.Wood, null)); + MetaGeneratedTool01.INSTANCE + .getToolWithStats(IDMetaTool01.HARDHAMMER.ID, 1, Materials.Aluminium, Materials.Wood, null)); private final DiagramGroupInfo info; @@ -85,8 +85,8 @@ private List getDiagram(Interactable.RecipeType unused, Component compo Materials material = null; if (component.type() == Component.ComponentType.ITEM - && ((ItemComponent) component).item() instanceof GT_MetaGenerated_Tool) { - material = GT_MetaGenerated_Tool.getPrimaryMaterial((ItemStack) component.stack()); + && ((ItemComponent) component).item() instanceof MetaGeneratedTool) { + material = MetaGeneratedTool.getPrimaryMaterial((ItemStack) component.stack()); } else { Optional itemDataOptional = GregTechOreDictUtil.getItemData(component); if (itemDataOptional.isPresent() && itemDataOptional.get().mMaterial != null) { diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/RecipeHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/RecipeHandler.java index 75a726e..304c178 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/RecipeHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/materialtools/RecipeHandler.java @@ -11,7 +11,6 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; -import com.detrav.items.DetravMetaGeneratedTool01; import com.github.dcysteine.neicustomdiagram.api.Formatter; import com.github.dcysteine.neicustomdiagram.api.diagram.component.DisplayComponent; import com.github.dcysteine.neicustomdiagram.api.diagram.component.ItemComponent; @@ -26,11 +25,12 @@ import com.google.common.collect.MultimapBuilder; import com.google.common.collect.SortedSetMultimap; +import detrav.items.DetravMetaGeneratedTool01; import gregtech.api.enums.Materials; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; import gregtech.api.recipe.RecipeMaps; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.ID_MetaTool_01; +import gregtech.common.items.IDMetaTool01; +import gregtech.common.items.MetaGeneratedTool01; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; /** @@ -53,7 +53,7 @@ abstract static class BaseTool implements Comparable { private static BaseTool create(ItemStack itemStack) { return new AutoValue_RecipeHandler_BaseTool( ItemComponent.create(itemStack), - GT_MetaGenerated_Tool.getPrimaryMaterial(itemStack)); + MetaGeneratedTool.getPrimaryMaterial(itemStack)); } abstract ItemComponent itemComponent(); @@ -72,10 +72,10 @@ public int compareTo(BaseTool other) { .thenComparing(Comparator.naturalOrder()); private static final ImmutableList TURBINE_TOOL_IDS = ImmutableList.of( - ID_MetaTool_01.TURBINE_SMALL.ID, - ID_MetaTool_01.TURBINE.ID, - ID_MetaTool_01.TURBINE_LARGE.ID, - ID_MetaTool_01.TURBINE_HUGE.ID); + IDMetaTool01.TURBINE_SMALL.ID, + IDMetaTool01.TURBINE.ID, + IDMetaTool01.TURBINE_LARGE.ID, + IDMetaTool01.TURBINE_HUGE.ID); private static final int ELECTRIC_SCANNER_ID_START = 100; @@ -253,7 +253,7 @@ private void addTool(@Nullable ItemStack itemStack) { return; } - if (itemStack.getItem() == GT_MetaGenerated_Tool_01.INSTANCE) { + if (itemStack.getItem() == MetaGeneratedTool01.INSTANCE) { toolsMultimap.put(BaseTool.create(itemStack), ItemComponent.createWithNbt(itemStack)); } @@ -272,7 +272,7 @@ private void addTool(@Nullable ItemStack itemStack) { /** Returns the EU capacity of the given item, if available. */ private static Optional getEuCapacity(ItemComponent itemComponent) { - Long[] electricStats = ((GT_MetaGenerated_Tool) itemComponent.item()).getElectricStats(itemComponent.stack()); + Long[] electricStats = ((MetaGeneratedTool) itemComponent.item()).getElectricStats(itemComponent.stack()); if (electricStats == null) { return Optional.empty(); } else { @@ -285,8 +285,8 @@ private static DisplayComponent buildDisplayComponent(ItemComponent itemComponen DisplayComponent.Builder builder = DisplayComponent.builder(itemComponent); ItemStack itemStack = itemComponent.stack(); - Materials primaryMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(itemStack); - Materials secondaryMaterial = GT_MetaGenerated_Tool.getSecondaryMaterial(itemStack); + Materials primaryMaterial = MetaGeneratedTool.getPrimaryMaterial(itemStack); + Materials secondaryMaterial = MetaGeneratedTool.getSecondaryMaterial(itemStack); builder.setAdditionalTooltip( Tooltip.builder().setFormatting(Tooltip.INFO_FORMATTING) .addTextLine( diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java index ab814e3..45928f7 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/DiagramBuilder.java @@ -32,12 +32,12 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTOreDictUnificator; class DiagramBuilder { private static final ItemComponent STONE_DUST = ItemComponent - .create(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1)); + .create(GTOreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1)); private final LayoutHandler layoutHandler; private final LabelHandler labelHandler; diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java index 8e9cdc5..2d62f54 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/oreprocessing/GregTechOreProcessing.java @@ -7,7 +7,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.dcysteine.neicustomdiagram.api.diagram.DiagramGenerator; import com.github.dcysteine.neicustomdiagram.api.diagram.DiagramGroup; import com.github.dcysteine.neicustomdiagram.api.diagram.DiagramGroupInfo; @@ -21,9 +20,10 @@ import com.github.dcysteine.neicustomdiagram.util.gregtech5.GregTechOreDictUtil; import com.google.common.collect.ImmutableList; +import bartworks.system.material.Werkstoff; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.BlockOresAbstract; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.material.Material; @@ -147,6 +147,6 @@ private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List outputs = ImmutableList .copyOf(GregTechRecipeUtil.buildComponentsFromOutputs(recipe)); @@ -178,7 +178,7 @@ void initialize() { continue; } - ItemComponent itemComponent = ItemComponent.create(GT_OreDictUnificator.get_nocopy(itemStack)); + ItemComponent itemComponent = ItemComponent.create(GTOreDictUnificator.get_nocopy(itemStack)); multimap.put(itemComponent, outputs); // Need an effectively final variable here so that we can reference it within diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/GregTechRecipeDebugger.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/GregTechRecipeDebugger.java index 6275913..bae8c1e 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/GregTechRecipeDebugger.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/GregTechRecipeDebugger.java @@ -25,18 +25,18 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public final class GregTechRecipeDebugger implements DiagramGenerator { - public static final ItemComponent ICON = ItemComponent.create(GT_Utility.getIntegratedCircuit(0)); + public static final ItemComponent ICON = ItemComponent.create(GTUtility.getIntegratedCircuit(0)); // TODO if we need to add more views in the future, it'd probably be worth going through and // refactoring the code to clean it up a bit. I want to move each view into a custom class, with // each view class containing its own recipe checking code, as well as recipe map exclusions. public enum View { - PROGRAMMED_CIRCUITS("-programmed-circuits", ItemComponent.create(GT_Utility.getIntegratedCircuit(24)), + PROGRAMMED_CIRCUITS("-programmed-circuits", ItemComponent.create(GTUtility.getIntegratedCircuit(24)), "programmedcircuitsbutton"), CONSUME_CIRCUIT_RECIPES("-consume-circuit-recipes", ItemComponent.create(Items.blaze_powder, 0), diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/RecipeHandler.java b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/RecipeHandler.java index 8043d3f..efe28b1 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/RecipeHandler.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/generators/gregtech5/recipedebugger/RecipeHandler.java @@ -45,16 +45,16 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; class RecipeHandler { static final Item PROGRAMMED_CIRCUIT = ItemList.Circuit_Integrated.getItem(); static final ImmutableSet PROGRAMMED_CIRCUITS = ImmutableSet.copyOf( - IntStream.range(0, 25).mapToObj(i -> ItemComponent.create(GT_Utility.getIntegratedCircuit(i))) + IntStream.range(0, 25).mapToObj(i -> ItemComponent.create(GTUtility.getIntegratedCircuit(i))) .collect(Collectors.toList())); static final ImmutableSet SCHEMATICS = ImmutableSet.builder() .add(GregTechOreDictUtil.getComponent(ItemList.Schematic_1by1)) @@ -200,13 +200,13 @@ enum RecipeMap { @AutoValue abstract static class Recipe { - static Recipe create(RecipeMap recipeMap, GT_Recipe recipe) { + static Recipe create(RecipeMap recipeMap, GTRecipe recipe) { Map inputs = new HashMap<>(); for (ItemStack itemStack : recipe.mInputs) { if (itemStack == null) { continue; } - ItemStack unified = GT_OreDictUnificator.get_nocopy(itemStack); + ItemStack unified = GTOreDictUnificator.get_nocopy(itemStack); inputs.merge(ItemComponent.createWithNbt(unified), itemStack.stackSize, Integer::sum); } for (FluidStack fluidStack : recipe.mFluidInputs) { @@ -221,7 +221,7 @@ static Recipe create(RecipeMap recipeMap, GT_Recipe recipe) { if (itemStack == null) { continue; } - ItemStack unified = GT_OreDictUnificator.get_nocopy(itemStack); + ItemStack unified = GTOreDictUnificator.get_nocopy(itemStack); outputs.merge(ItemComponent.createWithNbt(unified), itemStack.stackSize, Integer::sum); } for (FluidStack fluidStack : recipe.mFluidOutputs) { @@ -534,7 +534,7 @@ private static int countCells(Map componentMap) { ItemStack itemStack = ((ItemComponent) component).stack(); try { - if (GT_ModHandler.getCapsuleCellContainerCount(itemStack) > 0) { + if (GTModHandler.getCapsuleCellContainerCount(itemStack) > 0) { cells += entry.getValue(); } } catch (NullPointerException suppressed) { diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/util/bartworks/BartWorksOreDictUtil.java b/src/main/java/com/github/dcysteine/neicustomdiagram/util/bartworks/BartWorksOreDictUtil.java index e65e6ba..f6d71c1 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/util/bartworks/BartWorksOreDictUtil.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/util/bartworks/BartWorksOreDictUtil.java @@ -4,10 +4,10 @@ import net.minecraft.item.ItemStack; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.dcysteine.neicustomdiagram.api.diagram.component.ItemComponent; +import bartworks.system.material.Werkstoff; +import bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.OrePrefixes; public final class BartWorksOreDictUtil { diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechFluidDictUtil.java b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechFluidDictUtil.java index 0662dc3..7aa4d5e 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechFluidDictUtil.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechFluidDictUtil.java @@ -15,7 +15,7 @@ import com.google.common.collect.Lists; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public final class GregTechFluidDictUtil { @@ -23,7 +23,7 @@ public final class GregTechFluidDictUtil { private GregTechFluidDictUtil() {} public static Optional fluidToDisplayItem(FluidComponent component) { - ItemStack itemStack = GT_Utility.getFluidDisplayStack(component.fluid()); + ItemStack itemStack = GTUtility.getFluidDisplayStack(component.fluid()); return Optional.ofNullable(itemStack).map(ItemComponent::create); } @@ -64,7 +64,7 @@ public static Optional getDisplayItem(Component component) { public static Optional fillCell(Component component) { return getFluidContents(component) .map( - fluidComponent -> GT_Utility + fluidComponent -> GTUtility .fillFluidContainer(fluidComponent.stack(), ItemList.Cell_Empty.get(1), false, false)) .map(ItemComponent::create); } diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechOreDictUtil.java b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechOreDictUtil.java index e0dc815..ef860f5 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechOreDictUtil.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechOreDictUtil.java @@ -14,7 +14,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTOreDictUnificator; public final class GregTechOreDictUtil { @@ -26,12 +26,12 @@ public static ItemComponent getComponent(ItemList item) { } public static Optional getComponent(OrePrefixes prefix, Materials material) { - Optional itemStackOptional = Optional.ofNullable(GT_OreDictUnificator.get(prefix, material, 1)); + Optional itemStackOptional = Optional.ofNullable(GTOreDictUnificator.get(prefix, material, 1)); return itemStackOptional.map(ItemComponent::create); } public static List getAllComponents(OrePrefixes prefix, Materials material) { - List itemStacks = GT_OreDictUnificator.getOres(prefix, material); + List itemStacks = GTOreDictUnificator.getOres(prefix, material); return itemStacks.stream().map(ItemComponent::create).collect(Collectors.toList()); } @@ -44,7 +44,7 @@ public static Component unify(Component component) { return component; } - return ItemComponent.create(GT_OreDictUnificator.get_nocopy((ItemStack) component.stack())); + return ItemComponent.create(GTOreDictUnificator.get_nocopy((ItemStack) component.stack())); } /** Returns a list of everything that unifies into {@code component}. */ @@ -53,7 +53,7 @@ public static List reverseUnify(Component component) { List results = new ArrayList<>(); if (unified.type() == Component.ComponentType.ITEM) { - GT_OreDictUnificator.getNonUnifiedStacks(unified.stack()) + GTOreDictUnificator.getNonUnifiedStacks(unified.stack()) .forEach(itemStack -> results.add(ItemComponent.create(itemStack))); } else { results.add(unified); @@ -74,7 +74,7 @@ public static Optional getItemData(Component component) { if (component.type() != Component.ComponentType.ITEM) { return Optional.empty(); } - return Optional.ofNullable(GT_OreDictUnificator.getAssociation((ItemStack) component.stack())); + return Optional.ofNullable(GTOreDictUnificator.getAssociation((ItemStack) component.stack())); } /** diff --git a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechRecipeUtil.java b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechRecipeUtil.java index 9d30cb7..ee3b148 100644 --- a/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechRecipeUtil.java +++ b/src/main/java/com/github/dcysteine/neicustomdiagram/util/gregtech5/GregTechRecipeUtil.java @@ -20,8 +20,8 @@ import com.google.common.collect.ImmutableList; import gregtech.api.recipe.RecipeMap; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; public final class GregTechRecipeUtil { @@ -32,27 +32,27 @@ private GregTechRecipeUtil() {} // TODO these findRecipe* methods are slow and inefficient, and also unused. Maybe delete them? /** Compares ignoring stack size. */ - public static List findRecipeByInput(RecipeMap recipes, Component... inputs) { + public static List findRecipeByInput(RecipeMap recipes, Component... inputs) { return findRecipe(recipes, Arrays.asList(inputs), ImmutableList.of()); } /** Compares ignoring stack size. */ - public static List findRecipeByOutput(RecipeMap recipes, Component... outputs) { + public static List findRecipeByOutput(RecipeMap recipes, Component... outputs) { return findRecipe(recipes, ImmutableList.of(), Arrays.asList(outputs)); } - public static List findRecipe(RecipeMap recipes, Component input, Component output) { + public static List findRecipe(RecipeMap recipes, Component input, Component output) { return findRecipe(recipes, ImmutableList.of(input), ImmutableList.of(output)); } - public static List findRecipe(RecipeMap recipes, Collection inputs, + public static List findRecipe(RecipeMap recipes, Collection inputs, Collection outputs) { List inputFluids = new ArrayList<>(); List inputItems = new ArrayList<>(); for (Component component : inputs) { switch (component.type()) { case ITEM: - inputItems.add(GT_OreDictUnificator.get_nocopy((ItemStack) component.stack())); + inputItems.add(GTOreDictUnificator.get_nocopy((ItemStack) component.stack())); break; case FLUID: @@ -66,7 +66,7 @@ public static List findRecipe(RecipeMap recipes, Collection findRecipe(RecipeMap recipes, Collection foundRecipes = new ArrayList<>(); - for (GT_Recipe recipe : recipes.getAllRecipes()) { + List foundRecipes = new ArrayList<>(); + for (GTRecipe recipe : recipes.getAllRecipes()) { if (recipeContainsItems(recipe.mInputs, inputItems) && recipeContainsFluids(recipe.mFluidInputs, inputFluids) && recipeContainsItems(recipe.mOutputs, outputItems) @@ -99,25 +99,25 @@ private static boolean recipeContainsFluids(FluidStack[] recipeFluidStacks, Coll private static boolean recipeContainsItems(ItemStack[] recipeItemStacks, Collection itemStacks) { for (ItemStack itemStack : itemStacks) { - if (Arrays.stream(recipeItemStacks).noneMatch(s -> GT_OreDictUnificator.isInputStackEqual(s, itemStack))) { + if (Arrays.stream(recipeItemStacks).noneMatch(s -> GTOreDictUnificator.isInputStackEqual(s, itemStack))) { return false; } } return true; } - public static List buildComponentsFromInputs(GT_Recipe recipe) { + public static List buildComponentsFromInputs(GTRecipe recipe) { List components = new ArrayList<>(); components.addAll(buildComponentsFromItemInputs(recipe)); components.addAll(buildComponentsFromFluidInputs(recipe)); return components; } - public static List buildComponentsFromItemInputs(GT_Recipe recipe) { + public static List buildComponentsFromItemInputs(GTRecipe recipe) { return buildComponents(recipe.mInputs); } - public static List buildComponentsFromFluidInputs(GT_Recipe recipe) { + public static List buildComponentsFromFluidInputs(GTRecipe recipe) { return buildComponents(recipe.mFluidInputs); } @@ -164,7 +164,7 @@ public static List buildComponents(FluidStack[] fluidStacks) { return list; } - public static List buildComponentsFromOutputs(GT_Recipe recipe) { + public static List buildComponentsFromOutputs(GTRecipe recipe) { List components = new ArrayList<>(); components.addAll(buildComponentsFromItemOutputs(recipe)); components.addAll(buildComponentsFromFluidOutputs(recipe)); @@ -173,7 +173,7 @@ public static List buildComponentsFromOutputs(GT_Recipe recipe // TODO maybe show recipe voltage tier in tooltip? (Also for fluids, below) // Unfortunately, we'll need the recipe map to do this, as amperage is not stored in recipe. - public static List buildComponentsFromItemOutputs(GT_Recipe recipe) { + public static List buildComponentsFromItemOutputs(GTRecipe recipe) { List results = new ArrayList<>(); for (int i = 0; i < recipe.mOutputs.length; i++) { @@ -219,7 +219,7 @@ public static List buildComponentsFromItemOutputs(GT_Recipe re return results; } - public static List buildComponentsFromFluidOutputs(GT_Recipe recipe) { + public static List buildComponentsFromFluidOutputs(GTRecipe recipe) { List results = new ArrayList<>(); for (int i = 0; i < recipe.mFluidOutputs.length; i++) { @@ -248,15 +248,15 @@ public static List buildComponentsFromFluidOutputs(GT_Recipe r // TODO these special values only apply for certain recipe types. // Do we ever run into cases where they don't apply? - public static boolean requiresCleanroom(GT_Recipe recipe) { + public static boolean requiresCleanroom(GTRecipe recipe) { return recipe.mSpecialValue == -200 || recipe.mSpecialValue == -300; } - public static boolean requiresLowGravity(GT_Recipe recipe) { + public static boolean requiresLowGravity(GTRecipe recipe) { return recipe.mSpecialValue == -100 || recipe.mSpecialValue == -300; } - private static Optional buildSpecialConditionsTooltip(GT_Recipe recipe) { + private static Optional buildSpecialConditionsTooltip(GTRecipe recipe) { boolean requiresCleanroom = requiresCleanroom(recipe); boolean requiresLowGravity = requiresLowGravity(recipe); if (requiresCleanroom || requiresLowGravity) { From b1692d62118acd3cd7a5badda2f01254f2fc64f4 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Tue, 3 Sep 2024 17:44:23 +0200 Subject: [PATCH 2/3] update deps --- dependencies.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index c446493..5728496 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,11 +4,11 @@ dependencies { compileOnly('com.google.auto.value:auto-value-annotations:1.8.2') annotationProcessor('com.google.auto.value:auto-value:1.8.2') - api('com.github.GTNewHorizons:NotEnoughItems:2.6.26-GTNH:dev') + api('com.github.GTNewHorizons:NotEnoughItems:2.6.34-GTNH:dev') api('com.github.GTNewHorizons:EnderStorage:1.6.0:dev') {transitive=false} - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.56:dev') - api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.9:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.57:dev') + api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.16:dev') - compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev') + compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.10:dev') } From c5061c6b2efc962f557474204c45dfd3fe1c6854 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Tue, 3 Sep 2024 20:25:29 +0200 Subject: [PATCH 3/3] bump coremod --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 5728496..e2519e1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -8,7 +8,7 @@ dependencies { api('com.github.GTNewHorizons:EnderStorage:1.6.0:dev') {transitive=false} api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.57:dev') - api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.16:dev') + api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.18:dev') compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.10:dev') }