package gregtech.api.util;
import static gregtech.api.enums.GT_Values.*;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.ProgressBar.Direction;
import gregtech.api.gui.modularui.GT_UITextures;
import gtPlusPlus.api.interfaces.IComparableRecipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures;
import java.util.*;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.*;
/**
* Custom GT Recipe Class
* @author Alkalus
*
*/
public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe {
public GTPP_Recipe(
final boolean aOptimize,
final ItemStack[] aInputs,
final ItemStack[] aOutputs,
final Object aSpecialItems,
final int[] aChances,
final FluidStack[] aFluidInputs,
final FluidStack[] aFluidOutputs,
final int aDuration,
final int aEUt,
final int aSpecialValue) {
super(
aOptimize,
aInputs,
aOutputs,
aSpecialItems,
aChances,
aFluidInputs,
aFluidOutputs,
aDuration,
aEUt,
aSpecialValue);
// Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for
// "+ItemUtils.getArrayStackNames(aInputs), 167);
}
public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) {
this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
}
// aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
public GTPP_Recipe(
final ItemStack aInput1,
final ItemStack aOutput1,
final ItemStack aOutput2,
final ItemStack aOutput3,
final ItemStack aOutput4,
final int aSpecialValue,
final int aType) {
this(
true,
new ItemStack[] {aInput1},
new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4},
null,
null,
null,
null,
0,
0,
Math.max(1, aSpecialValue));
Logger.WARNING("Switch case method for adding fuels");
if ((this.mInputs.length > 0) && (aSpecialValue > 0)) {
switch (aType) {
// Diesel Generator
case 0:
Logger.WARNING("Added fuel " + aInput1.getDisplayName() + " is ROCKET FUEL - continuing");
GTPP_Recipe_Map.sRocketFuels.addRecipe(this);
break;
// Gas Turbine
case 1:
GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(this);
break;
// Thermal Generator
case 2:
GTPP_Recipe_Map.sRTGFuels.addRecipe(this);
break;
// Plasma Generator
case 4:
// Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
break;
// Magic Generator
case 5:
// Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
break;
// Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
default:
// Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
break;
}
}
}
/**
* Even though this is deprecated, it's still used to keep binary compatibility.
* (GoodGenerator and GTNHLanthanides reference to `sSimpleWasherRecipes` and `sChemicalDehydratorRecipes`)
*/
public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map {
@Deprecated
public static final Collection<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>();
public GTPP_Recipe_Map_Internal(
Collection<GT_Recipe> aRecipeList,
String aUnlocalizedName,
String aLocalName,
String aNEIName,
String aNEIGUIPath,
int aUsualInputCount,
int aUsualOutputCount,
int aMinimalInputItems,
int aMinimalInputFluids,
int aAmperage,
String aNEISpecialValuePre,
int aNEISpecialValueMultiplier,
String aNEISpecialValuePost,
boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
aUnlocalizedName,
aLocalName,
aNEIName,
aNEIGUIPath,
aUsualInputCount,
aUsualOutputCount,
aMinimalInputItems,
aMinimalInputFluids,
aAmperage,
aNEISpecialValuePre,
aNEISpecialValueMultiplier,
aNEISpecialValuePost,
aShowVoltageAmperageInNEI,
aNEIAllowed);
}
}
public static class GTPP_Recipe_Map {
public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(
new HashSet<>(200),
"gtpp.recipe.cokeoven",
"Coke Oven",
null,
RES_PATH_GUI + "basicmachines/Dehydrator",
2,
9,
1,
0,
1,
E,
1,
E,
true,
true)
.setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN);
public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(
new HashSet<>(200),
"gtpp