Skip to content

Commit

Permalink
bump gt, remove detrav dep, rename (#37)
Browse files Browse the repository at this point in the history
* bump gt, remove detrav dep, rename

* update deps

* bump coremod

---------

Co-authored-by: boubou19 <[email protected]>
  • Loading branch information
NotAPenguin0 and boubou19 authored Sep 3, 2024
1 parent ce1a765 commit 911c855
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 101 deletions.
9 changes: 4 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +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: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:NewHorizonsCoreMod:2.6.9:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.57:dev')
api('com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.18:dev')

compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev')
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.10:dev')
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<ImmutableList<DisplayComponent>> itemInputsBuilder = ImmutableList.builder();
for (ItemStack itemStack : recipe.mInputs) {
if (itemStack == null) {
Expand Down Expand Up @@ -168,15 +168,15 @@ static CircuitRecipe create(int itemInputsSize, Collection<Recipe> recipes) {
output);
}

static List<CircuitRecipe> buildCircuitRecipes(Iterable<GT_Recipe> rawRecipes) {
static List<CircuitRecipe> buildCircuitRecipes(Iterable<GTRecipe> 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.

// Table of recipe input size, recipe output stack size to set of recipes.
Table<Integer, Integer, Set<Recipe>> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -50,8 +50,8 @@ void initialize() {
.map(DisplayComponent::component).map(ItemComponent.class::cast).collect(Collectors.toSet());

Set<ItemComponent> allCircuits = circuitLineHandler.allCircuits();
ListMultimap<ItemComponent, GT_Recipe> circuitRecipes = MultimapBuilder.hashKeys().arrayListValues().build();
for (GT_Recipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) {
ListMultimap<ItemComponent, GTRecipe> circuitRecipes = MultimapBuilder.hashKeys().arrayListValues().build();
for (GTRecipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) {
ItemComponent output = (ItemComponent) Iterables
.getOnlyElement(GregTechRecipeUtil.buildComponentsFromItemOutputs(recipe)).component();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -51,7 +51,7 @@ void initialize() {
ImmutableSortedMap.Builder<Long, Component> 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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -85,8 +85,8 @@ private List<Diagram> 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<ItemData> itemDataOptional = GregTechOreDictUtil.getItemData(component);
if (itemDataOptional.isPresent() && itemDataOptional.get().mMaterial != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand All @@ -53,7 +53,7 @@ abstract static class BaseTool implements Comparable<BaseTool> {
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();
Expand All @@ -72,10 +72,10 @@ public int compareTo(BaseTool other) {
.thenComparing(Comparator.naturalOrder());

private static final ImmutableList<Integer> 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;

Expand Down Expand Up @@ -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));
}

Expand All @@ -272,7 +272,7 @@ private void addTool(@Nullable ItemStack itemStack) {

/** Returns the EU capacity of the given item, if available. */
private static Optional<Long> 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 {
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -147,6 +147,6 @@ private void buildDiagram(ComponentDiagramMatcher.Builder matcherBuilder, List<I

static boolean isGregTechOreBlock(ItemComponent itemComponent) {
Block block = Block.getBlockFromItem(itemComponent.item());
return block instanceof GT_Block_Ores_Abstract;
return block instanceof BlockOresAbstract;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import gregtech.api.enums.Materials;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;

/** Class that caches GregTech recipe data and stores it in a map, for fast lookup later. */
class RecipeHandler {
Expand Down Expand Up @@ -66,9 +66,9 @@ enum RecipeMap {
*/
enum ChemicalBathFluid {

MERCURY(ItemComponent.create(GT_Utility.getFluidDisplayStack(Materials.Mercury.mFluid))),
MERCURY(ItemComponent.create(GTUtility.getFluidDisplayStack(Materials.Mercury.mFluid))),

SODIUM_PERSULFATE(ItemComponent.create(GT_Utility.getFluidDisplayStack(Materials.SodiumPersulfate.mFluid)));
SODIUM_PERSULFATE(ItemComponent.create(GTUtility.getFluidDisplayStack(Materials.SodiumPersulfate.mFluid)));

final ItemComponent fluid;

Expand Down Expand Up @@ -142,7 +142,7 @@ void initialize() {
.hashSetValues().build();
recipeData.put(recipeMap, multimap);

for (GT_Recipe recipe : recipeMap.recipeMap.getAllRecipes()) {
for (GTRecipe recipe : recipeMap.recipeMap.getAllRecipes()) {
ImmutableList<DisplayComponent> outputs = ImmutableList
.copyOf(GregTechRecipeUtil.buildComponentsFromOutputs(recipe));

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading

0 comments on commit 911c855

Please sign in to comment.