Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GTNH-Intergalactic with new renamed GT API #70

Merged
merged 7 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.45:dev')
api('com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.91-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.4.9:dev')
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.52:dev") {transitive = false}
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.55:dev')
api('com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.92-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.5.3:dev')
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.55:dev") {transitive = false}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Block_Casings_Abstract;
import gregtech.common.blocks.GT_Material_Casings;
import gregtech.api.objects.GTCopiedBlockTexture;
import gregtech.api.util.GTLanguageManager;
import gregtech.common.blocks.BlockCasingsAbstract;
import gregtech.common.blocks.MaterialCasings;

/**
* Casings used to construct the Space Elevator
*
* @author minecraft7771
*/
public class BlockCasingSpaceElevator extends GT_Block_Casings_Abstract {
public class BlockCasingSpaceElevator extends BlockCasingsAbstract {

/** Number of casings that exist */
private static final int NUMBER_OF_CASINGS = 3;
Expand All @@ -41,15 +41,15 @@ public class BlockCasingSpaceElevator extends GT_Block_Casings_Abstract {
* Create new Space Elevator casings
*/
public BlockCasingSpaceElevator() {
super(ItemCasingSpaceElevator.class, "gt.blockcasingsSE", GT_Material_Casings.INSTANCE);
super(ItemCasingSpaceElevator.class, "gt.blockcasingsSE", MaterialCasings.INSTANCE);

for (byte b = 0; b < NUMBER_OF_CASINGS; b = (byte) (b + 1)) {
Textures.BlockIcons.casingTexturePages[32][b] = new GT_CopiedBlockTexture(this, 6, b);
Textures.BlockIcons.casingTexturePages[32][b] = new GTCopiedBlockTexture(this, 6, b);
}

GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Space Elevator Base Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Space Elevator Support Structure");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Space Elevator Internal Structure");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Space Elevator Base Casing");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Space Elevator Support Structure");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Space Elevator Internal Structure");

IGItems.SpaceElevatorCasing0 = new ItemStack(this, 1, 0);
IGItems.SpaceElevatorCasing1 = new ItemStack(this, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Block_Casings_Abstract;
import gregtech.common.blocks.GT_Material_Casings;
import gregtech.api.objects.GTCopiedBlockTexture;
import gregtech.api.util.GTLanguageManager;
import gregtech.common.blocks.BlockCasingsAbstract;
import gregtech.common.blocks.MaterialCasings;

/**
* Motors used to construct the Space Elevator
*
* @author minecraft7771
*/
public class BlockCasingSpaceElevatorMotor extends GT_Block_Casings_Abstract {
public class BlockCasingSpaceElevatorMotor extends BlockCasingsAbstract {

/** Number of motors that exist */
private static final int NUMBER_OF_MOTORS = 5;
Expand All @@ -39,17 +39,17 @@ public class BlockCasingSpaceElevatorMotor extends GT_Block_Casings_Abstract {
* Create new Space Elevator motors
*/
public BlockCasingSpaceElevatorMotor() {
super(ItemCasingSpaceElevatorMotor.class, "gt.blockcasingsSEMotor", GT_Material_Casings.INSTANCE);
super(ItemCasingSpaceElevatorMotor.class, "gt.blockcasingsSEMotor", MaterialCasings.INSTANCE);

for (byte b = 0; b < NUMBER_OF_MOTORS; b = (byte) (b + 1)) {
Textures.BlockIcons.casingTexturePages[32][b + 16] = new GT_CopiedBlockTexture(this, 6, b);
Textures.BlockIcons.casingTexturePages[32][b + 16] = new GTCopiedBlockTexture(this, 6, b);
}

GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Space Elevator Motor MK-I");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Space Elevator Motor MK-II");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Space Elevator Motor MK-III");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Space Elevator Motor MK-IV");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Space Elevator Motor MK-V");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Space Elevator Motor MK-I");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Space Elevator Motor MK-II");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Space Elevator Motor MK-III");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Space Elevator Motor MK-IV");
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Space Elevator Motor MK-V");

IGItems.SpaceElevatorMotorT1 = new ItemStack(this, 1, 0);
IGItems.SpaceElevatorMotorT2 = new ItemStack(this, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;

import gregtech.common.blocks.GT_Item_Casings_Abstract;
import gregtech.common.blocks.ItemCasingsAbstract;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;

/**
* Items of the space elevator casings
*
* @author minecraft7771
*/
public class ItemCasingSpaceElevator extends GT_Item_Casings_Abstract {
public class ItemCasingSpaceElevator extends ItemCasingsAbstract {

/**
* Create a new item for the casing blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevator.ElevatorUtil;

import gregtech.common.blocks.GT_Item_Casings_Abstract;
import gregtech.common.blocks.ItemCasingsAbstract;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;

/**
* Items of the space elevator motors
*
* @author minecraft7771
*/
public class ItemCasingSpaceElevatorMotor extends GT_Item_Casings_Abstract {
public class ItemCasingSpaceElevatorMotor extends ItemCasingsAbstract {

/**
* Create a new item for the motor blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.util.GT_Utility;
import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.util.GTUtility;
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;

/**
Expand Down Expand Up @@ -58,7 +58,7 @@ public class GasSiphonRecipeHandler extends TemplateRecipeHandler {
* Initialize the handler for gas siphons recipes
*/
public GasSiphonRecipeHandler() {
modularWindow = ModularWindow.builder(170, 82).setBackground(GT_UITextures.BACKGROUND_NEI_SINGLE_RECIPE)
modularWindow = ModularWindow.builder(170, 82).setBackground(GTUITextures.BACKGROUND_NEI_SINGLE_RECIPE)
.widget(
new DrawableWidget().setDrawable(IG_UITextures.PICTURE_ELEVATOR_LOGO).setSize(17, 17)
.setPos(new Pos2d(147, 52)))
Expand Down Expand Up @@ -166,12 +166,12 @@ public void drawBackground(int recipe) {
@Override
public void loadCraftingRecipes(ItemStack result) {
Fluid fluid = null;
FluidStack containerFluid = GT_Utility.getFluidForFilledItem(result, true);
FluidStack containerFluid = GTUtility.getFluidForFilledItem(result, true);
if (containerFluid != null) {
fluid = containerFluid.getFluid();
}
if (fluid == null) {
FluidStack displayFluid = GT_Utility.getFluidFromDisplayStack(result);
FluidStack displayFluid = GTUtility.getFluidFromDisplayStack(result);
if (displayFluid != null) {
fluid = displayFluid.getFluid();
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public void drawExtras(int recipeIndex) {
CachedSiphonRecipe recipe = (CachedSiphonRecipe) this.arecipes.get(recipeIndex);
GuiDraw.drawStringC(GCCoreUtil.translate(recipe.planet), CATEGORY_VALUE_X, PLANET_TYPE_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(Integer.toString(recipe.depth), CATEGORY_VALUE_X, GAS_TYPE_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(GT_Utility.formatNumbers(recipe.amount), CATEGORY_VALUE_X, OUT_AMOUNT_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(GTUtility.formatNumbers(recipe.amount), CATEGORY_VALUE_X, OUT_AMOUNT_Y, TEXT_COLOR, false);

GuiDraw.drawStringR(
EnumChatFormatting.BOLD + I18n.format(SEE_ALL),
Expand Down Expand Up @@ -268,7 +268,7 @@ private class CachedSiphonRecipe extends CachedRecipe {
* @param outputAmount Output amount of the operation
*/
private CachedSiphonRecipe(String planet, int depth, Fluid output, int outputAmount) {
targetFluidDisplay = new PositionedStack(GT_Utility.getFluidDisplayStack(output), getGuiWidth() - 19, 0);
targetFluidDisplay = new PositionedStack(GTUtility.getFluidDisplayStack(output), getGuiWidth() - 19, 0);
this.planet = planet;
this.depth = depth;
amount = outputAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.util.GT_Utility;
import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.util.GTUtility;

/**
* Recipe handler for the space pumping recipes
Expand Down Expand Up @@ -59,7 +59,7 @@ public class SpacePumpModuleRecipeHandler extends TemplateRecipeHandler {
* Initialize the handler for space pumping recipes
*/
public SpacePumpModuleRecipeHandler() {
modularWindow = ModularWindow.builder(170, 82).setBackground(GT_UITextures.BACKGROUND_NEI_SINGLE_RECIPE)
modularWindow = ModularWindow.builder(170, 82).setBackground(GTUITextures.BACKGROUND_NEI_SINGLE_RECIPE)
.widget(
new DrawableWidget().setDrawable(IG_UITextures.PICTURE_ELEVATOR_LOGO).setSize(17, 17)
.setPos(new Pos2d(147, 52)))
Expand Down Expand Up @@ -165,12 +165,12 @@ public void drawBackground(int recipe) {
@Override
public void loadCraftingRecipes(ItemStack result) {
Fluid fluid = null;
FluidStack containerFluid = GT_Utility.getFluidForFilledItem(result, true);
FluidStack containerFluid = GTUtility.getFluidForFilledItem(result, true);
if (containerFluid != null) {
fluid = containerFluid.getFluid();
}
if (fluid == null) {
FluidStack displayFluid = GT_Utility.getFluidFromDisplayStack(result);
FluidStack displayFluid = GTUtility.getFluidFromDisplayStack(result);
if (displayFluid != null) {
fluid = displayFluid.getFluid();
}
Expand Down Expand Up @@ -218,7 +218,7 @@ public void drawExtras(int recipeIndex) {
CachedPumpRecipe recipe = (CachedPumpRecipe) this.arecipes.get(recipeIndex);
GuiDraw.drawStringC(Integer.toString(recipe.planetType), CATEGORY_VALUE_X, PLANET_TYPE_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(Integer.toString(recipe.gasType), CATEGORY_VALUE_X, GAS_TYPE_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(GT_Utility.formatNumbers(recipe.amount), CATEGORY_VALUE_X, OUT_AMOUNT_Y, TEXT_COLOR, false);
GuiDraw.drawStringC(GTUtility.formatNumbers(recipe.amount), CATEGORY_VALUE_X, OUT_AMOUNT_Y, TEXT_COLOR, false);

GuiDraw.drawStringR(
EnumChatFormatting.BOLD + I18n.format(SEE_ALL),
Expand Down Expand Up @@ -270,7 +270,7 @@ private class CachedPumpRecipe extends CachedRecipe {
* @param outputAmount Output amount of the operation
*/
private CachedPumpRecipe(int planetType, int gasType, Fluid output, int outputAmount) {
targetFluidDisplay = new PositionedStack(GT_Utility.getFluidDisplayStack(output), getGuiWidth() - 19, 0);
targetFluidDisplay = new PositionedStack(GTUtility.getFluidDisplayStack(output), getGuiWidth() - 19, 0);
this.planetType = planetType;
this.gasType = gasType;
amount = outputAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import net.minecraftforge.fluids.FluidStack;

import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;

import bartworks.system.material.WerkstoffLoader;
import cpw.mods.fml.common.Loader;
import galaxyspace.SolarSystem.SolarSystemPlanets;
import gregtech.api.enums.Materials;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMapBackend;
import gregtech.api.recipe.RecipeMapBuilder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GTRecipe;

public class IGRecipeMaps {

Expand All @@ -24,16 +24,16 @@ public class IGRecipeMaps {
.of("gt.recipe.spaceAssembler").maxIO(16, 1, 4, 0).minInputs(1, 0).logo(IG_UITextures.PICTURE_ELEVATOR_LOGO)
.logoSize(18, 18).neiTransferRect(124, 8, 16, 16)
.neiRecipeComparator(
Comparator.<GT_Recipe, Integer>comparing(recipe -> recipe.mSpecialValue)
.thenComparing(GT_Recipe::compareTo))
Comparator.<GTRecipe, Integer>comparing(recipe -> recipe.mSpecialValue)
.thenComparing(GTRecipe::compareTo))
.neiTransferRect(88, 8, 18, 72).neiTransferRect(124, 8, 18, 72).useCustomFilterForNEI()
.frontend(SpaceAssemblerFrontend::new).build();
/** Recipe map for recipes in the Space Mining Module */
public static final RecipeMap<RecipeMapBackend> spaceMiningRecipes = RecipeMapBuilder.of("gt.recipe.spaceMining")
.maxIO(5, 16, 2, 0).minInputs(1, 0)
.neiRecipeComparator(
Comparator.<GT_Recipe, Integer>comparing(recipe -> recipe.mSpecialValue)
.thenComparing(GT_Recipe::compareTo))
Comparator.<GTRecipe, Integer>comparing(recipe -> recipe.mSpecialValue)
.thenComparing(GTRecipe::compareTo))
.logo(IG_UITextures.PICTURE_ELEVATOR_LOGO).logoPos(151, 58).logoSize(18, 18)
.neiRecipeBackgroundSize(170, 78).neiTransferRect(46, 6, 23, 63).dontUseProgressBar()
.addSpecialTexture(46, 6, 23, 63, IG_UITextures.PROGRESSBAR_SPACE_MINING_MODULE_ARROW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GTRecipe;

/**
* GT recipes of GTNH-Intergalactic. These include a needed space project optionally.
*
* @author minecraft7771
*/
public class IG_Recipe extends GT_Recipe {
public class IG_Recipe extends GTRecipe {

/** Space project that is needed to be constructed to do this recipe */
protected final String neededSpaceProject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.common.GT_RecipeAdder;
import gregtech.api.util.GTLog;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.common.RecipeAdder;

/**
* GT recipe adder of GTNH-Intergalactic
*
* @author minecraft7771
*/
public class IG_RecipeAdder extends GT_RecipeAdder {
public class IG_RecipeAdder extends RecipeAdder {

public static IG_RecipeAdder instance = new IG_RecipeAdder();
public static final ItemStack[] nullItem = new ItemStack[0];
Expand Down Expand Up @@ -138,18 +138,18 @@ public static boolean addSpaceMiningRecipe(ItemStack[] aItemInputs, FluidStack[]
return false;
}
if (recipeWeight <= 0) {
GT_Log.err.println("Weight of mining recipe for main material " + ores[0].toString() + " is 0");
GTLog.err.println("Weight of mining recipe for main material " + ores[0].toString() + " is 0");
}
if (aChances != null) {
if (aChances.length < ores.length) {
return false;
} else if (aChances.length > ores.length) {
GT_Log.err.println(
GTLog.err.println(
"Chances and outputs of mining recipe for main material " + ores[0].toString()
+ " have different length!");
}
if (Arrays.stream(aChances).sum() != 10000) {
GT_Log.err.println(
GTLog.err.println(
"Sum of chances in mining recipe for main material " + ores[0].toString()
+ " is not 100%! This will lead to no issue but might be unintentional");
}
Expand All @@ -170,7 +170,7 @@ public static boolean addSpaceMiningRecipe(ItemStack[] aItemInputs, FluidStack[]
// Map ores to actual items with stack minSize 64
ItemStack[] outputs = new ItemStack[ores.length];
for (int i = 0; i < ores.length; i++) {
outputs[i] = GT_OreDictUnificator.get(orePrefixes, ores[i], 64);
outputs[i] = GTOreDictUnificator.get(orePrefixes, ores[i], 64);
}

IGRecipeMaps.spaceMiningRecipes.add(
Expand Down Expand Up @@ -202,19 +202,19 @@ public static boolean addSpaceMiningRecipe(ItemStack[] aItemInputs, FluidStack[]
return false;
}
if (recipeWeight <= 0) {
GT_Log.err.println(
GTLog.err.println(
"Weight of mining recipe for main material " + aItemOutputs[0].getUnlocalizedName() + " is 0");
}
if (aChances != null) {
if (aChances.length < aItemOutputs.length) {
return false;
} else if (aChances.length > aItemOutputs.length) {
GT_Log.err.println(
GTLog.err.println(
"Chances and outputs of mining recipe for main material " + aItemOutputs[0].getUnlocalizedName()
+ " have different length!");
}
if (Arrays.stream(aChances).sum() != 10000) {
GT_Log.err.println(
GTLog.err.println(
"Sum of chances in mining recipe for main material " + aItemOutputs[0].getUnlocalizedName()
+ " is not 100%! This will lead to no issue but might be unintentional");
}
Expand Down
Loading