diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/lib')
-rw-r--r-- | src/Java/gtPlusPlus/core/lib/CORE.java | 96 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/lib/LoadedMods.java | 174 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/lib/MaterialInfo.java | 149 |
3 files changed, 419 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java new file mode 100644 index 0000000000..262f46b831 --- /dev/null +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -0,0 +1,96 @@ +package gtPlusPlus.core.lib; + +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.util.gregtech.recipehandlers.GregtechRecipe; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class CORE { + + public static final String name = "GT++"; + public static final String MODID = "miscutils"; + public static final String VERSION = "1.4.4.2-release"; + public static boolean DEBUG = false; + public static final boolean LOAD_ALL_CONTENT = false; + public static final int GREG_FIRST_ID = 760; + public static Map PlayerCache; + public static final String[] VOLTAGES = {"ULV","LV","MV","HV","EV","IV","LuV","ZPM","UV","MAX"}; + public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental(); + public static IGregtech_RecipeAdder RA; + @Deprecated + public static IGregtech_RecipeAdder sRecipeAdder; + public static GregtechRecipe GT_Recipe = new GregtechRecipe(); + + @SideOnly(Side.CLIENT) + public static IIconRegister GT_BlockIcons, GT_ItemIcons; + public static List<Runnable> GT_BlockIconload = new ArrayList<Runnable>(); + public static final Class<AddToCreativeTab> TAB = AddToCreativeTab.class; + public static Configuration Config; + public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; + public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.GREEN+"Radioactive! "+EnumChatFormatting.GOLD+" Avoid direct handling without hazmat protection."; + public static final String noItem = ""; + + /** + * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items. + */ + public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000]; + + //GUIS + public enum GUI_ENUM + { + ENERGYBUFFER, TOOLBUILDER, NULL, NULL1, NULL2 + } + + /** + * File Paths and Resource Paths + */ + public static final String + TEX_DIR = "textures/", + TEX_DIR_GUI = TEX_DIR + "gui/", + TEX_DIR_ITEM = TEX_DIR + "items/", + TEX_DIR_BLOCK = TEX_DIR + "blocks/", + TEX_DIR_ENTITY = TEX_DIR + "entity/", + TEX_DIR_ASPECTS = TEX_DIR + "aspects/", + TEX_DIR_FLUIDS = TEX_DIR_BLOCK + "fluids/", + RES_PATH = MODID + ":" + TEX_DIR, + RES_PATH_GUI = MODID + ":" + TEX_DIR_GUI, + RES_PATH_ITEM = MODID + ":" + TEX_DIR_ITEM, + RES_PATH_BLOCK = MODID + ":" + TEX_DIR_BLOCK, + RES_PATH_ENTITY = MODID + ":" + TEX_DIR_ENTITY, + RES_PATH_ASPECTS = MODID + ":" + TEX_DIR_ASPECTS, + RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS; + + + //public static final Materials2[] MiscGeneratedMaterials = new Materials2[1000]; + + public static class configSwitches { + + //Debug + public static boolean disableEnderIOIntegration = false; + public static boolean disableStaballoyBlastFurnaceRecipe = false; + public static boolean disableCentrifugeFormation = false; + + //Machine Related + public static boolean enableSolarGenerators = false; + public static boolean enableAlternativeBatteryAlloy = false; + public static boolean enableThaumcraftShardUnification = false; + public static boolean disableIC2Recipes = false; + public static boolean enableAlternativeDivisionSigilRecipe = false; + + //Feature Related + public static boolean enableCustomAlvearyBlocks = false; + + } + +} diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java new file mode 100644 index 0000000000..f1cc7eb830 --- /dev/null +++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java @@ -0,0 +1,174 @@ +package gtPlusPlus.core.lib; + +import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures; +import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder; +import cpw.mods.fml.common.Loader; + +public class LoadedMods { + + + //Initialize Variables + public static boolean Gregtech = false; + public static boolean EnderIO = false; + public static boolean Big_Reactors = false; + public static boolean IndustrialCraft2 = false; + public static boolean Simply_Jetpacks = false; + public static boolean RFTools = false; + public static boolean Thaumcraft = false; + public static boolean Extra_Utils = false; + public static boolean PneumaticCraft = false; + public static boolean MorePlanets = false; + public static boolean ForbiddenMagic = false; + public static boolean CompactWindmills = false; + public static boolean Railcraft = false; + public static boolean ImmersiveEngineering = false; + public static boolean Growthcraft = false; + public static boolean CoFHCore = false; + public static boolean Forestry = false; + public static boolean MagicBees = false; + public static boolean ExtraBees = false; + public static boolean Psychedelicraft = false; + public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper + public static boolean ThermalFoundation = false; + public static boolean IHL = false; + + + + private static int totalMods; + @SuppressWarnings("deprecation") + public static void checkLoaded(){ + Utils.LOG_INFO("Looking for optional mod prereqs."); + if (Loader.isModLoaded("gregtech") == true ){ + Gregtech = true; + Utils.LOG_INFO("Components enabled for: Gregtech"); + if (Gregtech){ + try { + CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder(); + Utils.LOG_INFO("Created Gregtech recipe handler."); + GregtechTextures.BlockIcons.VOID.name(); + GregtechTextures.ItemIcons.VOID.name(); + Utils.LOG_INFO("Created Gregtech texture handler."); + } catch (NullPointerException e){ + Utils.LOG_INFO("Could NOT create a Gregtech recipe handler."); + } + } + + totalMods++; + } + if (Loader.isModLoaded("EnderIO") == true && !configSwitches.disableEnderIOIntegration){ + EnderIO = true; + Utils.LOG_INFO("Components enabled for: EnderIO"); + totalMods++; + } + if (Loader.isModLoaded("BigReactors") == true){ + Big_Reactors = true; + Utils.LOG_INFO("Components enabled for: Big Reactors"); + totalMods++; + } + if (Loader.isModLoaded("IC2") == true){ + IndustrialCraft2 = true; + Utils.LOG_INFO("Components enabled for: IndustrialCraft2"); + totalMods++; + } + if (Loader.isModLoaded("simplyjetpacks") == true){ + Simply_Jetpacks = true; + Utils.LOG_INFO("Components enabled for: Simply Jetpacks"); + totalMods++; + } + if (Loader.isModLoaded("rftools") == true){ + RFTools = true; + Utils.LOG_INFO("Components enabled for: RFTools"); + totalMods++; + } + if (Loader.isModLoaded("Thaumcraft") == true){ + Thaumcraft = true; + Utils.LOG_INFO("Components enabled for: Thaumcraft"); + totalMods++; + } + if (Loader.isModLoaded("ExtraUtilities") == true){ + Extra_Utils = true; + Utils.LOG_INFO("Components enabled for: Extra_Utils"); + totalMods++; + } + if (Loader.isModLoaded("PneumaticCraft") == true){ + PneumaticCraft = true; + Utils.LOG_INFO("Components enabled for: PneumaticCraft"); + totalMods++; + } + if (Loader.isModLoaded("MorePlanet") == true){ + MorePlanets = true; + Utils.LOG_INFO("Components enabled for: MorePlanets"); + totalMods++; + } + if (Loader.isModLoaded("ForbiddenMagic") == true){ + ForbiddenMagic = true; + Utils.LOG_INFO("Components enabled for: ForbiddenMagic"); + totalMods++; + } + if (Loader.isModLoaded("CompactWindmills") == true){ + CompactWindmills = true; + Utils.LOG_INFO("Components enabled for: CompactWindmills"); + totalMods++; + } + if (Loader.isModLoaded("Railcraft") == true){ + Railcraft = true; + Utils.LOG_INFO("Components enabled for: Railcraft"); + totalMods++; + } + if (Loader.isModLoaded("Growthcraft") == true){ + Growthcraft = true; + Utils.LOG_INFO("Components enabled for: Growthcraft"); + totalMods++; + } + if (Loader.isModLoaded("CoFHCore") == true){ + CoFHCore = true; + Utils.LOG_INFO("Components enabled for: CoFHCore"); + totalMods++; + } + if (Loader.isModLoaded("Forestry") == true){ + Forestry = true; + Utils.LOG_INFO("Components enabled for: Forestry"); + totalMods++; + } + if (Loader.isModLoaded("MagicBees") == true){ + MagicBees = true; + Utils.LOG_INFO("Components enabled for: MagicBees"); + totalMods++; + } + if (Loader.isModLoaded("psychedelicraft") == true){ + Psychedelicraft = true; + Utils.LOG_INFO("Components enabled for: Psychedelicraft"); + totalMods++; + } + if (Loader.isModLoaded("ImmersiveEngineering") == true){ + ImmersiveEngineering = true; + Utils.LOG_INFO("Components enabled for: ImmersiveEngineering"); + totalMods++; + } + if (Loader.isModLoaded("ExtraBees") == true){ + ExtraBees = true; + Utils.LOG_INFO("Components enabled for: ExtraBees"); + totalMods++; + } + if (Loader.isModLoaded("ThermalFoundation") == false){ + ThermalFoundation = false; + Utils.LOG_INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF."); + totalMods++; + } + else if (Loader.isModLoaded("ThermalFoundation") == true){ + ThermalFoundation = true; + Utils.LOG_INFO("Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF."); + //totalMods++; + } + if (Loader.isModLoaded("ihl") == true){ + IHL = true; + Utils.LOG_INFO("Components enabled for: IHL"); + totalMods++; + } + + Utils.LOG_INFO("Content found for "+totalMods+" mods"); + + } +} diff --git a/src/Java/gtPlusPlus/core/lib/MaterialInfo.java b/src/Java/gtPlusPlus/core/lib/MaterialInfo.java new file mode 100644 index 0000000000..5f80224bca --- /dev/null +++ b/src/Java/gtPlusPlus/core/lib/MaterialInfo.java @@ -0,0 +1,149 @@ +package gtPlusPlus.core.lib; + +import static gtPlusPlus.core.lib.CORE.noItem; +import static gtPlusPlus.core.util.item.UtilsItems.getItemStackOfAmountFromOreDict; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TextureSet; +import gtPlusPlus.GTplusplus; +import gtPlusPlus.core.util.materials.MaterialUtils; + +import java.util.List; + +import net.minecraft.item.ItemStack; + +public enum MaterialInfo { + + ENERGYCRYSTAL(GTplusplus.randomDust_A, 8, GTplusplus.randomDust_B, 8, GTplusplus.randomDust_C, 8, GTplusplus.randomDust_D, 8, "dustEnergyCrystal", 1, noItem, 0), + BLOODSTEEL(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0), + STABALLOY("dustTitanium", 1, "dustUranium", 8, noItem, 0, noItem, 0, "dustStaballoy", 1, noItem, 0), + TANTALLOY60("dustTungsten", 1, "dustTantalum", 8, "dustTinyTitanium", 5, noItem, 0, "dustTantalloy60", 1, noItem, 0), + TANTALLOY61("dustTungsten", 1, "dustSmallTitanium", 3, "dustSmallYttrium", 2, "dustTantalum", 9, "dustTantalloy61", 1, noItem, 0), + QUANTUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0), + TUMBAGA("dustGold", 6, "dustCopper", 3, noItem, 0, noItem, 0, "dustTumbaga", 2, noItem, 0), + POTIN("dustBronze", 3, "dustTin", 2, "dustLead", 4, noItem, 0, "dustPotin", 3, noItem, 0), + BEDROCKIUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0), + INCONEL625("dustNickel", 5, "dustChrome", 2, "dustWroughtIron", 1, "dustMolybdenum", 1, "dustInconel625", 4, "dustTinyDarkAsh", 1), + INCONEL690("dustNickel", 5, "dustChrome", 2, "dustNiobium", 1, "dustMolybdenum", 1, "dustInconel690", 2, "dustTinyDarkAsh", 1), + INCONEL792("dustNickel", 5, "dustChrome", 1, "dustAluminium", 2, "dustNiobium", 1, "dustInconel792", 2, "dustTinyDarkAsh", 1), + TUNGSTENCARBIDE("dustTungsten", 16, "dustCarbon", 16, noItem, 0, noItem, 0, "dustTungstenCarbide", 4, noItem, 0), + SILICONCARBIDE("dustSilicon", 16, "dustCarbon", 16, noItem, 0, noItem, 0, "dustSiliconCarbide", 4, noItem, 0), + ZERON100("dustChrome", 5, "dustSmallNickel", 6, "dustSmallMolybdenum", 3, "dustSteel", 14, "dustZeron100", 5, noItem, 0), + MARAGING250("dustSteel", 4, "dustNickel", 2, "dustCobalt", 1, "dustTinyTitanium", 1, "dustMaragingSteel250", 6, noItem, 0), + MARAGING300("dustSteel", 5, "dustNickel", 2, "dustCobalt", 2, "dustSmallTitanium", 1, "dustMaragingSteel300", 5, noItem, 0), + MARAGING350("dustSteel", 6, "dustNickel", 3, "dustCobalt", 3, "dustTitanium", 1, "dustMaragingSteel350", 4, noItem, 0), + STELLITE("dustCobalt", 4, "dustChrome", 4, "dustManganese", 2, "dustTitanium", 1, "dustStellite", 2, noItem, 0), + TALONITE("dustCobalt", 4, "dustChrome", 4, "dustPhosphorus", 1, "dustMolybdenum", 1, "dustTalonite", 2, noItem, 0), + HASTELLOY_W("dustSmallCobalt", 1, "dustSmallChrome", 4, "dustMolybdenum", 2, "dustNickel", 6, "dustHastelloyW", 2, noItem, 0), + HASTELLOY_X("dustTinyCobalt", 6, "dustChrome", 2, "dustMolybdenum", 1, "dustNickel", 5, "dustHastelloyX", 2, noItem, 0), + HASTELLOY_C276("dustSmallCobalt", 1, "dustSmallChrome", 14, "dustSmallMolybdenum", 14, "dustNickel", 5, "dustHastelloyC276", 2, noItem, 0), + INCOLOY020("dustIron", 4, "dustChrome", 2, "dustTinyCarbon", 2, "dustSmallCopper", 4, "dustIncoloy020", 1, noItem, 0), + INCOLOYDS("dustIron", 4, "dustChrome", 2, "dustTinyTitanium", 2, "dustSmallManganese", 1, "dustIncoloyDS", 1, noItem, 0), + INCOLOYMA956("dustIron", 6, "dustChrome", 2, "dustSmallAluminium", 5, "dustTinyYttrium", 1, "dustIncoloyMA956", 1, noItem, 0), + TANTALUMCARBIDE("dustTantalum", 4, "dustCarbon", 2, noItem, 0, noItem, 0, "dustTantalumCarbide", 1, noItem, 0), + ZIRCONIUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, "dustZirconium", 1, noItem, 0), + ZIRCONIUMCARBIDE("dustZirconium", 2, "dustCarbon", 2, noItem, 0, noItem, 0, "dustZirconiumCarbide", 1, noItem, 0), + NIOMBIUMCARBIDE("dustNiobium", 2, "dustCarbon", 2, noItem, 0, noItem, 0, "dustNiobiumCarbide", 1, noItem, 0), + HASTELLOY_N("dustIron", 1, "dustSmallChrome", 7, "dustSmallMolybdenum", 12, "dustNickel", 4, "dustHastelloyN", 1, noItem, 0); + + + + private String input1; + private String input2; + private String input3; + private String input4; + private int inputAmount1; + private int inputAmount2; + private int inputAmount3; + private int inputAmount4; + private String out1; + private String out2; + private int outAmount1; + private int outAmount2; + public static List<String> nonLoadedInputs; + public final Materials materialGT; + + private MaterialInfo ( + String inputMaterial_1, int amountIn1, + String inputMaterial_2, int amountIn2, + String inputMaterial_3, int amountIn3, + String inputMaterial_4, int amountIn4, + String output_A,int amount1, String output_B, int amount2) + { + this.input1 = inputMaterial_1; + this.input2 = inputMaterial_2; + this.input3 = inputMaterial_3; + this.input4 = inputMaterial_4; + this.inputAmount1 = amountIn1; + this.inputAmount2 = amountIn2; + this.inputAmount3 = amountIn3; + this.inputAmount4 = amountIn4; + this.out1 = output_A; + this.out2 = output_B; + this.outAmount1 = amount1; + this.outAmount2 = amount2; + + + + this.materialGT = MaterialUtils.addGtMaterial( + getMaterialName().toLowerCase(), TextureSet.SET_DULL, 2f, 512, 2, + 1 | 2 | 16 | 32 | 64 | 128, + 193, 211, 217, 0, getMaterialName(), 0, 0, 3015, 2150, true, + false, 1, 2, 1, Dyes.dyeWhite, 2, null, null); + } + + public ItemStack[] getInputs() { + return new ItemStack[]{ + getStack(input1, inputAmount1), + getStack(input2, inputAmount2), + getStack(input3, inputAmount3), + getStack(input4, inputAmount4) + }; + } + + public ItemStack[] getOutputs() { + return new ItemStack[]{ + getStack(out1, outAmount1), + getStack(out2, outAmount2) + }; + } + + public String[] getInputItemsAsList(){ + String[] inputArray = { + input1, + input2, + input3, + input4 + }; + return inputArray; + } + + public int[] getInputStackSizesAsList(){ + int[] inputArray = { + inputAmount1, + inputAmount2, + inputAmount3, + inputAmount4 + }; + return inputArray; + } + + @SuppressWarnings("static-method") + public ItemStack getStack(String i, int r){ + if (i == ""){ + return null; + } + ItemStack temp = getItemStackOfAmountFromOreDict(i,r); + if (temp.getDisplayName().toLowerCase().contains("tell alkalus")){ + //temp = null; + } + return temp; + } + + public String getMaterialName(){ + String x = this.name(); + return x; + } + + +} |