From 9fe3f693f1d6d015f45898818b7958b3a57a9f4a Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 26 Jul 2019 04:23:36 +0100 Subject: + Added config option to adjust ingame BGM delays. (Should be working) + Added a Pest Killer for quick removal of Butterflies and Bats. + Added Hydrogen Cyanide. % Replaced existing assets for the Bat King. % Replaced Bat King Logic, it's now an offensive mob. $ Fixed Bat King model scaling. --- src/resources/assets/miscutils/lang/en_US.lang | 3 +++ .../blocks/TileEntities/MACHINE_PESTKILLER_TOP.png | Bin 0 -> 624 bytes .../assets/miscutils/textures/entity/batKing.png | Bin 0 -> 1994 bytes .../assets/miscutils/textures/gui/PestKiller.png | Bin 0 -> 1833 bytes 4 files changed, 3 insertions(+) create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_PESTKILLER_TOP.png create mode 100644 src/resources/assets/miscutils/textures/entity/batKing.png create mode 100644 src/resources/assets/miscutils/textures/gui/PestKiller.png (limited to 'src/resources') diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 38188e838b..cf25dad8a9 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -2956,3 +2956,6 @@ item.GTPP.bauble.fireprotection.0.name=Supreme Pizza Gloves //Added 16/5/19 item.itemCellSeleniumDioxide.name=Selenium Dioxide Cell item.itemCellSeleniousAcid.name=Selenious Acid Cell + +//Added 25/8/19 +container.pestkiller=Pest Killer diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_PESTKILLER_TOP.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_PESTKILLER_TOP.png new file mode 100644 index 0000000000..2602f44af3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_PESTKILLER_TOP.png differ diff --git a/src/resources/assets/miscutils/textures/entity/batKing.png b/src/resources/assets/miscutils/textures/entity/batKing.png new file mode 100644 index 0000000000..ced2722563 Binary files /dev/null and b/src/resources/assets/miscutils/textures/entity/batKing.png differ diff --git a/src/resources/assets/miscutils/textures/gui/PestKiller.png b/src/resources/assets/miscutils/textures/gui/PestKiller.png new file mode 100644 index 0000000000..d1978ae04a Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/PestKiller.png differ -- cgit From 2b4f8358bee6f2f4674482cd02915d9416013658 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 2 Aug 2019 14:59:37 +0100 Subject: + Added some legacy burnables. --- .../core/handler/COMPAT_IntermodStaging.java | 4 ++ src/Java/gtPlusPlus/core/item/ModItems.java | 11 +-- .../xmod/railcraft/HANDLER_Railcraft.java | 74 +++++++++++++++++++++ .../xmod/railcraft/utils/RailcraftUtils.java | 13 ++++ .../items/burnables/itemCactusCharcoal.png | Bin 0 -> 354 bytes .../textures/items/burnables/itemCactusCoke.png | Bin 0 -> 379 bytes .../textures/items/burnables/itemCoalCoke.png | Bin 0 -> 282 bytes .../textures/items/burnables/itemSugarCharcoal.png | Bin 0 -> 387 bytes .../textures/items/burnables/itemSugarCoke.png | Bin 0 -> 397 bytes .../miscutils/textures/items/itemCoalCoke.png | Bin 282 -> 0 bytes 10 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java create mode 100644 src/Java/gtPlusPlus/xmod/railcraft/utils/RailcraftUtils.java create mode 100644 src/resources/assets/miscutils/textures/items/burnables/itemCactusCharcoal.png create mode 100644 src/resources/assets/miscutils/textures/items/burnables/itemCactusCoke.png create mode 100644 src/resources/assets/miscutils/textures/items/burnables/itemCoalCoke.png create mode 100644 src/resources/assets/miscutils/textures/items/burnables/itemSugarCharcoal.png create mode 100644 src/resources/assets/miscutils/textures/items/burnables/itemSugarCoke.png delete mode 100644 src/resources/assets/miscutils/textures/items/itemCoalCoke.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index 0f689325a3..d6a24d718a 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -12,6 +12,7 @@ import gtPlusPlus.xmod.galacticraft.HANDLER_GalactiCraft; import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.growthcraft.HANDLER_GC; import gtPlusPlus.xmod.ic2.HANDLER_IC2; +import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft; import gtPlusPlus.xmod.sc2.HANDLER_SC2; import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft; import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF; @@ -33,6 +34,7 @@ public class COMPAT_IntermodStaging { HANDLER_SC2.preInit(); HANDLER_GalactiCraft.preInit(); HANDLER_CropsPlusPlus.preInit(preinit); + HANDLER_Railcraft.preInit(); } public static void init(FMLInitializationEvent init){ @@ -49,6 +51,7 @@ public class COMPAT_IntermodStaging { HANDLER_SC2.init(); HANDLER_GalactiCraft.init(); HANDLER_CropsPlusPlus.init(init); + HANDLER_Railcraft.init(); } public static void postInit(FMLPostInitializationEvent postinit){ @@ -65,6 +68,7 @@ public class COMPAT_IntermodStaging { HANDLER_SC2.postInit(); HANDLER_GalactiCraft.postInit(); HANDLER_CropsPlusPlus.postInit(postinit); + HANDLER_Railcraft.postInit(); } public static void onLoadComplete(FMLLoadCompleteEvent event) { diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index de22821127..3b919ee431 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -288,6 +288,10 @@ public final class ModItems { public static Item itemAirFilter; public static Item itemCoalCoke; + public static Item itemCactusCharcoal; + public static Item itemSugarCharcoal; + public static Item itemCactusCoke; + public static Item itemSugarCoke; public static Item itemCircuitLFTR; @@ -394,11 +398,8 @@ public final class ModItems { //Some Simple forms of materials itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber"); GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber"); - GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemStickyRubber", 1)); - - - itemCoalCoke = new BaseItemBurnable("itemCoalCoke", "Coking Coal", tabMisc, 64, 0, "Used for metallurgy.", "fuelCoke", 3200, 0).setTextureName(CORE.MODID + ":itemCoalCoke"); - + GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemStickyRubber", 1)); + //Register Hydrogen Blobs first, so we can replace old helium blobs. itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob"); //Register Old Helium Blob, this will be replaced when held by a player. diff --git a/src/Java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java b/src/Java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java new file mode 100644 index 0000000000..0a02e0a6be --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/railcraft/HANDLER_Railcraft.java @@ -0,0 +1,74 @@ +package gtPlusPlus.xmod.railcraft; + +import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; + +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.base.BaseItemBurnable; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils; +import net.minecraft.item.ItemStack; + +public class HANDLER_Railcraft { + + + + public static void preInit() { + if (LoadedMods.Railcraft) { + + } + + //Register Custom Coal Coke + ModItems.itemCoalCoke = new BaseItemBurnable("itemCoalCoke", "Coking Coal", tabMisc, 64, 0, "Used for metallurgy.", "fuelCoke", 3200, 0).setTextureName(CORE.MODID + ":itemCoalCoke"); + + //Add in things that once existed in 1.5.2 + ModItems.itemCactusCharcoal = new BaseItemBurnable("itemCactusCharcoal", "Cactus Charcoal", tabMisc, 64, 0, "Used for smelting.", "fuelCactusCharcoal", 400, 0).setTextureName(CORE.MODID + ":itemCactusCharcoal"); + ModItems.itemSugarCharcoal = new BaseItemBurnable("itemSugarCharcoal", "Sugar Charcoal", tabMisc, 64, 0, "Used for smelting.", "fuelSugarCharcoal", 400, 0).setTextureName(CORE.MODID + ":itemSugarCharcoal"); + ModItems.itemCactusCoke = new BaseItemBurnable("itemCactusCoke", "Cactus Coke", tabMisc, 64, 0, "Used for smelting.", "fuelCactusCoke", 800, 0).setTextureName(CORE.MODID + ":itemCactusCoke"); + ModItems.itemSugarCoke = new BaseItemBurnable("itemSugarCoke", "Sugar Coke", tabMisc, 64, 0, "Used for smelting.", "fuelSugarCoke", 800, 0).setTextureName(CORE.MODID + ":itemSugarCoke"); + + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal), "itemCharcoalCactus"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemCactusCoke), "itemCokeCactus"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal), "itemCharcoalSugar"); + ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(ModItems.itemSugarCoke), "itemCokeSugar"); + + } + + public static void init() { + if (LoadedMods.Railcraft) { + + } + } + + public static void postInit() { + if (LoadedMods.Railcraft) { + + } + generateCokeOvenRecipes(); + } + + + private static void generateCokeOvenRecipes() { + ItemStack[] aInputs = new ItemStack[] { + ItemUtils.getSimpleStack(ModItems.itemCactusCharcoal), + ItemUtils.getSimpleStack(ModItems.itemSugarCharcoal) + }; + ItemStack[] aOutputs = new ItemStack[] { + ItemUtils.getSimpleStack(ModItems.itemCactusCoke), + ItemUtils.getSimpleStack(ModItems.itemSugarCoke) + }; + for (int i=0;i Date: Thu, 15 Aug 2019 03:33:28 +0100 Subject: + Re-added Tiered Machine Covers. (Old ones will be deprecated) Closes #516. + Added extra tiered covers. (For use in GTNH mostly) + Added textures and colour coding for Ztones covers. + Localized some cover names. --- src/Java/gtPlusPlus/core/lib/VanillaColours.java | 28 +++++++ .../xmod/gregtech/common/covers/CoverManager.java | 85 ++++++++++++++++++--- .../common/covers/GTPP_Cover_ToggleVisual.java | 32 ++++++-- .../gregtech/common/items/MetaCustomCoverItem.java | 53 ++++++++----- .../common/items/MetaGeneratedGregtechItems.java | 2 +- .../common/items/covers/MetaItemCoverCasings.java | 36 +++++++++ .../assets/miscutils/textures/items/covers/0.png | Bin 0 -> 489 bytes .../assets/miscutils/textures/items/covers/1.png | Bin 0 -> 451 bytes .../assets/miscutils/textures/items/covers/10.png | Bin 0 -> 426 bytes .../assets/miscutils/textures/items/covers/11.png | Bin 0 -> 408 bytes .../assets/miscutils/textures/items/covers/12.png | Bin 0 -> 439 bytes .../assets/miscutils/textures/items/covers/13.png | Bin 0 -> 439 bytes .../assets/miscutils/textures/items/covers/14.png | Bin 0 -> 422 bytes .../assets/miscutils/textures/items/covers/15.png | Bin 0 -> 443 bytes .../assets/miscutils/textures/items/covers/2.png | Bin 0 -> 449 bytes .../assets/miscutils/textures/items/covers/3.png | Bin 0 -> 463 bytes .../assets/miscutils/textures/items/covers/4.png | Bin 0 -> 465 bytes .../assets/miscutils/textures/items/covers/5.png | Bin 0 -> 462 bytes .../assets/miscutils/textures/items/covers/6.png | Bin 0 -> 477 bytes .../assets/miscutils/textures/items/covers/7.png | Bin 0 -> 461 bytes .../assets/miscutils/textures/items/covers/8.png | Bin 0 -> 474 bytes .../assets/miscutils/textures/items/covers/9.png | Bin 0 -> 482 bytes 22 files changed, 197 insertions(+), 39 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/lib/VanillaColours.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java create mode 100644 src/resources/assets/miscutils/textures/items/covers/0.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/1.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/10.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/11.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/12.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/13.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/14.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/15.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/2.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/3.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/4.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/5.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/6.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/7.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/8.png create mode 100644 src/resources/assets/miscutils/textures/items/covers/9.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/lib/VanillaColours.java b/src/Java/gtPlusPlus/core/lib/VanillaColours.java new file mode 100644 index 0000000000..9a7a82cb1f --- /dev/null +++ b/src/Java/gtPlusPlus/core/lib/VanillaColours.java @@ -0,0 +1,28 @@ +package gtPlusPlus.core.lib; + +import gtPlusPlus.core.util.Utils; + +public enum VanillaColours { + + BONE_MEAL(249, 255, 254), INK_BLACK(29, 29, 33), COCOA_BEANS(131, 84, 50), LAPIS_LAZULI(60, 68, 170), + DYE_WHITE(249, 255, 254), DYE_BLACK(29, 29, 33), DYE_RED(176, 46, 38), DYE_GREEN(94, 124, 22), + DYE_CYAN(22, 156, 156), DYE_PINK(243, 139, 170), DYE_LIME(128, 199, 31), DYE_YELLOW(254, 216, 61), + DYE_ORANGE(249, 128, 29), DYE_BROWN(131, 84, 50), DYE_LIGHT_BLUE(58, 179, 218), DYE_LIGHT_PURPLE(199, 78, 189), + DYE_LIGHT_GRAY(157, 157, 151), DYE_DARK_BLUE(60, 68, 170), DYE_DARK_PURPLE(137, 50, 184), DYE_DARK_GRAY(71, 79, 82); + + private final int r, g, b; + + private VanillaColours(int aR, int aG, int aB) { + r = aR; + g = aG; + b = aB; + } + + public short[] getAsShort() { + return new short[] { (short) r, (short) g, (short) b }; + } + + public int getAsInt() { + return Utils.rgbtoHexValue(r, g, b); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java index b412e0fe60..2fba1b0448 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java @@ -7,35 +7,96 @@ import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCov import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_KORP; import cpw.mods.fml.common.Loader; +import gtPlusPlus.core.lib.VanillaColours; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers; import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; +import gtPlusPlus.xmod.gregtech.common.items.covers.MetaItemCoverCasings; public class CoverManager { - - //ZTones + + // ZTones public static MetaCustomCoverItem Cover_Agon; public static MetaCustomCoverItem Cover_Iszm; public static MetaCustomCoverItem Cover_Korp; public static MetaCustomCoverItem Cover_Jelt; public static MetaCustomCoverItem Cover_Bitt; - + + // GT + public static MetaItemCoverCasings Cover_Gt_Machine_Casing; public static void generateCustomCovers() { // init textures TexturesGtCutomCovers.init(); - + + // GT Machine Casings + Cover_Gt_Machine_Casing = new MetaItemCoverCasings(); + if (Loader.isModLoaded("Ztones")) { String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; - MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp, Cover_Jelt, Cover_Bitt}; - CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; - for (int y=0;y Date: Thu, 15 Aug 2019 07:55:35 +0100 Subject: + Attempted to add a buggy NEI page for decayable dusts. + Added a way to disable ALL GT++ logging in the ASM config file. + Added recipes for Ztones covers. % Adjusted recipes for Tiered machine covers. % Updated GT++ debug command to toggle logging if desired. (Useful in-game). $ Fixed bug where smart covers would lose their state. --- src/Java/gtPlusPlus/api/objects/Logger.java | 156 +++++---- .../api/objects/minecraft/ShapedRecipe.java | 12 +- .../commands/CommandEnableDebugWhileRunning.java | 46 ++- src/Java/gtPlusPlus/core/common/CommonProxy.java | 6 + .../core/handler/Recipes/DecayableRecipe.java | 39 +++ .../core/item/materials/DustDecayable.java | 4 + .../gtPlusPlus/core/recipe/RECIPES_General.java | 13 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 364 +++++++++++++-------- src/Java/gtPlusPlus/core/recipe/common/CI.java | 5 +- .../gtPlusPlus/core/util/minecraft/ItemUtils.java | 145 ++++---- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 113 +++++++ src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 6 +- src/Java/gtPlusPlus/preloader/asm/AsmConfig.java | 10 +- .../common/covers/GTPP_Cover_ToggleVisual.java | 84 +++-- src/resources/assets/miscutils/lang/en_US.lang | 12 +- 15 files changed, 686 insertions(+), 329 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java create mode 100644 src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/api/objects/Logger.java b/src/Java/gtPlusPlus/api/objects/Logger.java index 616a241d89..9c1e3d4338 100644 --- a/src/Java/gtPlusPlus/api/objects/Logger.java +++ b/src/Java/gtPlusPlus/api/objects/Logger.java @@ -6,11 +6,12 @@ import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.FMLRelaunchLog; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.proxy.ClientProxy; +import gtPlusPlus.preloader.asm.AsmConfig; public class Logger { - + public Logger(String string) { - + } // Logging Functions @@ -22,133 +23,170 @@ public class Logger { return gtPlusPlusLogger; } + private static final boolean enabled = !AsmConfig.disableAllLogging; + public static final org.apache.logging.log4j.Logger getLogger(){ return modLogger; } // Non-Dev Comments public static void INFO(final String s) { - modLogger.info(s); + if (enabled) { + modLogger.info(s); + } } // Non-Dev Comments public static void MACHINE_INFO(final String s) { - - boolean localPlayer = false; - try { - if (ClientProxy.playerName != null){ - if (ClientProxy.playerName.toLowerCase().contains("draknyte1")){ - localPlayer = true; + if (enabled) { + + boolean localPlayer = false; + try { + if (ClientProxy.playerName != null){ + if (ClientProxy.playerName.toLowerCase().contains("draknyte1")){ + localPlayer = true; + } } } - } - catch (final Throwable t){ - - } - - if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) { - final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); - modLogger.info("Machine Info: " + s + " | " + name1); + catch (final Throwable t){ + + } + + if (CORE.ConfigSwitches.MACHINE_INFO || localPlayer) { + final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); + modLogger.info("Machine Info: " + s + " | " + name1); + } } } // Developer Comments public static void WARNING(final String s) { - if (CORE.DEBUG) { - modLogger.warn(s); + if (enabled) { + if (CORE.DEBUG) { + modLogger.warn(s); + } } } // Errors public static void ERROR(final String s) { - if (CORE.DEBUG) { - modLogger.fatal(s); + if (enabled) { + if (CORE.DEBUG) { + modLogger.fatal(s); + } } } // Developer Logger public static void SPECIFIC_WARNING(final String whatToLog, final String msg, final int line) { - // if (!CORE.DEBUG){ - FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg); - // } + if (enabled) { + // if (!CORE.DEBUG){ + FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg); + // } + } } // ASM Comments public static void LOG_ASM(final String s) { - FMLRelaunchLog.info("[Special ASM Logging] ", s); - } - - - - - - - - - - + if (enabled) { + FMLRelaunchLog.info("[Special ASM Logging] ", s); + } + } + + + + + + + + + + /** * Special Loggers */ - + /** * Special Logger for Bee related content */ public static void BEES(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Bees] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Bees] "+s); + } + } } /** * Special Logger for Debugging Bee related content */ public static void DEBUG_BEES(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Debug][Bees] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Debug][Bees] "+s); + } + } } - - - + + + /** * Special Logger for Materials related content */ public static void MATERIALS(final String s) { - if (/* CORE.DEVENV || */CORE.DEBUG) - modLogger.info("[Materials] "+s); + if (enabled) { + if (/* CORE.DEVENV || */CORE.DEBUG) { + modLogger.info("[Materials] "+s); + } + } } /** * Special Logger for Debugging Materials related content */ public static void DEBUG_MATERIALS(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Debug][Materials] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Debug][Materials] "+s); + } + } } - + /** * Special Logger for Reflection related content */ public static void REFLECTION(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[Reflection] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[Reflection] "+s); + } + } } - + /** * Special Logger for Darkworld related content */ public static void WORLD(final String s) { - if (CORE.DEVENV || CORE.DEBUG) - modLogger.info("[WorldGen] "+s); + if (enabled) { + if (CORE.DEVENV || CORE.DEBUG) { + modLogger.info("[WorldGen] "+s); + } + } } public static void RECIPE(String string) { - if (/*CORE.DEVENV || */CORE.DEBUG) - modLogger.info("[Recipe] "+string); + if (enabled) { + if (/*CORE.DEVENV || */CORE.DEBUG) { + modLogger.info("[Recipe] "+string); + } + } } public static void SPACE(final String s) { - modLogger.info("[Space] "+s); + if (enabled) { + modLogger.info("[Space] "+s); + } } - - + + } diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java index 1073e63914..c0e9b20c54 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java @@ -3,11 +3,7 @@ package gtPlusPlus.api.objects.minecraft; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; -import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry; -import gtPlusPlus.xmod.ic2.item.IC2_Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -36,13 +32,7 @@ public class ShapedRecipe { String[] aLoggingInfo = new String[9]; if (mBlackList == null) { - mBlackList = new ItemStack[] { - ItemUtils.getSimpleStack(ModBlocks.blockNet), - ItemUtils.getSimpleStack(ModBlocks.blockXpConverter), - ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard), - ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive), - ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame), - }; + mBlackList = new ItemStack[] {}; } //Just to be safe diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 3a7d4461f4..5b9c17bacf 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -7,6 +7,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.preloader.asm.AsmConfig; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; @@ -33,6 +34,9 @@ public class CommandEnableDebugWhileRunning implements ICommand } + + // Use '/debugmodegtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging. + // Using nothing after the command toggles both to their opposite states respectively. @Override public String getCommandUsage(final ICommandSender var1){ return "/debugmodegtpp"; @@ -47,16 +51,44 @@ public class CommandEnableDebugWhileRunning implements ICommand @Override public void processCommand(final ICommandSender S, final String[] argString){ - Logger.INFO("Toggling Debug Mode"); - final World W = S.getEntityWorld(); - final EntityPlayer P = CommandUtils.getPlayer(S); - - if (PlayerUtils.isPlayerOP(P)) { - CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG); - PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG); + if (argString == null || argString.length == 0 || argString.length > 1) { + Logger.INFO("Toggling Debug Mode & Logging."); + final EntityPlayer P = CommandUtils.getPlayer(S); + if (PlayerUtils.isPlayerOP(P)) { + CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG); + PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG); + AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging); + PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging)); + } + } + else { + if (argString[0].toLowerCase().equals("debug")) { + Logger.INFO("Toggling Debug Mode."); + final EntityPlayer P = CommandUtils.getPlayer(S); + if (PlayerUtils.isPlayerOP(P)) { + CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG); + PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG); + } + } + else if (argString[0].toLowerCase().equals("logging")) { + Logger.INFO("Toggling Logging."); + final EntityPlayer P = CommandUtils.getPlayer(S); + if (PlayerUtils.isPlayerOP(P)) { + AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging); + PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging)); + } + } + else { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (PlayerUtils.isPlayerOP(P)) { + PlayerUtils.messagePlayer(P, "Invalid command, use 'debug' or 'logging'"); + } + } } + + } @Override diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 23bd46d5b0..ea106a2c2f 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -190,11 +190,17 @@ public class CommonProxy { } // Compat Handling + Logger.INFO("Removing recipes from other mods."); COMPAT_HANDLER.RemoveRecipesFromOtherMods(); + Logger.INFO("Initialising Handler, Then Adding Recipes"); COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); + Logger.INFO("Loading Gregtech API recipes."); COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); + Logger.INFO("Loading Intermod staging."); COMPAT_IntermodStaging.postInit(e); + Logger.INFO("Loading queued recipes."); COMPAT_HANDLER.runQueuedRecipes(); + Logger.INFO("Registering custom mob drops."); registerCustomMobDrops(); } diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java b/src/Java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java new file mode 100644 index 0000000000..360b0440a2 --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java @@ -0,0 +1,39 @@ +package gtPlusPlus.core.handler.Recipes; + +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; + +public class DecayableRecipe { + + public static final AutoMap mRecipes = new AutoMap(); + + + public final int mTime; + public final ItemStack mInput; + public final ItemStack mOutput; + + public DecayableRecipe(int time, ItemStack input, ItemStack output) { + mTime = time; + mInput = input; + mOutput = output; + mRecipes.put(this); + } + + @Override + public boolean equals(Object o) { + if (o instanceof DecayableRecipe) { + DecayableRecipe i = (DecayableRecipe) o; + if (i.mTime == this.mTime && GT_Utility.areStacksEqual(mInput, i.mInput) && GT_Utility.areStacksEqual(mOutput, i.mOutput)) { + return true; + } + } + return false; + } + + public boolean isValid() { + return (mTime > 0 && ItemUtils.checkForInvalidItems(mInput) && ItemUtils.checkForInvalidItems(mOutput)); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java b/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java index aa6fdabacc..9994c7d362 100644 --- a/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java +++ b/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.item.materials; +import static gtPlusPlus.core.util.minecraft.ItemUtils.getSimpleStack; + import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; @@ -10,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.handler.Recipes.DecayableRecipe; import gtPlusPlus.core.item.base.BaseItemTickable; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.EntityUtils; @@ -25,6 +28,7 @@ public class DustDecayable extends BaseItemTickable { this.turnsIntoItem = turnsInto; this.radLevel = radLevel; GT_OreDictUnificator.registerOre(unlocal, ItemUtils.getSimpleStack(this)); + new DecayableRecipe(maxTicks, getSimpleStack(this), getSimpleStack(turnsInto)); } @Override diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 14807f7f3e..02b282b1b3 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -6,7 +6,9 @@ import static gtPlusPlus.core.util.minecraft.ItemUtils.getSimpleStack; import static gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits.generatePipeRecipes; import static gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits.generateWireRecipes; -import gregtech.api.enums.*; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; @@ -15,16 +17,13 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -119,12 +118,6 @@ public class RECIPES_General { Logger.INFO("Added a recipe for Rainforest oak Saplings."); } - - // Try fix this ore - if (ModBlocks.blockOreFluorite != null){ - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{ItemUtils.getSimpleStack(ModBlocks.blockOreFluorite)}, FLUORIDES.FLUORITE.getOre(1)); - } - //Iron bars final ItemStack ironBars; if (CORE.GTNH) { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 52a6c4889e..0bd5c0cf76 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.recipe; import static gtPlusPlus.core.lib.CORE.GTNH; +import cpw.mods.fml.common.Loader; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; @@ -15,8 +16,12 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.covers.CoverManager; +import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -207,7 +212,7 @@ public class RECIPES_Machines { } private static void run(){ - + //Determines Casing Recipe Output if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !GTNH){ Casing_Amount=2; @@ -215,7 +220,7 @@ public class RECIPES_Machines { else { Casing_Amount=1; } - + initModItems(); controlCores(); energyCores(); @@ -223,6 +228,7 @@ public class RECIPES_Machines { largeArcFurnace(); industrialVacuumFurnace(); fakeMachineCasingCovers(); + ztonesCoverRecipes(); superBuses(); } @@ -289,7 +295,7 @@ public class RECIPES_Machines { private static void runModRecipes(){ if (LoadedMods.Gregtech){ - + //Computer Cube CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { @@ -357,7 +363,7 @@ public class RECIPES_Machines { ItemUtils.getSimpleStack(ModBlocks.blockCustomJukebox), 20 * 30, 30); - + //Poo Collector CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { @@ -708,7 +714,7 @@ public class RECIPES_Machines { //Semi-Fluid Generators ItemStack mSemiFluidgen = ItemUtils.getItemStackFromFQRN("IC2:blockGenerator:7", 1); mSemiFluidgen.setItemDamage(7); - //ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1); + //ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1); ItemStack[] aSemifluids = new ItemStack[] {mSemiFluidgen, GregtechItemList.Generator_SemiFluid_LV.get(1), GregtechItemList.Generator_SemiFluid_MV.get(1), GregtechItemList.Generator_SemiFluid_HV.get(1)}; for (int o=1;o<4;o++) { CORE.RA.addSixSlotAssemblingRecipe( @@ -829,7 +835,7 @@ public class RECIPES_Machines { "plankWood", "frameGtTumbaga", "plankWood", "plankWood", "plankWood", "plankWood", RECIPE_TreeFarmFrame); - } + } if (CORE.ConfigSwitches.enableMachine_Tesseracts){ //Tesseracts @@ -852,8 +858,8 @@ public class RECIPES_Machines { if (CORE.ConfigSwitches.enableMachine_SimpleWasher){ ItemStack plateWrought = ItemUtils.getItemStackOfAmountFromOreDict("plateWroughtIron", 1); ItemStack washerPipe; - - + + if (CORE.ConfigSwitches.enableCustom_Pipes){ washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeClay", 1); RecipeUtils.addShapedGregtechRecipe( @@ -869,7 +875,7 @@ public class RECIPES_Machines { plateWrought, washerPipe, plateWrought, plateWrought, CI.machineCasing_ULV, plateWrought, GregtechItemList.SimpleDustWasher_ULV.get(1)); - + int aSimpleWasherTier = 2; int aSlot = 0; ItemStack[][] aInputsForSimpleWashers = new ItemStack[4][6]; @@ -880,7 +886,7 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.plate, 1, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.rod, 2, GTNH ? 4 : 2), CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 3 : 1), - + }; aInputsForSimpleWashers[1] = new ItemStack[] { CI.getTieredMachineHull(4), @@ -888,7 +894,7 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.plate, 3, GTNH ? 12 : 6), CI.getTieredComponent(OrePrefixes.rod, 4, GTNH ? 6 : 3), CI.getTieredComponent(OrePrefixes.circuit, 4, GTNH ? 4 : 2), - + }; aInputsForSimpleWashers[2] = new ItemStack[] { CI.getTieredMachineHull(6), @@ -896,7 +902,7 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8), CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 6 : 3), - + }; aInputsForSimpleWashers[3] = new ItemStack[] { CI.getTieredMachineHull(8), @@ -904,37 +910,37 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.plate, 7, GTNH ? 32 : 16), CI.getTieredComponent(OrePrefixes.rod, 8, GTNH ? 10 : 5), CI.getTieredComponent(OrePrefixes.circuit, 8, GTNH ? 8 : 4), - + }; - - - - - - + + + + + + ItemStack[] aSimpleWashers = new ItemStack[] {GregtechItemList.SimpleDustWasher_MV.get(1), GregtechItemList.SimpleDustWasher_EV.get(1), GregtechItemList.SimpleDustWasher_LuV.get(1), GregtechItemList.SimpleDustWasher_UV.get(1)}; for (int i=0;i<4;i++) { - + CORE.RA.addSixSlotAssemblingRecipe( aInputsForSimpleWashers[aSlot], CI.getTieredFluid(aSimpleWasherTier, 144 * aSimpleWasherTier), aSimpleWashers[aSlot], 20 * 15 * aSimpleWasherTier, (int) GT_Values.V[aSimpleWasherTier]); - + aSimpleWasherTier += 2; aSlot++; } - - - - - - + + + + + + } if (CORE.ConfigSwitches.enableMachine_Pollution && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - + RecipeUtils.addShapedGregtechRecipe( "plateCarbon", "plateCarbon", "plateCarbon", "dustCarbon", "dustCarbon", "dustCarbon", @@ -1164,7 +1170,7 @@ public class RECIPES_Machines { RECIPE_CyclotronController = GregtechItemList.COMET_Cyclotron.get(1); RECIPE_CyclotronOuterCasing = GregtechItemList.Casing_Cyclotron_External.get(Casing_Amount); RECIPE_CyclotronInnerCoil = GregtechItemList.Casing_Cyclotron_Coil.get(1); - + //Outer Casing CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { @@ -1179,8 +1185,8 @@ public class RECIPES_Machines { RECIPE_CyclotronOuterCasing, 30 * 20 * 2, MaterialUtils.getVoltageForTier(4)); - - + + //Inner Coil CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { @@ -1995,7 +2001,7 @@ public class RECIPES_Machines { } } - + private static void largeArcFurnace() { int aCostMultiplier = GTNH ? 2 : 1; CORE.RA.addSixSlotAssemblingRecipe( @@ -2025,10 +2031,10 @@ public class RECIPES_Machines { 60 * 20 * 8, MaterialUtils.getVoltageForTier(6)); } - + private static void industrialVacuumFurnace() { int aCostMultiplier = GTNH ? 2 : 1; - + CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { CI.getTieredMachineHull(-1, 1 * aCostMultiplier), @@ -2041,9 +2047,9 @@ public class RECIPES_Machines { GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount), 20 * 10 * 6, MaterialUtils.getVoltageForTier(6)); - + ; - + CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount), @@ -2058,113 +2064,191 @@ public class RECIPES_Machines { 60 * 20 * 12, MaterialUtils.getVoltageForTier(7)); } - + private static void fakeMachineCasingCovers() { - GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { - GregtechItemList.FakeMachineCasingPlate_ULV, - GregtechItemList.FakeMachineCasingPlate_LV, - GregtechItemList.FakeMachineCasingPlate_MV, - GregtechItemList.FakeMachineCasingPlate_HV, - GregtechItemList.FakeMachineCasingPlate_EV, - GregtechItemList.FakeMachineCasingPlate_IV, - GregtechItemList.FakeMachineCasingPlate_LuV, - GregtechItemList.FakeMachineCasingPlate_ZPM, - GregtechItemList.FakeMachineCasingPlate_UV, - GregtechItemList.FakeMachineCasingPlate_MAX, - }; - for (int i = 0;i<10;i++) { - GT_Values.RA.addCutterRecipe( - CI.getTieredMachineCasing(i), - mMachineCasingCovers[i].get(5), - null, - 20 * 5 * i, - (int) GT_Values.V[i]); - } + GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { + GregtechItemList.FakeMachineCasingPlate_ULV, + GregtechItemList.FakeMachineCasingPlate_LV, + GregtechItemList.FakeMachineCasingPlate_MV, + GregtechItemList.FakeMachineCasingPlate_HV, + GregtechItemList.FakeMachineCasingPlate_EV, + GregtechItemList.FakeMachineCasingPlate_IV, + GregtechItemList.FakeMachineCasingPlate_LuV, + GregtechItemList.FakeMachineCasingPlate_ZPM, + GregtechItemList.FakeMachineCasingPlate_UV, + GregtechItemList.FakeMachineCasingPlate_MAX, + }; + int aMaxTier = GT_Values.VOLTAGE_NAMES.length; + if (!GTNH) { + aMaxTier = 10; + } + ItemStack aTier[] = new ItemStack[aMaxTier]; + for (int i=0;i Short.MAX_VALUE) { + meta = 0; + } + if (size < 0 || size > 64) { + size = 1; + } + Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta); + final ItemStack metaStack = new ItemStack(item, size, meta); + return metaStack; } public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) { @@ -305,9 +298,9 @@ public class ItemUtils { else { mTemp = Utils.sanitizeString(mTemp); } - - - + + + if (oredictName.contains("rod")) { String s = "stick"+oredictName.substring(3); oredictName = s; @@ -374,7 +367,7 @@ public class ItemUtils { return returnValue.copy(); } } - + Logger.RECIPE(oredictName + " was not valid."); return null; } catch (final Throwable t) { @@ -405,7 +398,7 @@ public class ItemUtils { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, mChemForm, Colour, "Dust"), new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, mChemForm, Colour, "Small"), new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, mChemForm, Colour, "Tiny") }; - + //Generate Shaped/Shapeless Recipes final ItemStack normalDust = ItemUtils.getSimpleStack(output[0]); @@ -459,7 +452,7 @@ public class ItemUtils { Logger.WARNING("4 Small dust from 1 Dust Recipe: "+materialName+" - Failed"); } } - + return output; } @@ -489,7 +482,7 @@ public class ItemUtils { public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust) { return generateSpecialUseDusts(material, onlyLargeDust, false); } - + public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust, final boolean disableExtraRecipes) { final String materialName = material.getLocalizedName(); final String unlocalizedName = Utils.sanitizeString(materialName); @@ -697,19 +690,19 @@ public class ItemUtils { public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) { final String[] itemNames = aStack == null ? new String[] {} : new String[aStack.length]; Logger.INFO(""+aStack.length); - + if (aStack == null || aStack.length < 1) { return itemNames; } - + int arpos = 0; for (final ItemStack alph : aStack) { if (alph == null) { continue; } try { - itemNames[arpos] = alph.getDisplayName(); - arpos++; + itemNames[arpos] = alph.getDisplayName(); + arpos++; } catch (Throwable t) { t.printStackTrace(); @@ -1001,15 +994,15 @@ public class ItemUtils { return true; } - - + + public static IInventory organiseInventory(IInventory aInputInventory) { ItemStack[] p = new ItemStack[aInputInventory.getSizeInventory()]; for (int o = 0; o < aInputInventory.getSizeInventory(); o++) { p[o] = aInputInventory.getStackInSlot(o); } //ItemStack[] g = organiseInventory(p); - + IInventory aTemp = aInputInventory; for (int i = 0; i < p.length; ++i) { for (int j = i + 1; j < p.length; ++j) { @@ -1019,22 +1012,22 @@ public class ItemUtils { } } } - + /* for (int o = 0; o < aInputInventory.getSizeInventory(); o++) { aTemp.setInventorySlotContents(o, g[o]); }*/ return aTemp; } - - + + public static ItemStack[] organiseInventory(ItemStack[] aInputs) { //Update Slots int aInvSize = aInputs.length; ItemStack[] newArray = new ItemStack[aInvSize]; - - + + //Try merge stacks for (int i = 0; i < aInvSize; i++) { for (int i2 = 0; i2 < aInvSize; i2++) { @@ -1048,29 +1041,29 @@ public class ItemUtils { } //Try Merge else { - + if (GT_Utility.areStacksEqual(t1[0], t1[1])) { - while ((t1[0].stackSize < 64 && t1[1].stackSize > 0)) { - t1[0].stackSize++; - t1[1].stackSize--; - if (t1[1].stackSize <= 0) { - t1[1] = null; - break; - } - if (t1[0].stackSize == 64) { - break; - } - } - newArray[i] = t1[1]; - newArray[i2] = t1[0]; + while ((t1[0].stackSize < 64 && t1[1].stackSize > 0)) { + t1[0].stackSize++; + t1[1].stackSize--; + if (t1[1].stackSize <= 0) { + t1[1] = null; + break; + } + if (t1[0].stackSize == 64) { + break; + } + } + newArray[i] = t1[1]; + newArray[i2] = t1[0]; } } } } } - + ItemStack[] newArray2 = new ItemStack[aInvSize]; - + //Move nulls to end int count2 = 0; for (int i = 0; i < aInvSize; i++) @@ -1078,10 +1071,10 @@ public class ItemUtils { newArray2[count2++] = newArray[i]; while (count2 < aInvSize) newArray2[count2++] = null; - + return newArray2; - + } public static String getItemName(ItemStack aStack) { @@ -1092,7 +1085,7 @@ public class ItemUtils { try { aDisplay = ("" + StatCollector .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name")) - .trim(); + .trim(); if (aStack.hasTagCompound()) { if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) { NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display"); @@ -1120,7 +1113,7 @@ public class ItemUtils { String aDisplay = null; try { aDisplay = (aStack.getUnlocalizedName()).trim(); - + } catch (Throwable t) { aDisplay = aStack.getItem().getUnlocalizedName(); } @@ -1129,7 +1122,7 @@ public class ItemUtils { } return aDisplay; } - + public static boolean isItemGregtechTool(ItemStack aStack) { if (aStack == null) { return false; @@ -1142,49 +1135,49 @@ public class ItemUtils { } return false; } - + public static boolean isToolWrench(ItemStack aWrench) { if (isItemGregtechTool(aWrench) && (aWrench.getItemDamage() == 16 || aWrench.getItemDamage() == 120 || aWrench.getItemDamage() == 122 || aWrench.getItemDamage() == 124 || aWrench.getItemDamage() == 7734)) { return true; } return false; } - + public static boolean isToolMallet(ItemStack aMallet) { if (isItemGregtechTool(aMallet) && (aMallet.getItemDamage() == 14)) { return true; } return false; } - + public static boolean isToolScrewdriver(ItemStack aScrewdriver) { if (isItemGregtechTool(aScrewdriver) && (aScrewdriver.getItemDamage() == 22 || aScrewdriver.getItemDamage() == 150)) { return true; } return false; } - + public static boolean isToolCrowbar(ItemStack aCrowbar) { if (isItemGregtechTool(aCrowbar) && (aCrowbar.getItemDamage() == 20)) { return true; } return false; } - + public static boolean isToolWirecutters(ItemStack aWirecutters) { if (isItemGregtechTool(aWirecutters) && (aWirecutters.getItemDamage() == 26)) { return true; } return false; } - + public static boolean isToolHammer(ItemStack aHammer) { if (isItemGregtechTool(aHammer) && (aHammer.getItemDamage() == 12 || aHammer.getItemDamage() == 7734)) { return true; } return false; } - + public static boolean isToolSolderingIron(ItemStack aSoldering) { if (isItemGregtechTool(aSoldering) && (aSoldering.getItemDamage() == 160)) { return true; @@ -1213,7 +1206,7 @@ public class ItemUtils { public static ItemStack getEnchantedBook(Enchantment aEnch, int aLevel) { return enchantItem(new ItemStack(Items.enchanted_book), aEnch, aLevel); } - + public static ItemStack enchantItem(ItemStack aStack, Enchantment aEnch, int aLevel) { Items.enchanted_book.addEnchantment(aStack, new EnchantmentData(aEnch, aLevel)); return aStack; @@ -1226,16 +1219,16 @@ public class ItemUtils { public static void hideItemFromNEI(ItemStack aItemToHide) { codechicken.nei.api.API.hideItem(aItemToHide); } - + public static ItemStack getNullStack() { return GT_Values.NI; } - + public static ItemStack depleteStack(ItemStack aStack) { return depleteStack(aStack, 1); } - + public static ItemStack depleteStack(ItemStack aStack, int aAmount) { final int cap = aStack.stackSize; if (cap > 1 && cap > aAmount) { diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java new file mode 100644 index 0000000000..6b7f24ed37 --- /dev/null +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -0,0 +1,113 @@ +package gtPlusPlus.nei; + +import java.awt.Rectangle; +import java.util.Collection; +import java.util.List; + +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; +import crazypants.enderio.gui.IconEIO; +import crazypants.enderio.machine.enchanter.GuiEnchanter; +import gtPlusPlus.core.handler.Recipes.DecayableRecipe; +import gtPlusPlus.core.item.materials.DustDecayable; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +public class DecayableRecipeHandler extends TemplateRecipeHandler { + + public String getRecipeName() { + return StatCollector.translateToLocal("gtpp.nei.decayables"); + } + + public String getGuiTexture() { + return "enderio:textures/gui/enchanter.png"; + } + + public Class getGuiClass() { + return GuiEnchanter.class; + } + + public String getOverlayIdentifier() { + return "GTPP_Decayables"; + } + + public void loadTransferRects() { + this.transferRects.add(new RecipeTransferRect(new Rectangle(149, -3, 16, 16), "GTPP_Decayables", new Object[0])); + } + + public void loadCraftingRecipes(ItemStack result) { + if (result == null || !DustDecayable.class.isInstance(result.getItem())) { + return; + } + final List recipes = DecayableRecipe.mRecipes; + for (final DecayableRecipe recipe : recipes) { + if (recipe.isValid()) { + final ItemStack input = recipe.mInput.copy(); + final ItemStack output = recipe.mOutput.copy(); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + this.arecipes.add(rec); + } + } + } + + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOverlayIdentifier()) && this.getClass() == DecayableRecipeHandler.class) { + final List recipes = DecayableRecipe.mRecipes; + for (final DecayableRecipe recipe : recipes) { + if (recipe.isValid()) { + final ItemStack input = recipe.mInput.copy(); + final ItemStack output = recipe.mOutput.copy(); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + this.arecipes.add(rec); + } + } + } + else { + super.loadCraftingRecipes(outputId, results); + } + } + + public void loadUsageRecipes(ItemStack ingredient) { + final List recipes = DecayableRecipe.mRecipes; + for (final DecayableRecipe recipe : recipes) { + if (recipe.isValid()) { + final ItemStack input = recipe.mInput.copy(); + final ItemStack output = recipe.mOutput.copy(); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + if (!rec.contains((Collection)rec.input, ingredient)) { + continue; + } + rec.setIngredientPermutation((Collection) rec.input, ingredient); + this.arecipes.add(rec); + } + }} + + public void drawExtras(int recipeIndex) { + DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex); + //GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, 8421504, false); + /* + * int cost = TileEnchanter.getEnchantmentCost(recipe.recipe, 1); if (cost > 0) + * { String s = I18n.format("container.repair.cost", new Object[]{cost}); + * GuiDraw.drawStringC(s, 83, 46, 8453920); } + */ + + IconEIO.RECIPE_BUTTON.renderIcon(149.0D, -3.0D, 16.0D, 16.0D, 0.0D, true); + } + + public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe + { + private PositionedStack input; + private PositionedStack output; + + public PositionedStack getResult() { + return this.output; + } + + public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) { + super(); + this.input = new PositionedStack(input, 22, 24); + this.output = new PositionedStack(result, 129, 24); + } + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index aca6dd5662..ab949bd517 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -1,10 +1,10 @@ package gtPlusPlus.nei; +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; import gregtech.api.util.CustomRecipeMap; import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; -import codechicken.nei.api.IConfigureNEI; - public class NEI_GT_Config implements IConfigureNEI { public static boolean sIsAdded = true; @@ -23,6 +23,8 @@ implements IConfigureNEI { } } sIsAdded = true; + API.registerRecipeHandler(new DecayableRecipeHandler()); + API.registerUsageHandler(new DecayableRecipeHandler()); } @Override diff --git a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java index c29d8423d8..baf62bf64d 100644 --- a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java +++ b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java @@ -20,6 +20,8 @@ public class AsmConfig { public static boolean enableGcFuelChanges; public static boolean enableRcFlowFix; public static boolean enableTcAspectSafety; + + public static boolean disableAllLogging; public AsmConfig(File file) { if (!loaded) { @@ -40,7 +42,13 @@ public class AsmConfig { Property prop; - //Debug + //Debug + prop = config.get("debug", "disableAllLogging", false); + prop.comment = "Disables ALL logging from GT++."; + prop.setLanguageKey("gtpp.disableAllLogging").setRequiresMcRestart(false); + disableAllLogging = prop.getBoolean(false); + propOrderDebug.add(prop.getName()); + prop = config.get("debug", "enableChunkDebugging", false); prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server."; prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index 7e5b07916e..561da54ceb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -4,11 +4,12 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_CoverBehavior; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -17,9 +18,11 @@ import net.minecraftforge.fluids.Fluid; public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { - private static final Map sConnectionStateForEntityMap = new ConcurrentHashMap(); + private static final Map sConnectionStateForEntityMap = new ConcurrentHashMap(); private static final Map sPrefixMap = new ConcurrentHashMap(); - + private static final int VALUE_OFF = 0; + private static final int VALUE_ON = 1; + public static String generateUniqueKey(byte aSide, ICoverable aEntity) { try { BlockPos aPos = new BlockPos(aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord())); @@ -33,7 +36,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { + PlayerUtils.messagePlayer(aPlayer, this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } @@ -43,31 +47,31 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return this.trans("756", "Connectable: ") + getConnectionState(aSide, aTileEntity); + return this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable); } public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -76,18 +80,34 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { + try { + String aKey = generateUniqueKey(aSide, aTileEntity); + Integer b = sConnectionStateForEntityMap.get(aKey); + //Logger.INFO("Val: "+aCoverVariable); + if (b != null && aCoverVariable != b) { + aCoverVariable = b; + } + if (b == null) { + b = aCoverVariable; + sConnectionStateForEntityMap.put(aKey, b); + trySetState(aSide, b == VALUE_ON ? VALUE_ON : VALUE_OFF, aTileEntity); + } + } + catch (Throwable t) { + + } return aCoverVariable; } @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return getConnectionState(aSide, aTileEntity); + return getConnectionState(aCoverVariable); } @Override @@ -98,7 +118,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @Override public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - if (!getConnectionState(aSide, aTileEntity)) { + if (!getConnectionState(aCoverVariable)) { return 0; } return super.getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity); @@ -109,8 +129,11 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { String aKey = generateUniqueKey(aSide, aTileEntity); boolean state = getCoverConnections(aCover); sPrefixMap.put(aKey, aCover.getUnlocalizedName()); - //Logger.INFO("Mapping key "+aKey+" to "+state); - sConnectionStateForEntityMap.put(aKey, state); + Logger.INFO("Mapping key "+aKey+" to "+state); + sConnectionStateForEntityMap.put(aKey, state ? VALUE_ON : VALUE_OFF); + Logger.INFO("Key Value: "+(state ? VALUE_ON : VALUE_OFF)); + //Try set cover state directly + //trySetState(aSide, state ? VALUE_ON : VALUE_OFF, aTileEntity); super.placeCover(aSide, aCover, aTileEntity); } @@ -122,14 +145,33 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { //Logger.INFO("Unmapping key "+aKey+"."); return true; } - + + public static boolean getConnectionState(int aCoverVar) { + return aCoverVar == VALUE_ON; + } + + private static final void trySetState(byte aSide, int aState, ICoverable aTile) { + //Try set cover state directly + if (aTile instanceof IGregTechTileEntity) { + IGregTechTileEntity gTileEntity = (IGregTechTileEntity) aTile; + if (gTileEntity != null) { + gTileEntity.setCoverDataAtSide(aSide, aState); + } + } + } + + public static boolean getConnectionState(byte aSide, ICoverable aTile) { String aKey = generateUniqueKey(aSide, aTile); - boolean b = sConnectionStateForEntityMap.get(aKey); - //Logger.INFO("Get State: "+b+" | "+aKey); - return b; + return getConnectionState(aKey); } + public static boolean getConnectionState(String aKey) { + Integer b = sConnectionStateForEntityMap.get(aKey); + //Logger.INFO("Get State: "+b+" | "+aKey); + return b != null ? b == VALUE_ON : false; + } + public static final boolean getCoverConnections(final ItemStack aStack) { NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index cf25dad8a9..3aefd6dee2 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -2957,5 +2957,15 @@ item.GTPP.bauble.fireprotection.0.name=Supreme Pizza Gloves item.itemCellSeleniumDioxide.name=Selenium Dioxide Cell item.itemCellSeleniousAcid.name=Selenious Acid Cell -//Added 25/8/19 +//Added 25/7/19 container.pestkiller=Pest Killer + +//Added 15/8/19 +gtpp.nei.decayables=Decayables Chest +entity.batKing.name=Bat King +item.itemCellCarbyne.name=Carbyne Cell +item.itemCellHydrogenCyanide.name=Cell of Hydrogen Cyanide +item.itemCactusCharcoal.name=Cactus Charcoal +item.itemCactusCoke.name=Cactus Coke +item.itemSugarCharcoal.name=Sugar Charcoal +item.itemSugarCoke.name=Sugar Coke \ No newline at end of file -- cgit From 14a6ba866e1d2197d08b007011dc371f1b839552 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 17 Aug 2019 14:23:39 +0100 Subject: + Added new casing textures for the Large Rocket Engine. --- .../gregtech/common/blocks/GregtechMetaCasingBlocks4.java | 2 +- .../gregtech/common/blocks/textures/TexturesGtBlock.java | 2 ++ .../GregtechMetaTileEntity_LargeRocketEngine.java | 5 +++-- .../blocks/TileEntities/MACHINE_CASING_ROCKETDYNE.png | Bin 0 -> 643 bytes 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_CASING_ROCKETDYNE.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 40ab5bc2ef..321ab43134 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -122,7 +122,7 @@ extends GregtechMetaCasingBlocksAbstract { //Multitank Exterior Casing case 11: - return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); + return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon(); //Reactor Casing I case 12: return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index aed50ebae8..09f3f2d1f5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -279,6 +279,8 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON"); public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); + public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index 76f1c3243d..ab5cbd84d2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -5,6 +5,7 @@ import java.util.Collection; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -42,7 +43,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public static String mGearboxName = "Inconel Reinforced Casing"; - private final static int CASING_ID = 50; + private final static int CASING_ID = TAE.getIndexFromPage(3, 11); public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -226,7 +227,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } public byte getCasingTextureIndex() { - return CASING_ID; + return (byte) CASING_ID; } @Override diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_CASING_ROCKETDYNE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_CASING_ROCKETDYNE.png new file mode 100644 index 0000000000..89fed025b4 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/MACHINE_CASING_ROCKETDYNE.png differ -- cgit From 828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 17 Aug 2019 19:11:38 +0100 Subject: + Added Air consumption to the LRE. % Made the LRE longer. (10, up from 4) % Greatly improved NEI handling for decayables. $ Improved logic of LRE. $ Fixed NEI crash. $ Fixed bug in underlying GT code causing depleteInput to return false wrongly. --- .../core/item/chemistry/RocketFuels.java | 177 +++--- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 151 ++++- .../gtPlusPlus/nei/handlers/NeiTextureHandler.java | 85 +++ .../base/GregtechMeta_MultiBlockBase.java | 72 ++- .../GregtechMetaTileEntity_Cyclotron.java | 1 + .../GregtechMetaTileEntity_LargeRocketEngine.java | 684 +++++++++++++-------- .../gregtech/GregtechRocketFuelGenerator.java | 2 +- src/resources/assets/gregtech/lang/en_US.lang | 59 +- src/resources/assets/miscutils/lang/en_US.lang | 3 +- .../miscutils/textures/gui/nei/decayables.png | Bin 0 -> 2623 bytes .../assets/miscutils/textures/gui/nei/widgets.png | Bin 0 -> 1876 bytes 11 files changed, 852 insertions(+), 382 deletions(-) create mode 100644 src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java create mode 100644 src/resources/assets/miscutils/textures/gui/nei/decayables.png create mode 100644 src/resources/assets/miscutils/textures/gui/nei/widgets.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 7ade6d0371..c02e767dcd 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -25,7 +25,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class RocketFuels extends ItemPackage { - + public static HashSet mValidRocketFuelNames = new HashSet(); public static HashMap mValidRocketFuels = new HashMap(); @@ -52,16 +52,16 @@ public class RocketFuels extends ItemPackage { public static Item Ammonium_Nitrate_Dust; public static Item Formaldehyde_Catalyst; - + public static void createKerosene(){ - - - + + + FluidStack fuelA = FluidUtils.getFluidStack("diesel", 300); FluidStack fuelB = FluidUtils.getFluidStack("fuel", 300); - - - + + + if (fuelA != null){ //GT_Values.RA.addDistilleryRecipe(23, fuelA, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false); GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(Kerosene, 100), 200, 64, false); @@ -135,7 +135,11 @@ public class RocketFuels extends ItemPackage { private static void createLOX() { GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidOxygen", 1), 20*16); CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("oxygen", 3000)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Oxygen, 3000)}, new ItemStack[] {}, new int[] {}, 20*16, 240, 0); + } + private static void createLOH() { + GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidhydrogen", 1), 20*16); + CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0); } private static void createHydratedAmmoniumNitrateSlurry() { @@ -214,7 +218,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 256)); //Fuel Value - + mRocketFuels.put(1, new Recipe_GT( true, new ItemStack[] {}, @@ -226,7 +230,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 512)); //Fuel Value - + mRocketFuels.put(2, new Recipe_GT( true, new ItemStack[] {}, @@ -238,7 +242,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 768)); //Fuel Value - + mRocketFuels.put(3, new Recipe_GT( true, new ItemStack[] {}, @@ -250,8 +254,8 @@ public class RocketFuels extends ItemPackage { 0, 0, 1024)); //Fuel Value - - + + //Add in default Diesel for the Buggy mValidRocketFuels.put(-1, Diesel); @@ -349,7 +353,7 @@ public class RocketFuels extends ItemPackage { 20*48, 480); } - + GT_Values.RA.addCentrifugeRecipe( CI.getNumberedCircuit(23), @@ -430,6 +434,7 @@ public class RocketFuels extends ItemPackage { if (!CORE.GTNH) { createLOX(); } + createLOH(); createHydratedAmmoniumNitrateSlurry(); @@ -440,18 +445,18 @@ public class RocketFuels extends ItemPackage { createRocketFuels(); addRocketFuelsToMap(); - + return true; } @Override public boolean onLoadComplete(FMLLoadCompleteEvent event) { - + if (MathUtils.randInt(1, 2) > 0) { return false; } - + Materials aMaterial_Chloramine = MaterialUtils.getMaterial("Chloramine"); Materials aMaterial_Dimethylamine = MaterialUtils.getMaterial("Dimethylamine"); @@ -459,19 +464,19 @@ public class RocketFuels extends ItemPackage { Materials aMaterial_NitrogenDioxide = MaterialUtils.getMaterial("NitrogenDioxide"); Materials aMaterial_DinitrogenTetroxide = MaterialUtils.getMaterial("DinitrogenTetroxide"); Materials aMaterial_Dimethylhydrazine = MaterialUtils.getMaterial("Dimethylhydrazine"); - + Materials aMaterial_Oxygen = Materials.Oxygen; Materials aMaterial_Water = Materials.Water; Materials aMaterial_HypochlorousAcid = MaterialUtils.getMaterial("HypochlorousAcid"); Materials aMaterial_Ammonia = MaterialUtils.getMaterial("Ammonia"); Materials aMaterial_Methanol = MaterialUtils.getMaterial("Methanol"); - + if (aMaterial_Chloramine == null || aMaterial_Dimethylamine == null || aMaterial_DilutedHydrochloricAcid == null || aMaterial_Dimethylhydrazine == null || aMaterial_NitrogenDioxide == null || aMaterial_DinitrogenTetroxide == null || aMaterial_HypochlorousAcid == null || aMaterial_Ammonia == null || aMaterial_Methanol == null) { return false; } - + ItemStack aCellEmpty = CI.emptyCells(1); ItemStack aCellWater = aMaterial_Water.getCells(1); @@ -482,10 +487,10 @@ public class RocketFuels extends ItemPackage { ItemStack aCellNitrogenDioxide = aMaterial_NitrogenDioxide.getCells(1); ItemStack aCellDinitrogenTetroxide = aMaterial_DinitrogenTetroxide.getCells(1); ItemStack aCellDimethylhydrazine = aMaterial_Dimethylhydrazine.getCells(1); - - - - + + + + GT_Recipe aChemReactor_1 = new Recipe_GT( @@ -511,10 +516,10 @@ public class RocketFuels extends ItemPackage { 0, //Dura 0, //Eu 0); //Special - - - - + + + + GT_Recipe aChemReactor_Basic_1 = new Recipe_GT( true, //Optimise new ItemStack[] {}, //I @@ -562,18 +567,18 @@ public class RocketFuels extends ItemPackage { 0, //Dura 0, //Eu 0); //Special - - - - - - - - - - - - + + + + + + + + + + + + GT_Recipe aChemReactor_Adv_1 = new Recipe_GT( true, //Optimise @@ -599,26 +604,26 @@ public class RocketFuels extends ItemPackage { 0, //Eu 0); //Special - - + + //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); - - - - - - /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480); + + + + + + /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480); GT_Values.RA.addChemicalRecipe( Materials.Dimethylamine.getCells(5), GT_Utility.getIntegratedCircuit(1), Materials.Chloramine.getFluid(2000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(4), 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Chloramine.getCells(2), Materials.Empty.getCells(4), Materials.Dimethylamine.getGas(5000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Empty.getCells(1), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Chloramine.getCells(2), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), Materials.DilutedHydrochloricAcid.getCells(1), 960, 480); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(24)}, new FluidStack[]{Materials.HypochlorousAcid.getFluid(3000), Materials.Ammonia.getGas(8000), Materials.Methanol.getFluid(12000)}, new FluidStack[]{Materials.Dimethylhydrazine.getFluid(12000), Materials.DilutedHydrochloricAcid.getFluid(2000), Materials.Water.getFluid(9000)}, null, 1040, 480); - + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), GT_Values.NI, Materials.NitrogenDioxide.getGas(1000), Materials.DinitrogenTetroxide.getGas(1000), GT_Values.NI, 640); GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(2), GT_Values.NF, Materials.DinitrogenTetroxide.getGas(1000), Materials.Empty.getCells(1), 640); GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(12), GT_Values.NF, GT_Values.NF, Materials.DinitrogenTetroxide.getCells(1), 640); @@ -630,25 +635,25 @@ public class RocketFuels extends ItemPackage { GT_Values.RA.addMixerRecipe(Materials.Dimethylhydrazine.getCells(2), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Oxygen.getGas(1000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(2), 60, 16); GT_Values.RA.addMixerRecipe(Materials.Oxygen.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Dimethylhydrazine.getFluid(2000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(1), 60, 16); - - */ - - - - - - - - - + + */ + + + + + + + + + //Get Rocket Fuel - + //Find recipes using default values - + //Remove - + //Rebake map - + return true; }; @@ -663,16 +668,16 @@ public class RocketFuels extends ItemPackage { @Override public void fluids() { - + //Register default fluids Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid(); Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid(); - - + + //Create Kerosene Kerosene = FluidUtils.generateFluidNonMolten("Kerosene", "Kerosene", 500, new short[]{150, 40, 150, 100}, null, null); CoalTar.Coal_Oil = Kerosene; - + //RP! Focket Fuel RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null); @@ -698,7 +703,7 @@ public class RocketFuels extends ItemPackage { new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175}); } } - + //Unsymmetrical_Dimethylhydrazine if (FluidUtils.getFluidStack("1,1dimethylhydrazine", 1) == null){ Unsymmetrical_Dimethylhydrazine = FluidUtils.generateFluidNonMolten("UnsymmetricalDimethylhydrazine", "Unsymmetrical Dimethylhydrazine", -57, new short[]{70, 210, 20, 100}, null, null); @@ -728,31 +733,31 @@ public class RocketFuels extends ItemPackage { new BaseItemComponent("LiquidOxygen", "Liquid Oxygen", new short[] {10, 10, 175}); } } - + //Create Liquid_Hydrogen - if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){ - Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null); - } - else { - if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) { - Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid(); - } - else { - Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid(); - } - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){ - new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175}); - } - } + if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){ + Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null); + } + else { + if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) { + Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid(); + } + else { + Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid(); + } + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){ + new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175}); + } + } Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null); - + Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null); RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null); Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null); Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null); - + } diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index 6b7f24ed37..5144a56663 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -1,27 +1,33 @@ package gtPlusPlus.nei; import java.awt.Rectangle; -import java.util.Collection; import java.util.List; +import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -import crazypants.enderio.gui.IconEIO; import crazypants.enderio.machine.enchanter.GuiEnchanter; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.handler.Recipes.DecayableRecipe; import gtPlusPlus.core.item.materials.DustDecayable; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.VanillaColours; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.nei.handlers.NeiTextureHandler; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; public class DecayableRecipeHandler extends TemplateRecipeHandler { public String getRecipeName() { - return StatCollector.translateToLocal("gtpp.nei.decayables"); + return StatCollector.translateToLocal("GTPP.container.decaychest.name"); } public String getGuiTexture() { - return "enderio:textures/gui/enchanter.png"; + return CORE.MODID+":textures/gui/nei/decayables.png"; } public Class getGuiClass() { @@ -31,20 +37,31 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public String getOverlayIdentifier() { return "GTPP_Decayables"; } + + public int recipiesPerPage() { + return 1; + } public void loadTransferRects() { - this.transferRects.add(new RecipeTransferRect(new Rectangle(149, -3, 16, 16), "GTPP_Decayables", new Object[0])); + this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), "GTPP_Decayables", new Object[0])); } public void loadCraftingRecipes(ItemStack result) { if (result == null || !DustDecayable.class.isInstance(result.getItem())) { return; } + if (result != null) { + Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result)); + } final List recipes = DecayableRecipe.mRecipes; for (final DecayableRecipe recipe : recipes) { if (recipe.isValid()) { final ItemStack input = recipe.mInput.copy(); final ItemStack output = recipe.mOutput.copy(); + if (!GT_Utility.areStacksEqual(result, output, true)) { + continue; + } + Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result)); final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); this.arecipes.add(rec); } @@ -70,35 +87,128 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public void loadUsageRecipes(ItemStack ingredient) { final List recipes = DecayableRecipe.mRecipes; + if (ingredient != null) { + Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient)); + } for (final DecayableRecipe recipe : recipes) { if (recipe.isValid()) { final ItemStack input = recipe.mInput.copy(); final ItemStack output = recipe.mOutput.copy(); - final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); - if (!rec.contains((Collection)rec.input, ingredient)) { + if (!GT_Utility.areStacksEqual(ingredient, input, true)) { continue; - } - rec.setIngredientPermutation((Collection) rec.input, ingredient); + } + Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient)); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + //rec.setIngredientPermutation((Collection) rec.input, ingredient); this.arecipes.add(rec); } }} public void drawExtras(int recipeIndex) { DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex); - //GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, 8421504, false); - /* - * int cost = TileEnchanter.getEnchantmentCost(recipe.recipe, 1); if (cost > 0) - * { String s = I18n.format("container.repair.cost", new Object[]{cost}); - * GuiDraw.drawStringC(s, 83, 46, 8453920); } - */ - - IconEIO.RECIPE_BUTTON.renderIcon(149.0D, -3.0D, 16.0D, 16.0D, 0.0D, true); + + //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false); + + int cost = recipe.time; + if (cost > 0){ + + // NEI Strings + String s = I18n.format("GTPP.nei.info", new Object[]{cost}); + String s0 = I18n.format("GTPP.nei.timetaken", new Object[]{cost}); + + // Time Strings + String s1 = I18n.format("GTPP.time.ticks", new Object[]{cost}); + String s2 = I18n.format("GTPP.time.seconds", new Object[]{cost}); + String s3 = I18n.format("GTPP.time.minutes", new Object[]{cost}); + String s4 = I18n.format("GTPP.time.hours", new Object[]{cost}); + String s5 = I18n.format("GTPP.time.days", new Object[]{cost}); + String s6 = I18n.format("GTPP.time.months", new Object[]{cost}); + int y = 20; + + int secs = cost / 20; + int mins = secs / 60; + int hours = mins / 60; + int days = hours / 24; + int months = days / 30; + + + String suffix; + int formattedTime; + if (cost <= 20) { + suffix = s1; + formattedTime = cost; + } + else if (cost <= (20 * 60)) { + suffix = s2; + formattedTime = secs; + } + else if (cost <= (20 * 60 * 60)) { + suffix = s3; + formattedTime = mins; + } + else if (cost <= (20 * 60 * 60 * 24)) { + suffix = s4; + formattedTime = hours; + } + else if (cost < (20 * 60 * 60 * 24 * 30)) { + suffix = s5; + formattedTime = days; + } + else if (cost <= (20 * 60 * 60 * 24 * 30)) { + suffix = s6; + formattedTime = months; + } + else { + suffix = s1; + formattedTime = cost; + } + + + + int x = 5; + GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false); + + + + + + GuiDraw.drawString(suffix, x + 16, y+30, VanillaColours.DYE_BLACK.getAsInt(), false); + + //Values + GuiDraw.drawString((""+formattedTime), x, y+30, VanillaColours.DYE_GREEN.getAsInt(), false); + + + if (hours > 1) { + int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60))); + if (aLeftoverMinutes > 0) { + int secs2 = aLeftoverMinutes / 20; + int mins2 = secs2 / 60; + GuiDraw.drawString(s3, x + 16, y+42, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString((""+mins2), x, y+42, VanillaColours.DYE_GREEN.getAsInt(), false); + + } + + } + + + + + } + + NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true); } public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe { private PositionedStack input; - private PositionedStack output; + private PositionedStack output; + public int time; + + @Override + public PositionedStack getIngredient() { + return this.input; + } public PositionedStack getResult() { return this.output; @@ -106,8 +216,9 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) { super(); - this.input = new PositionedStack(input, 22, 24); - this.output = new PositionedStack(result, 129, 24); + this.input = new PositionedStack(input, 93, 24); + this.output = new PositionedStack(result, 142, 42); + this.time = time; } } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java new file mode 100644 index 0000000000..f433def57d --- /dev/null +++ b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java @@ -0,0 +1,85 @@ +package gtPlusPlus.nei.handlers; + +import crazypants.render.RenderUtil; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * Based on crazypants.enderio.gui.IconEIO + * @author Original EIO Author + * + */ +public final class NeiTextureHandler { + + public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16); + public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24); + + public final double minU; + public final double maxU; + public final double minV; + public final double maxV; + public final double width; + public final double height; + + public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID+":textures/gui/nei/widgets.png"); + + public NeiTextureHandler(int x, int y) { + this(x, y, 16, 16); + } + + public NeiTextureHandler(int x, int y, int width, int height) { + this((double) width, (double) height, (double) ((float) (0.00390625D * (double) x)), + (double) ((float) (0.00390625D * (double) (x + width))), (double) ((float) (0.00390625D * (double) y)), + (double) ((float) (0.00390625D * (double) (y + height)))); + } + + public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) { + this.width = width; + this.height = height; + this.minU = minU; + this.maxU = maxU; + this.minV = minV; + this.maxV = maxV; + } + + public void renderIcon(double x, double y) { + this.renderIcon(x, y, this.width, this.height, 0.0D, false); + } + + public void renderIcon(double x, double y, boolean doDraw) { + this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw); + } + + public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) { + this.renderIcon(x, y, width, height, zLevel, doDraw, false); + } + + public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw, + boolean flipY) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + if (doDraw) { + RenderUtil.bindTexture(TEXTURE); + tessellator.startDrawingQuads(); + } + + if (flipY) { + tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.minV); + tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.minV); + tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.maxV); + tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.maxV); + } else { + tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.maxV); + tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.maxV); + tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.minV); + tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.minV); + } + + if (doDraw) { + tessellator.draw(); + } + + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 31909b4018..cb091264dd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -53,6 +53,7 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery; @@ -98,6 +99,7 @@ GT_MetaTileEntity_MultiBlockBase { //Control Core Hatch public ArrayList mControlCoreBus = new ArrayList(); + public ArrayList mAirIntakes = new ArrayList(); public ArrayList mChargeHatches = new ArrayList(); public ArrayList mDischargeHatches = new ArrayList(); @@ -835,7 +837,7 @@ GT_MetaTileEntity_MultiBlockBase { log("GOOD RETURN - 1"); return true; -} + } @@ -932,10 +934,10 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - + long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - + log("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( @@ -943,12 +945,12 @@ GT_MetaTileEntity_MultiBlockBase { gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); - + //First we check whether or not we have an input cached for boosting. //If not, we set it to the current recipe. //If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if not, we boost a new recipe. boolean isRecipeInputTheSame = false; - + //No cached recipe inputs, assume first run. if (mInputVerificationForBoosting == null) { mInputVerificationForBoosting = tRecipe.mInputs; @@ -963,7 +965,7 @@ GT_MetaTileEntity_MultiBlockBase { isRecipeInputTheSame = false; } } - + //Inputs are the same, let's see if there's a boosted version. if (isRecipeInputTheSame) { //Yes, let's just set that as the recipe @@ -999,14 +1001,14 @@ GT_MetaTileEntity_MultiBlockBase { mHasBoostedCurrentRecipe = false; } } - + //Bad modify, let's just use the original recipe. if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) { tRecipe = aRecipe != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); } - + // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; @@ -1188,6 +1190,7 @@ GT_MetaTileEntity_MultiBlockBase { this.mChargeHatches.clear(); this.mDischargeHatches.clear(); this.mControlCoreBus.clear(); + this.mAirIntakes.clear(); this.mMultiDynamoHatches.clear(); } } @@ -1252,7 +1255,7 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack guiSlot = this.mInventory[1]; return guiSlot; } - + protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) { boolean result = false; if (this.mInventory[1] == null) { @@ -1263,11 +1266,11 @@ GT_MetaTileEntity_MultiBlockBase { } return result; } - + protected boolean clearGUIItemSlot() { return setGUIItemStack(null); } - + public ItemStack findItemInInventory(Item aSearchStack) { return findItemInInventory(aSearchStack, 0); @@ -1276,7 +1279,7 @@ GT_MetaTileEntity_MultiBlockBase { public ItemStack findItemInInventory(Item aSearchStack, int aMeta) { return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1)); } - + public ItemStack findItemInInventory(ItemStack aSearchStack) { if (aSearchStack != null && this.mInputBusses.size() > 0) { for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) { @@ -1365,14 +1368,14 @@ GT_MetaTileEntity_MultiBlockBase { if (aTileEntity == null) { return false; } - + //Check type /* * Class aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if * (!aHatchType.isInstance(aTileEntity)) { return false; } */ - - + + if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { @@ -1546,6 +1549,20 @@ GT_MetaTileEntity_MultiBlockBase { return addToMachineList(aTileEntity, aBaseCasingIndex); } + public boolean addAirIntakeToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { + this.mAirIntakes.add((GT_MetaTileEntity_Hatch_AirIntake)aMetaTileEntity); + } + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -2103,6 +2120,31 @@ GT_MetaTileEntity_MultiBlockBase { log("A3"); return false; } + + @Override + public boolean depleteInput(final FluidStack aLiquid) { + if (aLiquid == null) { + return false; + } + for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { + tHatch.mRecipeMap = this.getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) { + continue; + } + tLiquid = tHatch.drain(aLiquid.amount, false); + if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { + tLiquid = tHatch.drain(aLiquid.amount, true); + return tLiquid != null && tLiquid.amount >= aLiquid.amount; + } + continue; + } + } + return false; + } + + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index de5d731dd5..2c3bf29119 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -432,6 +432,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas mChargeHatches.clear(); mDischargeHatches.clear(); mControlCoreBus.clear(); + mAirIntakes.clear(); mMultiDynamoHatches.clear(); mMachine = aFormCheck; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index ab5cbd84d2..9b6da487e8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -5,23 +5,29 @@ import java.util.Collection; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -30,264 +36,448 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase { - protected int fuelConsumption; - protected int fuelValue; - protected int fuelRemaining; - protected boolean boostEu; + protected int fuelConsumption; + protected int fuelValue; + protected int fuelRemaining; + protected int freeFuelTicks = 0; + protected boolean boostEu; public static String mLubricantName = "Carbon Dioxide"; public static String mCoolantName = "Liquid Hydrogen"; - + public static String mCasingName = "Turbodyne Casing"; public static String mIntakeHatchName = "Tungstensteel Turbine Casing"; public static String mGearboxName = "Inconel Reinforced Casing"; - - private final static int CASING_ID = TAE.getIndexFromPage(3, 11); - - public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - this.fuelConsumption = 0; - this.fuelValue = 0; - this.fuelRemaining = 0; - this.boostEu = false; - } - - public GregtechMetaTileEntity_LargeRocketEngine(final String aName) { - super(aName); - this.fuelConsumption = 0; - this.fuelValue = 0; - this.fuelRemaining = 0; - this.boostEu = false; - } - - @Override - public String[] getTooltip() { - return new String[] { - "Controller Block for the Large Combustion Engine", - "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run.", - "Supply 40L of "+mCoolantName+" per second to boost output (optional).", - "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency", - "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency", - "Size(WxHxD): 3x3x4, Controller (front centered)", - "3x3x4 of Stable "+mCasingName+" (hollow, Min 16!)", - "2x "+mGearboxName+" inside the Hollow Casing", - "8x "+mIntakeHatchName+" (around controller)", - ""+mIntakeHatchName+" must not be obstructed in front (only air blocks)", - "2x Input Hatch (Fuel/Lubricant) (one of the Casings next to a Gear Box)", - "1x Maintenance Hatch (one of the Casings next to a Gear Box)", - "1x Muffler Hatch (top middle back, next to the rear Gear Box)", - "1x Dynamo Hatch (back centered)", - }; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE) }; - } - return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID] }; - } - - @Override - public boolean isCorrectMachinePart(final ItemStack aStack) { - return this.getMaxEfficiency(aStack) > 0; - } - - @Override - public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LargeDieselEngine.png"); - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - final ArrayList tFluids = this.getStoredFluids(); - final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; - if (tFluids.size() > 0 && tRecipeList != null) { - for (final FluidStack hatchFluid1 : tFluids) { - for (final GT_Recipe aFuel : tRecipeList) { - final FluidStack tLiquid; - if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null && hatchFluid1.isFluidEqual(tLiquid)) { - final FluidStack fluidStack = tLiquid; - final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue)); - fluidStack.amount = n; - this.fuelConsumption = n; - if (!this.depleteInput(tLiquid)) { - continue; - } - this.boostEu = this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2)); - if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1))) { - if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { - this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)); - } - this.fuelValue = aFuel.mSpecialValue; - this.fuelRemaining = hatchFluid1.amount; - this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]); - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 5; - return true; - } - return false; - } - } - } - } - this.mEUt = 0; - this.mEfficiency = 0; - return false; - } - - @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - byte tSide = getBaseMetaTileEntity().getBackFacing(); - int tX = getBaseMetaTileEntity().getXCoord(); - int tY = getBaseMetaTileEntity().getYCoord(); - int tZ = getBaseMetaTileEntity().getZCoord(); - - if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 1) != getGearboxBlock() && getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 2) != getGearboxBlock()) { - return false; - } - if(getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 1) != getGearboxMeta() && getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 2) != getGearboxMeta()) { - return false; - } - for (byte i = -1; i < 2; i = (byte) (i + 1)) { - for (byte j = -1; j < 2; j = (byte) (j + 1)) { - if ((i != 0) || (j != 0)) { - for (byte k = 0; k < 4; k = (byte) (k + 1)) { - - final int fX = tX - (tSide == 5 ? 1 : tSide == 4 ? -1 : i), - fZ = tZ - (tSide == 2 ? -1 : tSide == 3 ? 1 : i), - aY = tY + j, - aX = tX + (tSide == 5 ? k : tSide == 4 ? -k : i), - aZ = tZ + (tSide == 2 ? -k : tSide == 3 ? k : i); - - final Block frontAir = getBaseMetaTileEntity().getBlock(fX, aY, fZ); - final String frontAirName = frontAir.getUnlocalizedName(); - if(!(getBaseMetaTileEntity().getAir(fX, aY, fZ) || frontAirName.equalsIgnoreCase("tile.air") || frontAirName.equalsIgnoreCase("tile.railcraft.residual.heat"))) { - return false; //Fail if vent blocks are obstructed - } - - if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) { - if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else if (!addMufflerToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? 2 : tSide == 4 ? -2 : 0), tY + 1, tZ + (tSide == 3 ? 2 : tSide == 2 ? -2 : 0)), getCasingTextureIndex())) { - return false; //Fail if no muffler top middle back - } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { - return false; - } - } else if (k == 0) { - if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getIntakeBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getIntakeMeta())) { - return false; - } - } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else { - return false; - } - } - } - } - } - this.mDynamoHatches.clear(); - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3); - if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { - if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) { - this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity()); - ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).updateTexture(getCasingTextureIndex()); - } else { - return false; - } - } - return true; - } - - public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; - } - - public byte getCasingMeta() { - return 11; - } - - public Block getIntakeBlock() { - return GregTech_API.sBlockCasings4; - } - - public byte getIntakeMeta() { - return 12; - } - - public Block getGearboxBlock() { - return ModBlocks.blockCasings3Misc; - } - - public byte getGearboxMeta() { - return 1; - } - - public byte getCasingTextureIndex() { - return (byte) CASING_ID; - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_LargeRocketEngine(this.mName); - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - } - - @Override - public int getDamageToComponent(final ItemStack aStack) { - return 1; - } - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return this.boostEu ? 30000 : 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return this.boostEu ? 150 : 75; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return true; - } - - @Override - public String[] getExtraInfoData() { - return new String[] { - "Rocket Engine", - "Current Pollution: " + getPollutionPerTick(null), - "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + this.fuelConsumption + "L/t", - "Fuel Value: " + this.fuelValue + " EU/L", - "Fuel Remaining: " + this.fuelRemaining + " Litres", - "Current Efficiency: " + this.mEfficiency / 100 + "%", - (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; - } - - @Override - public boolean isGivingInformation() { - return true; - } + + private final static int CASING_ID = TAE.getIndexFromPage(3, 11); + + public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + this.fuelConsumption = 0; + this.fuelValue = 0; + this.fuelRemaining = 0; + this.boostEu = false; + } + + public GregtechMetaTileEntity_LargeRocketEngine(final String aName) { + super(aName); + this.fuelConsumption = 0; + this.fuelValue = 0; + this.fuelRemaining = 0; + this.boostEu = false; + } + + @Override + public String[] getTooltip() { + if (mCasingName.toLowerCase().contains(".name")) { + mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); + } + if (mIntakeHatchName.toLowerCase().contains(".name")) { + mIntakeHatchName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); + } + if (mGearboxName.toLowerCase().contains(".name")) { + mGearboxName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 1); + } + if (mLubricantName.toLowerCase().contains(".")) { + mLubricantName = FluidUtils.getFluidStack("carbondioxide", 1).getLocalizedName(); + } + if (mCoolantName.toLowerCase().contains(".")) { + mCoolantName = FluidUtils.getFluidStack("liquidhydrogen", 1).getLocalizedName(); + } + return new String[] { + "Controller Block for the Large Combustion Engine", + "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run", + "Supply 40L of "+mCoolantName+" per second to boost output (optional)", + "Consumes upto 5000L of Air per second", + "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency", + "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency", + "Size(WxHxD): 3x3x10, Controller (front centered)", + "3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)", + "8x "+mGearboxName+" inside the Hollow Casing", + "1x Dynamo Hatch (Top Middle, Max 8)", + "8x Air Intake Hatch (one of the Casings next to a Gear Box, top row allowed)", + "2x Input Hatch (Rocket Fuel/Booster) (one of the Casings next to a Gear Box, top row not allowed)", + "1x Maintenance Hatch (one of the Casings next to a Gear Box)", + "1x Muffler Hatch (Back Centre)", + }; + } @Override - public boolean hasSlotInGUI() { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID] }; + } + + @Override + public boolean isCorrectMachinePart(final ItemStack aStack) { + return this.getMaxEfficiency(aStack) > 0; + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LargeDieselEngine.png"); + } + + public int getAir() { + if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) { + return 0; + } + else { + int totalAir = 0; + FluidStack airstack = FluidUtils.getFluidStack("air", 1); + for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { + if (u != null) { + FluidStack f = u.mFluid; + if (f.isFluidEqual(airstack)) { + totalAir += f.amount; + } + } + } + return totalAir; + } + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + final ArrayList tFluids = this.getStoredFluids(); + FluidStack air = FluidUtils.getFluidStack("air", 1); + + int aircount = getAir() ; + if (aircount < (boostEu ? 500 : 200)) { + Logger.INFO("Not Enough Air to Run "+aircount); + return false; + } + else { + boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, boostEu ? 500 : 200)); + if (!hasIntakeAir) { + Logger.INFO("Could not consume Air to run "+aircount); + return false; + } + } + Logger.INFO("Running "+aircount); + + final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; + if (tFluids.size() > 0 && tRecipeList != null) { + for (final FluidStack hatchFluid1 : tFluids) { + if (hatchFluid1.isFluidEqual(air)) { + continue; + } + for (final GT_Recipe aFuel : tRecipeList) { + final FluidStack tLiquid; + tLiquid = aFuel.mFluidInputs[0]; + if (hatchFluid1.isFluidEqual(tLiquid)) { + final FluidStack fluidStack = tLiquid; + Logger.INFO("Found valid thing"); + final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue)); + fluidStack.amount = n; + this.fuelConsumption = n; + + if (!consumeFuel(aFuel)) { + continue; + } + + Logger.INFO("Consumed some input fuel"); + this.boostEu = consumeLOH(); + Logger.INFO("Did we consume LOH? "+boostEu); + + if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { + Logger.INFO("Found CO2"); + if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { + if (!consumeCO2()) { + return false; + } + } + this.fuelValue = aFuel.mSpecialValue; + this.fuelRemaining = hatchFluid1.amount; + this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]); + this.mProgresstime = 1; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 5; + return true; + } + return false; + } + } + } + } + this.mEUt = 0; + this.mEfficiency = 0; return false; } + /** + * Consumes Fuel if required. Free Fuel Ticks are handled here. + * @param aFuel + * @return + */ + public boolean consumeFuel(GT_Recipe aFuel) { + if (freeFuelTicks > 0) { + freeFuelTicks--; + return true; + } + else { + freeFuelTicks = 0; + int value = aFuel.mSpecialValue * 3000; + value /= 1000; + FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], value); + if (!this.depleteInput(tLiquid)) { + return false; + } + else { + freeFuelTicks = value; + return true; + } + } + } + + public boolean consumeCO2() { + if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { + Logger.INFO("consumed some CO2"); + return true; + } + else { + Logger.INFO("No CO2 to consume"); + return false; + } + } + + public boolean consumeLOH() { + return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2)); + } + + @Override + public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + byte tSide = getBaseMetaTileEntity().getBackFacing(); + int tX = getBaseMetaTileEntity().getXCoord(); + int tY = getBaseMetaTileEntity().getYCoord(); + int tZ = getBaseMetaTileEntity().getZCoord(); + final int MAX_LENGTH = 8; + for (int length=0;length 0) && (aLength <= MAX_LENGTH))) { + Logger.INFO("Checking for Hatches. "+aLength); + //Top Row + if (j == 1) { + if (addDynamoToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } + else { + Logger.INFO("Top Row - "+aLength+" | Did not find casing or Dynamo"); + return false; + } + } + else { + IGregTechTileEntity aCheck = getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ); + if (aCheck != null) { + final IMetaTileEntity bCheck = aCheck.getMetaTileEntity(); + // Only allow Dynamos on Top + if (bCheck instanceof GT_MetaTileEntity_Hatch_Dynamo) { + Logger.INFO("Found dynamo in disallowed location | "+aX+", "+aY+", "+aZ+" | "+i+", "+j+", "+aLength); + return false; + } + } + if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addOutputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } + else {Logger.INFO("Bad block."); + return false; + } + + } + Logger.INFO("Passed check. "+aLength); + + } else if (aLength == 0) { + Logger.INFO("Searching for Gearbox"); + if (addMaintenanceToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta())) { + Logger.INFO("Bad Missing Casing || Bad Meta"); + return false; + } + else { + Logger.INFO("Found "+mCasingName+"."); + } + } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + Logger.INFO("Found Casing."); + // Do nothing + } else { + Logger.INFO("Bad XXX"); + return false; + } + } + } + } + } + + this.mMufflerHatches.clear(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), MAX_LENGTH+1); + if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { + if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Muffler)) { + this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) tTileEntity.getMetaTileEntity()); + this.updateTexture(tTileEntity, getCasingTextureIndex()); + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) { + Logger.INFO("Wrong count for Dynamos"); + return false; + } + if (this.mMufflerHatches.size() != 1 || this.mMufflerHatches.isEmpty()) { + Logger.INFO("Wrong count for Mufflers"); + return false; + } + if (this.mAirIntakes.size() < 8 || this.mAirIntakes.isEmpty()) { + Logger.INFO("Wrong count for Air Intakes | "+this.mAirIntakes.size()); + return false; + } + if (this.mMaintenanceHatches.size() < 1 || this.mMaintenanceHatches.isEmpty()) { + Logger.INFO("Wrong count for Maint. Hatches"); + return false; + } + + + Logger.INFO("Formed Rocket Engine."); + return true; + } + + public Block getCasingBlock() { + return ModBlocks.blockCasings4Misc; + } + + public byte getCasingMeta() { + return 11; + } + + public Block getIntakeBlock() { + return GregTech_API.sBlockCasings4; + } + + public byte getIntakeMeta() { + return 12; + } + + public Block getGearboxBlock() { + return ModBlocks.blockCasings3Misc; + } + + public byte getGearboxMeta() { + return 1; + } + + public byte getCasingTextureIndex() { + return (byte) CASING_ID; + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_LargeRocketEngine(this.mName); + } + + @Override + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setInteger("freeFuelTicks", freeFuelTicks); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(final NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + freeFuelTicks = aNBT.getInteger("freeFuelTicks"); + } + + @Override + public int getDamageToComponent(final ItemStack aStack) { + return 1; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return this.boostEu ? 30000 : 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return this.boostEu ? 150 : 75; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return true; + } + + @Override + public String[] getExtraInfoData() { + return new String[] { + "Rocket Engine", + "Current Air: "+getAir(), + "Current Pollution: " + getPollutionPerTick(null), + "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t", + "Fuel Consumption: " + this.fuelConsumption + "L/t", + "Fuel Value: " + this.fuelValue + " EU/L", + "Fuel Remaining: " + this.fuelRemaining + " Litres", + "Current Efficiency: " + this.mEfficiency / 100 + "%", + (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + @Override public String getCustomGUIResourceName() { return null; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java index 2c1507526d..b8dd8e4767 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java @@ -30,7 +30,7 @@ public class GregtechRocketFuelGenerator { private static void run1() { GregtechItemList.Controller_RocketEngine.set( - new GregtechMetaTileEntity_LargeRocketEngine(30410, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L)); + new GregtechMetaTileEntity_LargeRocketEngine(996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L)); GT_ModHandler.addCraftingRecipe( GregtechItemList.Controller_RocketEngine.get(1L), diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index caf4f636fb..c388f9785e 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -20,18 +20,6 @@ GTPP.CC.machinetier=Control Core Tier GTPP.CC.discount=EU Discount GTPP.CC.parallel=Maximum Parallel Processing - - -//Some Generic Words -GTPP.info.eu=EU -GTPP.info.euInfo=EU Information -GTPP.info.inputLimit=Input Limit -GTPP.info.currentPower=Current Power -GTPP.info.hidden=Hidden - - - - //Tooltips for the Charger Packs GTPP.battpack.tooltip.1=Worn as a Belt within Baubles GTPP.battpack.tooltip.2=Drains @@ -53,6 +41,53 @@ GTPP.monsterkiller.tooltip.2=Drains GTPP.monsterkiller.tooltip.3=per each kill GTPP.monsterkiller.tooltip.4=Target Type: +//17/08/19 +GTPP.container.decaychest.name=Decayables + + + + + + + + + + + + +//NEI INFORMATION +GTPP.nei.info=Information +GTPP.nei.eutick=Eu/t +GTPP.nei.timetaken=Time Taken +GTPP.nei.output=Output +GTPP.nei.input=Input +GTPP.nei.result=Result +GTPP.nei.radioation=Radiation Level + +//Some Generic Words +GTPP.info.eu=EU +GTPP.info.euInfo=EU Information +GTPP.info.inputLimit=Input Limit +GTPP.info.currentPower=Current Power +GTPP.info.hidden=Hidden + +//Some Time Words +GTPP.time.ticks=Ticks +GTPP.time.seconds=Seconds +GTPP.time.minutes=Minutes +GTPP.time.hours=Hours +GTPP.time.days=Days +GTPP.time.weeks=Weeks +GTPP.time.months=Months + + + + + + + + + diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 3aefd6dee2..bc4b170654 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -2968,4 +2968,5 @@ item.itemCellHydrogenCyanide.name=Cell of Hydrogen Cyanide item.itemCactusCharcoal.name=Cactus Charcoal item.itemCactusCoke.name=Cactus Coke item.itemSugarCharcoal.name=Sugar Charcoal -item.itemSugarCoke.name=Sugar Coke \ No newline at end of file +item.itemSugarCoke.name=Sugar Coke +item.LiquidHydrogen.name=Liquid Hydrogen Cell [LOH] \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/gui/nei/decayables.png b/src/resources/assets/miscutils/textures/gui/nei/decayables.png new file mode 100644 index 0000000000..d1827433a0 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/nei/decayables.png differ diff --git a/src/resources/assets/miscutils/textures/gui/nei/widgets.png b/src/resources/assets/miscutils/textures/gui/nei/widgets.png new file mode 100644 index 0000000000..0dc26c43e4 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/nei/widgets.png differ -- cgit From 259e6db3c913f2fbd2226102db12b7c4abb8f65c Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 19 Aug 2019 20:58:11 +0100 Subject: % Tweaked default Multiblock GUI for those without a slot. (Many will still be broken) $ Fixed weirdly encoded symbol within CONTAINER_Cyclotron.java, which didn't tend to play nice for some users. $ Fixed Cyclotron GUI bug. Closes #473 --- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 4 +- .../xmod/gregtech/api/gui/CONTAINER_Cyclotron.java | 231 ++------------------- .../gregtech/api/gui/CONTAINER_MultiMachine.java | 49 ++++- .../CONTAINER_MultiMachine_NoPlayerInventory.java | 27 +++ .../xmod/gregtech/api/gui/GUI_Cyclotron.java | 44 ++++ .../xmod/gregtech/api/gui/GUI_MultiMachine.java | 139 ++++++++++--- .../base/GregtechMeta_MultiBlockBase.java | 5 +- .../GregtechMetaTileEntity_Cyclotron.java | 10 +- .../gregtech/loaders/ProcessingAngelGrinder.java | 139 ------------- .../gregtech/loaders/ProcessingAngleGrinder.java | 139 +++++++++++++ .../assets/miscutils/textures/gui/Cyclotron.png | Bin 0 -> 2756 bytes .../textures/gui/MultiblockDisplay_Generic.png | Bin 0 -> 1743 bytes 12 files changed, 400 insertions(+), 387 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java delete mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java create mode 100644 src/resources/assets/miscutils/textures/gui/Cyclotron.png create mode 100644 src/resources/assets/miscutils/textures/gui/MultiblockDisplay_Generic.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 7acd76882e..0143c9096f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -40,7 +40,7 @@ import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; -import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngelGrinder; +import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngleGrinder; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricLighter; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; @@ -107,7 +107,7 @@ public class HANDLER_GT { if (CORE.ConfigSwitches.enableSkookumChoochers){ new ProcessingToolHeadChoocher().run(); } - new ProcessingAngelGrinder().run(); + new ProcessingAngleGrinder().run(); new ProcessingElectricSnips().run(); new ProcessingElectricButcherKnife().run(); new ProcessingElectricLighter().run(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java index 921871cebe..6d0eb6b14c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java @@ -1,232 +1,37 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_LanguageManager; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + *

+ * The Container I use for all my Basic Machines + */ public class CONTAINER_Cyclotron extends GT_ContainerMetaTile_Machine { - - public int mActive = 0; - public int mMaxProgressTime = 0; - public int mProgressTime = 0; - public long mEnergy = 0; - public int mSteam = 0; - public int mSteamStorage = 0; - public int mStorage = 0; - public int mOutput = 0; - public int mInput = 0; - public int mID = 0; - public int mDisplayErrorCode = 0; - private int oActive = 0; - private int oMaxProgressTime = 0; - private int oProgressTime = 0; - private long oEnergy = 0; - private int oSteam = 0; - private int oSteamStorage = 0; - private int oStorage = 0; - private int oOutput = 0; - private int oInput = 0; - private int oID = 0; - private int oDisplayErrorCode = 0; - private int mTimer = 0; - public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - this.mTileEntity = aTileEntity; - if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) { - this.addSlots(aInventoryPlayer); - if (this.doesBindPlayerInventory()) { - this.bindPlayerInventory(aInventoryPlayer); - } - - this.detectAndSendChanges(); - } else { - aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; - } + public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { - } - - public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - boolean doesBindInventory) { super(aInventoryPlayer, aTileEntity); - this.mTileEntity = aTileEntity; - if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) { - this.addSlots(aInventoryPlayer); - if (this.doesBindPlayerInventory() && doesBindInventory) { - this.bindPlayerInventory(aInventoryPlayer); - } - - this.detectAndSendChanges(); - } else { - aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; - } - } - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - this.mStorage = (int) Math.min(2147483647L, this.mTileEntity.getEUCapacity()); - this.mEnergy = this.mTileEntity.getStoredEU(); - this.mSteamStorage = (int) Math.min(2147483647L, this.mTileEntity.getSteamCapacity()); - this.mSteam = (int) Math.min(2147483647L, this.mTileEntity.getStoredSteam()); - this.mOutput = (int) Math.min(2147483647L, this.mTileEntity.getOutputVoltage()); - this.mInput = (int) Math.min(2147483647L, this.mTileEntity.getInputVoltage()); - this.mDisplayErrorCode = this.mTileEntity.getErrorDisplayID(); - this.mProgressTime = this.mTileEntity.getProgress(); - this.mMaxProgressTime = this.mTileEntity.getMaxProgress(); - this.mActive = this.mTileEntity.isActive() ? 1 : 0; - ++this.mTimer; - Iterator var2 = this.crafters.iterator(); - - while (true) { - ICrafting var1; - do { - if (!var2.hasNext()) { - this.oID = this.mID; - this.oSteam = this.mSteam; - this.oInput = this.mInput; - this.oActive = this.mActive; - this.oOutput = this.mOutput; - this.oEnergy = this.mEnergy; - this.oStorage = this.mStorage; - this.oSteamStorage = this.mSteamStorage; - this.oProgressTime = this.mProgressTime; - this.oMaxProgressTime = this.mMaxProgressTime; - this.oDisplayErrorCode = this.mDisplayErrorCode; - return; - } - - var1 = (ICrafting) var2.next(); - if (this.mTimer % 500 == 10 || this.oEnergy != this.mEnergy) { - - int uEnergy = (int) Math.min(2147483647L, this.mTileEntity.getStoredEU()); - - var1.sendProgressBarUpdate(this, 0, uEnergy & '￿'); - var1.sendProgressBarUpdate(this, 1, uEnergy >>> 16); - } - - if (this.mTimer % 500 == 10 || this.oStorage != this.mStorage) { - var1.sendProgressBarUpdate(this, 2, this.mStorage & '￿'); - var1.sendProgressBarUpdate(this, 3, this.mStorage >>> 16); - } - - if (this.mTimer % 500 == 10 || this.oOutput != this.mOutput) { - var1.sendProgressBarUpdate(this, 4, this.mOutput); - } - - if (this.mTimer % 500 == 10 || this.oInput != this.mInput) { - var1.sendProgressBarUpdate(this, 5, this.mInput); - } - - if (this.mTimer % 500 == 10 || this.oDisplayErrorCode != this.mDisplayErrorCode) { - var1.sendProgressBarUpdate(this, 6, this.mDisplayErrorCode); - } - - if (this.mTimer % 500 == 10 || this.oProgressTime != this.mProgressTime) { - var1.sendProgressBarUpdate(this, 11, this.mProgressTime & '￿'); - var1.sendProgressBarUpdate(this, 12, this.mProgressTime >>> 16); - } - - if (this.mTimer % 500 == 10 || this.oMaxProgressTime != this.mMaxProgressTime) { - var1.sendProgressBarUpdate(this, 13, this.mMaxProgressTime & '￿'); - var1.sendProgressBarUpdate(this, 14, this.mMaxProgressTime >>> 16); - } - - if (this.mTimer % 500 == 10 || this.oID != this.mID) { - var1.sendProgressBarUpdate(this, 15, this.mID); - } - - if (this.mTimer % 500 == 10 || this.oActive != this.mActive) { - var1.sendProgressBarUpdate(this, 16, this.mActive); - } - - if (this.mTimer % 500 == 10 || this.oSteam != this.mSteam) { - var1.sendProgressBarUpdate(this, 17, this.mSteam & '￿'); - var1.sendProgressBarUpdate(this, 18, this.mSteam >>> 16); - } - } while (this.mTimer % 500 != 10 && this.oSteamStorage == this.mSteamStorage); - - var1.sendProgressBarUpdate(this, 19, this.mSteamStorage & '￿'); - var1.sendProgressBarUpdate(this, 20, this.mSteamStorage >>> 16); - } - } + public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { + super(aInventoryPlayer, aTileEntity, bindInventory); } - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 0 : - this.mEnergy = this.mEnergy & -65536 | par2; - break; - case 1 : - this.mEnergy = this.mEnergy & '￿' | par2 << 16; - break; - case 2 : - this.mStorage = this.mStorage & -65536 | par2; - break; - case 3 : - this.mStorage = this.mStorage & '￿' | par2 << 16; - break; - case 4 : - this.mOutput = par2; - break; - case 5 : - this.mInput = par2; - break; - case 6 : - this.mDisplayErrorCode = par2; - case 7 : - case 8 : - case 9 : - case 10 : - default : - break; - case 11 : - this.mProgressTime = this.mProgressTime & -65536 | par2; - break; - case 12 : - this.mProgressTime = this.mProgressTime & '￿' | par2 << 16; - break; - case 13 : - this.mMaxProgressTime = this.mMaxProgressTime & -65536 | par2; - break; - case 14 : - this.mMaxProgressTime = this.mMaxProgressTime & '￿' | par2 << 16; - break; - case 15 : - this.mID = par2; - break; - case 16 : - this.mActive = par2; - break; - case 17 : - this.mSteam = this.mSteam & -65536 | par2; - break; - case 18 : - this.mSteam = this.mSteam & '￿' | par2 << 16; - break; - case 19 : - this.mSteamStorage = this.mSteamStorage & -65536 | par2; - break; - case 20 : - this.mSteamStorage = this.mSteamStorage & '￿' | par2 << 16; - } - + @Override + public void addSlots(final InventoryPlayer aInventoryPlayer) { + //this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42)); } - public boolean canInteractWith(EntityPlayer player) { - return this.mTileEntity.isUseableByPlayer(player); + @Override + public int getSlotCount() { + return 0; } - public String trans(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); + @Override + public int getShiftClickSlotCount() { + return 0; } -} \ No newline at end of file +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java index bdf19454ce..5fccb51e54 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java @@ -1,9 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import net.minecraft.entity.player.InventoryPlayer; +import java.lang.reflect.Field; +import java.util.List; import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -11,6 +17,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; * The Container I use for all my Basic Machines */ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { + + public String[] mTileDescription; + private String[] oTileDescription; + + public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } @@ -18,6 +29,42 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } + + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) { + return; + } + + try { + this.mTileDescription = this.mTileEntity.getInfoData(); + + Field bTimer = ReflectionUtils.getField(getClass(), "mTimer"); + Field bCrafters = ReflectionUtils.getField(getClass(), "crafters"); + int time = bTimer.getInt(this); + List crafters = (List) bCrafters.get(this); + AutoMap aCrafting = new AutoMap(); + if (crafters != null && !crafters.isEmpty()) { + for (Object o : crafters) { + aCrafting.put((ICrafting) o); + } + } + + for (final ICrafting var3 : aCrafting) { + if (time % 500 == 10 || this.oTileDescription != this.mTileDescription) { + var3.sendProgressBarUpdate((Container)this, 64, 0); + } + } + + this.oTileDescription = this.mTileDescription; + } + catch (Throwable t) { + + } + } + } /*@Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java new file mode 100644 index 0000000000..2d63a13d60 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java @@ -0,0 +1,27 @@ +package gtPlusPlus.xmod.gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class CONTAINER_MultiMachine_NoPlayerInventory extends CONTAINER_MultiMachine { + + public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { + super(aInventoryPlayer, aTileEntity, bindInventory); + } + + public boolean doesBindPlayerInventory() { + return false; + } + + @Override + public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) { + return null; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java new file mode 100644 index 0000000000..0be44fa616 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java @@ -0,0 +1,44 @@ +package gtPlusPlus.xmod.gregtech.api.gui; + +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GUI_Cyclotron extends GT_GUIContainerMetaTile_Machine +{ + public final String mNEI; + public final String mName; + + public GUI_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) { + super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), "gregtech:textures/gui/multimachines/" + "FusionComputer.png"); + this.mName = aName; + this.mNEI = aNEI; + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { + this.fontRendererObj.drawString(this.mName, 8, -10, 16448255); + if (this.mContainer != null) { + if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) { + this.fontRendererObj.drawString("Incomplete Structure.", 10, 8, 16448255); + } + if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine)this.mContainer).mActive == 0) { + this.fontRendererObj.drawString("Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255); + } + else { + this.fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255); + } + } + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + final int x = (this.width - this.xSize) / 2; + final int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java index 425fe6d01f..8293d5b9f3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java @@ -1,12 +1,23 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import net.minecraft.entity.player.InventoryPlayer; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - +import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -20,37 +31,113 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine { String mName = ""; public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) { - super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); + super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); this.mName = aName; } @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - this.fontRendererObj.drawString(this.mName, 10, 8, 16448255); - + protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { + fontRendererObj.drawString(this.mName+"!", 6, 7, 16448255); if (this.mContainer != null) { - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) { - this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) { - this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) { - this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) { - this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) { - this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) { - this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255); - } - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { - this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255); + + boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0; + boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0; + boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0; + boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0; + boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0; + boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0; + + + + //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) + Method aDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); + if (aDrawItemStack != null) { + + try { + + if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { + this.fontRendererObj.drawString("Incomplete Structure.", 10, 16, 16448255); // Move down 8px + } + else { + Field aStringData = ReflectionUtils.getField(this.mContainer.getClass(), "oTileDescription"); + if (aStringData != null) { + String[] aData = (String[]) aStringData.get(this.mContainer); + int aIndex = 0; + this.fontRendererObj.drawString(""+aStringData.getType().getSimpleName(), 6, 16+(aIndex++*8), 16448255); // Move down 8px + if (aData != null && aData.length > 0) { + for (String s : aData) { + this.fontRendererObj.drawString(s, 6, 16+(aIndex++*8), 16448255); // Move down 8px + } + } + else { + this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | "+(aData != null), 6, 16+(aIndex++*8), 16448255); // Move down 8px + } + } + else { + this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | Bad", 6, 16, 16448255); // Move down 8px + + + } + + } + + + + + + + + //Migrate to static block + + Materials GOOD = Materials.Uranium; + Materials BAD = Materials.Plutonium; + + ItemStack aWrenchStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null); + ItemStack aCrowbarStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null); + ItemStack aHammerStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null); + ItemStack aMalletStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null); + ItemStack aScrewdriverStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null); + ItemStack aSolderingStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null); + + ItemStack[] aToolStacks2 = new ItemStack[] { + aWrenchStack, + aCrowbarStack, + aHammerStack, + aMalletStack, + aScrewdriverStack, + aSolderingStack + }; + + int aIndex = 0; + for (aIndex = 0; aIndex < 6; aIndex++) { + + int x = 156; + int y = 112 - (18*3) + (aIndex * 18); + aDrawItemStack.invoke(this, new Object[] { + aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"), + x, + y, + ""+(aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay + }); + this.fontRendererObj.drawString("", 10, 64, 16448255); + } + + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + e.printStackTrace(); + } } + + + + + + + + //ItemStack aWrenchStack = ItemUtils.getSimpleStack(GregTech_API.sWrenchList., i) + + + if (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode == 0) { if (((CONTAINER_MultiMachine) this.mContainer).mActive == 0) { this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index aefa0da7ba..0d30bfecf2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -51,6 +51,7 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; +import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine_NoPlayerInventory; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; @@ -128,7 +129,7 @@ GT_MetaTileEntity_MultiBlockBase { return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); } else { - return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + return new CONTAINER_MultiMachine_NoPlayerInventory(aPlayerInventory, aBaseMetaTileEntity); } } @@ -141,7 +142,7 @@ GT_MetaTileEntity_MultiBlockBase { @Override public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { String aCustomGUI = getCustomGUIResourceName(); - aCustomGUI = aCustomGUI != null ? aCustomGUI : "MultiblockDisplay"; + aCustomGUI = aCustomGUI != null ? aCustomGUI : "MultiblockDisplay_Generic"; aCustomGUI = aCustomGUI + ".png"; if (hasSlotInGUI()) { if (!requiresVanillaGtGUI()) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index 2c3bf29119..91620eece5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -29,6 +29,7 @@ import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_Cyclotron; +import gtPlusPlus.xmod.gregtech.api.gui.GUI_Cyclotron; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -71,18 +72,19 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override public String getCustomGUIResourceName() { - return "FusionComputer"; + return null; } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity); + return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity); + //return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName); - //return null; + return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity); + //return new GUI_Cyclotron(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java deleted file mode 100644 index 1d20b56551..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java +++ /dev/null @@ -1,139 +0,0 @@ - -package gtPlusPlus.xmod.gregtech.loaders; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_ModHandler.RecipeBits; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.MaterialUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; -import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; - -public class ProcessingAngelGrinder implements Interface_OreRecipeRegistrator, Runnable { - public ProcessingAngelGrinder() { - GregtechOrePrefixes.toolAngleGrinder.add(this); - } - - @Override - public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, - final String aModName, final ItemStack aStack) { - if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { - if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) - && (!aMaterial.contains(SubTag.NO_SMASHING))) { - GT_ModHandler.addCraftingRecipe( - MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "IhI", "III", " I ", Character.valueOf('I'), - OrePrefixes.ingot.get(aMaterial) }); - } - } - } - } - - @Override - public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, - final String aModName, final ItemStack aStack) { - // TODO Auto-generated method stub - - } - - public void materialsLoops() { - final Materials[] i = Materials.values(); - final int size = i.length; - Logger.MATERIALS("Materials to attempt tool gen. with: " + size); - int used = 0; - Materials aMaterial = null; - for (int r = 0; r < size; r++) { - aMaterial = i[r]; - if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) - && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) - && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) - && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL)) - && (!aMaterial.contains(SubTag.NO_SMELTING))) { - Logger.MATERIALS("Generating Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); - // Input 1 - - - final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L); - final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L); - - if ((null != plate && longrod != null)) { - addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1)); - addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1)); - addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1)); - used++; - } else { - Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+(longrod == null)+" |"); - } - // GT_ModHandler.addCraftingRecipe(, - // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | - // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", - // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial), - // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), - // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)}); - } else { - Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); - } - } else { - Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); - } - - } - - Logger.INFO("Materials used for tool gen: " + used); - } - - @Override - public void run() { - Logger.INFO("Generating Angle Grinders for all valid GT Materials."); - this.materialsLoops(); - } - - public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { - - ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.ANGLE_GRINDER, - 1, - aMaterial, - Materials.Titanium, - new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L}); - - - - long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); - if (aDura <= 32000) { - Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura); - return false; - } - - return GT_ModHandler.addCraftingRecipe( - aOutputStack, - RecipeBits.DISMANTLEABLE | RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, - new Object[]{ - "SXL", - "GMG", - "PBP", - 'X', ItemList.Component_Grinder_Tungsten.get(1), - 'M', CI.getElectricMotor(aVoltageTier, 1), - 'S', OrePrefixes.screw.get(Materials.Titanium), - 'L', OrePrefixes.stickLong.get(aMaterial), - 'P', OrePrefixes.plate.get(aMaterial), - 'G', ELEMENT.STANDALONE.BLACK_METAL.getGear(1), - 'B', aBattery - }); - - } - -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java new file mode 100644 index 0000000000..bf4e9b1390 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java @@ -0,0 +1,139 @@ + +package gtPlusPlus.xmod.gregtech.loaders; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.MaterialUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; +import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; +import net.minecraft.item.ItemStack; + +public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingAngleGrinder() { + GregtechOrePrefixes.toolAngleGrinder.add(this); + } + + @Override + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { + if (aMaterial != Materials.Rubber) { + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) + && (!aMaterial.contains(SubTag.NO_SMASHING))) { + GT_ModHandler.addCraftingRecipe( + MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "IhI", "III", " I ", Character.valueOf('I'), + OrePrefixes.ingot.get(aMaterial) }); + } + } + } + } + + @Override + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { + // TODO Auto-generated method stub + + } + + public void materialsLoops() { + final Materials[] i = Materials.values(); + final int size = i.length; + Logger.MATERIALS("Materials to attempt tool gen. with: " + size); + int used = 0; + Materials aMaterial = null; + for (int r = 0; r < size; r++) { + aMaterial = i[r]; + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) + && (aMaterial != Materials._NULL)) { + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) + && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) + && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL)) + && (!aMaterial.contains(SubTag.NO_SMELTING))) { + Logger.MATERIALS("Generating Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); + // Input 1 + + + final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L); + final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L); + + if ((null != plate && longrod != null)) { + addRecipe(aMaterial, 1600000L, 3, ItemList.Battery_RE_HV_Lithium.get(1)); + addRecipe(aMaterial, 1200000L, 3, ItemList.Battery_RE_HV_Cadmium.get(1)); + addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1)); + used++; + } else { + Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Plate or Long Rod may be invalid. Invalid | Plate? "+(plate == null) +" | Rod? "+(longrod == null)+" |"); + } + // GT_ModHandler.addCraftingRecipe(, + // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | + // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", + // Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial), + // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), + // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)}); + } else { + Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); + } + } else { + Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)); + } + + } + + Logger.INFO("Materials used for tool gen: " + used); + } + + @Override + public void run() { + Logger.INFO("Generating Angle Grinders for all valid GT Materials."); + this.materialsLoops(); + } + + public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { + + ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( + MetaGeneratedGregtechTools.ANGLE_GRINDER, + 1, + aMaterial, + Materials.Titanium, + new long[]{aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L}); + + + + long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); + if (aDura <= 32000) { + Logger.MATERIALS("Unable to generate Angle Grinder from "+MaterialUtils.getMaterialName(aMaterial)+", Durability: "+aDura); + return false; + } + + return GT_ModHandler.addCraftingRecipe( + aOutputStack, + RecipeBits.DISMANTLEABLE | RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, + new Object[]{ + "SXL", + "GMG", + "PBP", + 'X', ItemList.Component_Grinder_Tungsten.get(1), + 'M', CI.getElectricMotor(aVoltageTier, 1), + 'S', OrePrefixes.screw.get(Materials.Titanium), + 'L', OrePrefixes.stickLong.get(aMaterial), + 'P', OrePrefixes.plate.get(aMaterial), + 'G', ELEMENT.STANDALONE.BLACK_METAL.getGear(1), + 'B', aBattery + }); + + } + +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/gui/Cyclotron.png b/src/resources/assets/miscutils/textures/gui/Cyclotron.png new file mode 100644 index 0000000000..98c374ace8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/Cyclotron.png differ diff --git a/src/resources/assets/miscutils/textures/gui/MultiblockDisplay_Generic.png b/src/resources/assets/miscutils/textures/gui/MultiblockDisplay_Generic.png new file mode 100644 index 0000000000..c1ed0e5f37 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/MultiblockDisplay_Generic.png differ -- cgit From 5f455188ce11c975ced96d8364624af540dd276b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 24 Aug 2019 16:34:38 +0100 Subject: + Added some more generic language strings. - Removed maintenance requirement from Cyclotron. % More work on new Multiblock GUIs. $ Potentially fixed #507. --- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 65 ++++ .../gregtech/api/gui/CONTAINER_MultiMachine.java | 269 +++++++++++++--- .../xmod/gregtech/api/gui/GUI_MultiMachine.java | 338 +++++++++++++++------ .../gregtech/api/gui/GUI_MultiMachine_Default.java | 68 +++++ .../base/GregtechMeta_MultiBlockBase.java | 106 +++++-- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 30 +- .../GregtechMetaTileEntity_Cyclotron.java | 16 +- src/resources/assets/gregtech/lang/en_US.lang | 6 +- src/resources/assets/gregtech/lang/zh_CN.lang | 2 +- 9 files changed, 713 insertions(+), 187 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index bda722b47e..a9f7b901ef 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -692,6 +692,39 @@ public class MathUtils { public static int balance(int aInput, int aMin, int aMax) { return Math.max(Math.min(aInput, aMax), aMin); } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - A Number which will be between the bounds, or a boundary value. + */ + public static Number balance(Number aInput, Number aMin, Number aMax) { + return max(min(aInput, aMax), aMin); + } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - An Integer which will be between the bounds, or a boundary value. + */ + public static int balanceInt(Number aInput, Number aMin, Number aMax) { + return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE)); + } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - A Long which will be between the bounds, or a boundary value. + */ + public static long balanceLong(Number aInput, Number aMin, Number aMax) { + return (long) balance(max(min(aInput, aMax), aMin), Long.MIN_VALUE, Long.MAX_VALUE); + } public static int getValueWithinRange(int i, int aMin, int aMax) { int aAmount = Math.max(Math.min(i, aMax), aMin); @@ -703,5 +736,37 @@ public class MathUtils { int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE)); return new Pair(aIntMaxInLong, aRemainder); } + + + + + /** + * Returns the smaller of two {@code Number}s. That is, + * the result the argument closer to the value of + * {@link Long#MIN_VALUE}. If the arguments have the same + * value, the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the smaller of {@code a} and {@code b}. + */ + public static Number min(Number a, Number b) { + return (a.longValue() <= b.longValue()) ? a : b; + } + + /** + * Returns the greater of two {@code Number}s. That is, the + * result is the argument closer to the value of + * {@link Long#MAX_VALUE}. If the arguments have the same value, + * the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + */ + public static Number max(Number a, Number b) { + return (a.longValue() >= b.longValue()) ? a : b; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java index 5fccb51e54..d3e22875ae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java @@ -1,12 +1,19 @@ package gtPlusPlus.xmod.gregtech.api.gui; import java.lang.reflect.Field; +import java.util.ArrayList; import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.api.objects.data.AutoMap; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -20,6 +27,9 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { public String[] mTileDescription; private String[] oTileDescription; + + private GregtechMeta_MultiBlockBase mMCTEI; + private boolean mControllerSet = false; public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { @@ -29,56 +39,245 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } + + public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) { + if (aTile == null) { + return; + } + final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return; + } + if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) { + aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity; + } + } + + public int aTotalTickTime = 0; + public int aMaxParallel = 0; + public int aPollutionTick = 0; + public int aMaxInputVoltage = 0; + public int aInputTier = 0; + public int aOutputTier = 0; + public int aRecipeDuration = 0; + public int aRecipeEU = 0; + public int aRecipeSpecial = 0; + public int aPollutionReduction = 0; + public int aStoredEnergy = 0; + public int aMaxEnergy = 0; + public int aEfficiency = 0; + private int oTotalTickTime = 0; + private int oMaxParallel = 0; + private int oPollutionTick = 0; + private int oMaxInputVoltage = 0; + private int oInputTier = 0; + private int oOutputTier = 0; + private int oRecipeDuration = 0; + private int oRecipeEU = 0; + private int oRecipeSpecial = 0; + private int oPollutionReduction = 0; + private int oStoredEnergy = 0; + private int oMaxEnergy = 0; + private int oEfficiency = 0; + + private static Field timer; + //private static Field crafters; @Override - public void detectAndSendChanges() { + public final void detectAndSendChanges() { super.detectAndSendChanges(); if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) { return; } - - try { - this.mTileDescription = this.mTileEntity.getInfoData(); - - Field bTimer = ReflectionUtils.getField(getClass(), "mTimer"); - Field bCrafters = ReflectionUtils.getField(getClass(), "crafters"); - int time = bTimer.getInt(this); - List crafters = (List) bCrafters.get(this); - AutoMap aCrafting = new AutoMap(); - if (crafters != null && !crafters.isEmpty()) { + if (!mControllerSet) { + setControllerInstance(this, this.mTileEntity); + } + mControllerSet = (mMCTEI != null); + if (timer == null) { + timer = ReflectionUtils.getField(getClass(), "mTimer"); + } + if (crafters == null) { + //crafters = ReflectionUtils.getField(getClass(), "crafters"); + } + if (timer != null && crafters != null && mControllerSet) { + Logger.INFO("Trying to update clientside GUI data"); + try { + Logger.INFO("0"); + int aTimer = (int) ReflectionUtils.getFieldValue(timer, this); + + //List crafters1List = (List) crafters1; + List crafters2 = new ArrayList(); + Logger.INFO("1"); for (Object o : crafters) { - aCrafting.put((ICrafting) o); + if (o instanceof ICrafting) { + crafters2.add((ICrafting) o); + } } - } + Logger.INFO("2"); + if (!crafters2.isEmpty()) { + Logger.INFO("3"); + handleInitialFieldSetting(); - for (final ICrafting var3 : aCrafting) { - if (time % 500 == 10 || this.oTileDescription != this.mTileDescription) { - var3.sendProgressBarUpdate((Container)this, 64, 0); + try { + Logger.INFO("4"); + for (final ICrafting var3 : crafters2) { + handleCraftingEvent(aTimer, var3); + } + Logger.INFO("5"); + handleInternalFieldSetting(); + Logger.INFO("6"); + } catch (Throwable t) { + + } } + } catch (Throwable t) { + t.printStackTrace(); } + } + else { + Logger.INFO("Failed."); + } + } + + public void handleInitialFieldSetting() { + this.aTotalTickTime = MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aMaxParallel = mMCTEI.getMaxParallelRecipes(); + this.aPollutionTick = mMCTEI.getPollutionPerTick(null); + this.aMaxInputVoltage = MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE); + if (mMCTEI.mLastRecipe != null) { + GT_Recipe aRecipe = mMCTEI.mLastRecipe; + this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE); + } + this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers(); + + this.aStoredEnergy = MathUtils.balance((int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aMaxEnergy = MathUtils.balance((int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE); + } - this.oTileDescription = this.mTileDescription; + public void handleCraftingEvent(int aTimer, ICrafting aCrafter) { + int aID = 750; + if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime); + } + if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel); + } + if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick); + } + if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage); + } + if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier); + } + if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier); + } + if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration); } - catch (Throwable t) { + if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU); + } + if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial); + } + if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction); + } + if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy); + } + if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy); + } + if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency); + } + } + + public void handleInternalFieldSetting() { + this.oTotalTickTime = this.aTotalTickTime; + this.oMaxParallel = this.aMaxParallel; + this.oPollutionTick = this.aPollutionTick; + this.oMaxInputVoltage = this.aMaxInputVoltage; + this.oInputTier = this.aInputTier; + this.oOutputTier = this.aOutputTier; + this.oRecipeDuration = this.aRecipeDuration; + this.oRecipeEU = this.aRecipeEU; + this.oRecipeSpecial = this.aRecipeSpecial; + this.oPollutionReduction = this.aPollutionReduction; + this.oStoredEnergy = this.aStoredEnergy; + this.oMaxEnergy = this.aMaxEnergy; + this.oEfficiency = this.aEfficiency; + } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(final int par1, final int par2) { + super.updateProgressBar(par1, par2); + int shiftedSwitch = par1 - 750; + switch (shiftedSwitch) { + case 0: { + this.aTotalTickTime = par2; + break; + } + case 1: { + this.aMaxParallel = par2; + break; + } + case 2: { + this.aPollutionTick = par2; + break; + } + case 3: { + this.aMaxInputVoltage = par2; + break; + } + case 4: { + this.aInputTier = par2; + break; + } + case 5: { + this.aOutputTier = par2; + break; + } + case 6: { + this.aRecipeDuration = par2; + break; + } + case 7: { + this.aRecipeEU = par2; + break; + } + case 8: { + this.aRecipeSpecial = par2; + break; + } + case 9: { + this.aPollutionReduction = par2; + break; + } + case 10: { + this.aStoredEnergy = par2; + break; + } + case 11: { + this.aMaxEnergy = par2; + break; + } + case 12: { + this.aEfficiency = par2; + break; + } } } } - -/*@Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 1, 152, 5)); - } - - @Override - public int getSlotCount() { - return 1; - } - - @Override - public int getShiftClickSlotCount() { - return 0; - } -}*/ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java index 8293d5b9f3..c78e7789b8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java @@ -1,23 +1,26 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -28,128 +31,261 @@ import net.minecraft.util.ResourceLocation; */ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine { - String mName = ""; + private final static Materials GOOD; + private final static Materials BAD; + private final String mName; + + private final static ConcurrentHashMap mToolStacks = new ConcurrentHashMap(); + + //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) + private final static Method mDrawItemStack; + + static { + GOOD = Materials.Uranium; + BAD = Materials.Plutonium; + + //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) + mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); + } public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) { super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); - this.mName = aName; + this.mName = aName != null ? aName : ""; } @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - fontRendererObj.drawString(this.mName+"!", 6, 7, 16448255); + protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { if (this.mContainer != null) { + drawGuiInfoTextLayer(par1, par2); + drawGuiRepairStatusLayer(par1, par2); + } + } - boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0; - boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0; - boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0; - boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0; - boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0; - boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0; - - - - //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) - Method aDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); - if (aDrawItemStack != null) { - - try { - - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { - this.fontRendererObj.drawString("Incomplete Structure.", 10, 16, 16448255); // Move down 8px - } - else { - Field aStringData = ReflectionUtils.getField(this.mContainer.getClass(), "oTileDescription"); - if (aStringData != null) { - String[] aData = (String[]) aStringData.get(this.mContainer); - int aIndex = 0; - this.fontRendererObj.drawString(""+aStringData.getType().getSimpleName(), 6, 16+(aIndex++*8), 16448255); // Move down 8px - if (aData != null && aData.length > 0) { - for (String s : aData) { - this.fontRendererObj.drawString(s, 6, 16+(aIndex++*8), 16448255); // Move down 8px - } - } - else { - this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | "+(aData != null), 6, 16+(aIndex++*8), 16448255); // Move down 8px - } - } - else { - this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | Bad", 6, 16, 16448255); // Move down 8px - - - } - - } - - - - - - - - //Migrate to static block - - Materials GOOD = Materials.Uranium; - Materials BAD = Materials.Plutonium; - - ItemStack aWrenchStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aCrowbarStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aHammerStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aMalletStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aScrewdriverStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aSolderingStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null); - - ItemStack[] aToolStacks2 = new ItemStack[] { - aWrenchStack, - aCrowbarStack, - aHammerStack, - aMalletStack, - aScrewdriverStack, - aSolderingStack - }; - - int aIndex = 0; - for (aIndex = 0; aIndex < 6; aIndex++) { - - int x = 156; - int y = 112 - (18*3) + (aIndex * 18); - aDrawItemStack.invoke(this, new Object[] { - aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"), - x, - y, - ""+(aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay - }); - this.fontRendererObj.drawString("", 10, 64, 16448255); - } - - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - e.printStackTrace(); - } + + protected void drawGuiInfoTextLayer(final float par1, final int par2) { + + if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { + this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px + this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px + } + else { + int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime; + int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel; + int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick; + int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage; + int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier; + int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier; + int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration; + int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU; + int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial; + int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency; + + int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction; + + + long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy; + long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy; + + /* + * Logic Block + */ + + long seconds = (aTotalTickTime/20); + int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7); + int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks); + long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks); + long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); + long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60); + + ArrayList mInfo = new ArrayList(); + + String EU = StatCollector.translateToLocal("GTPP.info.eu"); + + //GTPP.machines.tier + + mInfo.add(mName); + + if (aInputTier > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.machines.input")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aInputTier]); + } + if (aOutputTier > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]); + } + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+ + EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s"); + + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+ + EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+ + EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+""); + + if (aRecipeEU != 0 && aRecipeDuration > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+ + EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t"); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+ + EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks"); + if (aRecipeSpecial > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue")+": "+ + EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + ""); + } + } + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+ + EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET); + + mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+ + EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET)); + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"); + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec"); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %"); + + mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET); + + mInfo.add("Total Time Since Built: "); + mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(hours) +EnumChatFormatting.RESET+ " Hours,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds"); + + + + // Machine Name + //fontRendererObj.drawString(this.mName, 6, 7, 16448255); + + for (int i=0;i 10) { + mStartUpCheck = 10; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index d3f6fdb491..97ee87e4a2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -408,23 +408,25 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } - private volatile int mGraceTimer = 100; + private volatile int mGraceTimer = 2; - @SuppressWarnings("unused") @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) { - this.causeMaintenanceIssue(); - this.stopMachine(); - } - if (false) { // To be replaced with a config option or something - this.explodeMultiblock(); - } - } + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + //Try dry Pyrotheum after all other logic + if (this.mStartUpCheck < 0) { + if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) { + if (mGraceTimer-- == 0) { + this.causeMaintenanceIssue(); + this.stopMachine(); + } + } + } + } } - super.onPostTick(aBaseMetaTileEntity, aTick); + } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index 91620eece5..ed6c913e6b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -6,7 +6,6 @@ import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -22,14 +21,11 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; -import gregtech.common.gui.GT_GUIContainer_FusionReactor; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_Cyclotron; -import gtPlusPlus.xmod.gregtech.api.gui.GUI_Cyclotron; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -173,12 +169,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas return false; } } - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; + this.fixAllMaintenanceIssue(); log("Built Cyclotron."); turnCasingActive(true); return true; @@ -320,7 +311,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas /*if (CORE.DEVENV) { return this.checkRecipeGeneric(); }*/ - + this.fixAllMaintenanceIssue(); //log("Recipe Check."); ArrayList tItemList = getStoredInputs(); @@ -411,6 +402,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas //Time Counter this.mTotalRunTime++; + this.fixAllMaintenanceIssue(); onRunningTick(null); @@ -502,7 +494,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas stopMachine(); } } - doRandomMaintenanceDamage(); + //doRandomMaintenanceDamage(); aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index c388f9785e..9989bffcf0 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -4,15 +4,19 @@ GTPP.EBF.heat=Heat capacity GTPP.machines.tier=Tier +GTPP.machines.input=Input +GTPP.machines.output=Output GTPP.multiblock.pollutionreduced=Pollution reduced to GTPP.multiblock.pollution=Pollution GTPP.multiblock.energy=Stored Energy -GTPP.multiblock.Progress=Progress +GTPP.multiblock.progress=Progress GTPP.multiblock.efficiency=Efficiency GTPP.multiblock.problems=Problems GTPP.multiblock.mei=Max Energy Income GTPP.multiblock.usage=Probably uses +GTPP.multiblock.specialvalue=Special Value +GTPP.multiblock.duration=Duration diff --git a/src/resources/assets/gregtech/lang/zh_CN.lang b/src/resources/assets/gregtech/lang/zh_CN.lang index 750961610a..df43ca8590 100644 --- a/src/resources/assets/gregtech/lang/zh_CN.lang +++ b/src/resources/assets/gregtech/lang/zh_CN.lang @@ -8,7 +8,7 @@ GTPP.machines.tier=等级 GTPP.multiblock.pollutionreduced=减少污染至 GTPP.multiblock.pollution=污染 GTPP.multiblock.energy=能量存储 -GTPP.multiblock.Progress=进程 +GTPP.multiblock.progress=进程 GTPP.multiblock.efficiency=效率 GTPP.multiblock.problems=为每桶 GTPP.multiblock.mei=最大能量输入 -- cgit From 7403427bbb0026962665c2f46d4108ae5777814d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 24 Aug 2019 18:36:58 +0100 Subject: + Added new processing chain for Rare Earth. 3 different processing chains can be used to obtain various resources. Closes #530. % Adjusted some auto-generated recipe processing times for Ore materials. % Adjusted some material components of a few Ore materials. $ Added some placeholder names for unnamed blocks from other mods. --- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 75 +++++++++++++++ src/Java/gtPlusPlus/core/material/Material.java | 4 +- src/Java/gtPlusPlus/core/material/ORES.java | 28 +++++- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 22 +---- .../core/recipe/RECIPES_RareEarthProcessing.java | 104 +++++++++++++++++++++ .../everglades/GTplusplus_Everglades.java | 1 + .../xmod/gregtech/loaders/RecipeGen_Ore.java | 7 +- .../xmod/gregtech/recipes/RecipesToRemove.java | 19 +++- src/resources/assets/miscutils/lang/en_US.lang | 58 +++++++++++- 9 files changed, 281 insertions(+), 37 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index bf6e0ef9e7..236af1b060 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -1,6 +1,8 @@ package gtPlusPlus.core.material; +import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; +import gtPlusPlus.core.client.CustomTextureSet.TextureSets; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.minecraft.MaterialUtils; @@ -114,6 +116,79 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.getInstance().CARBON, 1), new MaterialStack(ELEMENT.getInstance().OXYGEN, 2) }); + + + + + /* + * Rare Earth Materials + */ + + public static final Material RARE_EARTH_LOW = new Material( + "Rare Earth (I)", //Material Name + MaterialState.ORE, //State + TextureSets.GEM_A.get(), //Texture Set + null, //Material Colour + 1200, + 2500, + -1, + -1, + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ORES.GREENOCKITE, 1), + new MaterialStack(ORES.LANTHANITE_CE, 1), + new MaterialStack(ORES.AGARDITE_CD, 1), + new MaterialStack(ORES.XENOTIME, 1), + new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.NetherQuartz), 1), + new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Galena), 1), + new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite), 1), + new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Cobaltite), 1), + new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1) + }); + + public static final Material RARE_EARTH_MID = new Material( + "Rare Earth (II)", //Material Name + MaterialState.ORE, //State + TextureSets.ENRICHED.get(), //Texture Set + null, //Material Colour + 3500, + 5000, + -1, + -1, + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ORES.LANTHANITE_ND, 1), + new MaterialStack(ORES.AGARDITE_ND, 1), + new MaterialStack(ORES.YTTRIAITE, 1), + new MaterialStack(ORES.CROCROITE, 1), + new MaterialStack(ORES.NICHROMITE, 1), + new MaterialStack(ORES.ZIRCON, 1), + new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1), + new MaterialStack(ELEMENT.STANDALONE.WHITE_METAL, 1), + new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1) + }); + + public static final Material RARE_EARTH_HIGH = new Material( + "Rare Earth (III)", //Material Name + MaterialState.ORE, //State + TextureSets.REFINED.get(), //Texture Set + null, //Material Colour + 5200, + 7500, + -1, + -1, + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ORES.GADOLINITE_Y, 1), + new MaterialStack(ORES.LEPERSONNITE, 1), + new MaterialStack(ORES.FLORENCITE, 1), + new MaterialStack(ORES.FLUORCAPHITE, 1), + new MaterialStack(ORES.LAUTARITE, 1), + new MaterialStack(ORES.DEMICHELEITE_BR, 1), + new MaterialStack(ORES.ALBURNITE, 1), + new MaterialStack(ORES.KASHINITE, 1), + new MaterialStack(ORES.AGARDITE_LA, 1), + }); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 6e5cd0f8f0..5fca2fb2fe 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -94,8 +94,8 @@ public class Material { this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); } - public Material(String materialName, MaterialState defaultState, final TextureSet set, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){ - this(materialName, defaultState, set, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); + public Material(String materialName, MaterialState defaultState, final TextureSet set, short[] rgba, int meltingPoint, int boilingPoint, int protons, int neutrons, int radiationLevel, MaterialStack[] materialStacks){ + this(materialName, defaultState, set, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, false, "", radiationLevel, false, materialStacks); } public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){ diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java index 0e1691a557..c2556b60f1 100644 --- a/src/Java/gtPlusPlus/core/material/ORES.java +++ b/src/Java/gtPlusPlus/core/material/ORES.java @@ -90,9 +90,10 @@ public final class ORES { -1, -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().LEAD, 1), - new MaterialStack(ELEMENT.getInstance().CHROMIUM, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 4) + new MaterialStack(ELEMENT.getInstance().LEAD, 2), + new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), + new MaterialStack(ELEMENT.getInstance().CAESIUM, 1), }); public static final Material NICHROMITE = new Material( @@ -126,7 +127,10 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), //Y not YT/YB - new MaterialStack(ELEMENT.getInstance().OXYGEN, 3) + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), + new MaterialStack(ELEMENT.getInstance().IRON, 4), + new MaterialStack(ELEMENT.getInstance().TIN, 1), + new MaterialStack(ELEMENT.getInstance().NITROGEN, 2) }); //Samarskite_Y @@ -260,6 +264,7 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 1), new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1), new MaterialStack(ELEMENT.getInstance().OXYGEN, 4) }); @@ -794,6 +799,21 @@ public final class ORES { new MaterialStack(ELEMENT.getInstance().SULFUR, 16), new MaterialStack(ELEMENT.getInstance().OXYGEN, 15) }); + + public static final Material GREENOCKITE = new Material( + "Greenockite", //Material Name + MaterialState.ORE, //State + TextureSets.GEM_A.get(), //Texture Set + new short[]{110, 193, 25, 0}, //Material Colour + -1, + -1, + -1, + -1, + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CADMIUM, 2), + new MaterialStack(ELEMENT.getInstance().SULFUR, 2), + }); public static final Material DEEP_EARTH_REACTOR_FUEL_DEPOSIT = new Material( diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 7a69cb44f5..a481ff17bf 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -17,7 +17,6 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.HotFuel; import gregtech.api.util.ThermalFuel; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.GenericChem; @@ -30,8 +29,6 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MISC_MATERIALS; -import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.material.NONMATERIAL; import gtPlusPlus.core.material.ORES; import gtPlusPlus.core.material.Particle; import gtPlusPlus.core.material.nuclear.FLUORIDES; @@ -102,6 +99,7 @@ public class RECIPES_GREGTECH { * Special Recipe handlers */ RECIPES_SeleniumProcessing.init(); + RECIPES_RareEarthProcessing.init(); @@ -2286,24 +2284,6 @@ public class RECIPES_GREGTECH { private static void sifterRecipes() { - // Rare Earth Processing - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1), - new ItemStack[] { - ELEMENT.getInstance().YTTRIUM.getSmallDust(1), - ELEMENT.getInstance().NEODYMIUM.getSmallDust(1), - ELEMENT.getInstance().LANTHANUM.getSmallDust(1), - ELEMENT.getInstance().CERIUM.getSmallDust(1), - ELEMENT.getInstance().CADMIUM.getSmallDust(1), - ELEMENT.getInstance().CAESIUM.getSmallDust(1), - ORES.SAMARSKITE_YB.getSmallDust(1), - ORES.FLORENCITE.getSmallDust(1), - ORES.FLUORCAPHITE.getSmallDust(1), - //ELEMENT.getInstance().YTTERBIUM.getTinyDust(1), - //ELEMENT.getInstance().SAMARIUM.getTinyDust(1), - //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1) - }, - new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500); - // Zirconium GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1), new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java new file mode 100644 index 0000000000..f8059f8217 --- /dev/null +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java @@ -0,0 +1,104 @@ +package gtPlusPlus.core.recipe; + +import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_HIGH; +import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_LOW; +import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_MID; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.material.ORES; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +public class RECIPES_RareEarthProcessing { + + public static void init() { + + // Set Material Tiers correctly + ORES.GREENOCKITE.vTier = 1; + RARE_EARTH_LOW.vTier = 1; + RARE_EARTH_MID.vTier = 3; + RARE_EARTH_HIGH.vTier = 5; + + // Set Material Voltages correctly + ORES.GREENOCKITE.vVoltageMultiplier = 30; + RARE_EARTH_LOW.vVoltageMultiplier = 30; + RARE_EARTH_MID.vVoltageMultiplier = 480; + RARE_EARTH_HIGH.vVoltageMultiplier = 7680; + + // Generate Ore Materials + MaterialGenerator.generateOreMaterial(RARE_EARTH_LOW); + MaterialGenerator.generateOreMaterial(RARE_EARTH_MID); + MaterialGenerator.generateOreMaterial(RARE_EARTH_HIGH); + + ItemStack aRareEarth = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RareEarth, 1L); + + Fluid aSulfuric = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid(); + Fluid aHydrocholric = FluidUtils.getFluidStack("hydrochloricacid_gt5u", 1).getFluid(); + Fluid aNitric = FluidUtils.getFluidStack("nitricacid", 1).getFluid(); + + // LV Rare Earth + GT_Values.RA.addChemicalBathRecipe( + ItemUtils.getSimpleStack(aRareEarth, 3), + FluidUtils.getFluidStack(aSulfuric, 1000), + RARE_EARTH_LOW.getCrushed(1), + RARE_EARTH_LOW.getCrushed(1), + RARE_EARTH_LOW.getCrushed(1), + new int[] {10000, 10000, 9000}, + 20 * 30, + (int) GT_Values.V[1]); + + // HV Rare Earth + GT_Values.RA.addChemicalBathRecipe( + ItemUtils.getSimpleStack(aRareEarth, 6), + FluidUtils.getFluidStack(aHydrocholric, 3000), + RARE_EARTH_MID.getCrushed(2), + RARE_EARTH_MID.getCrushed(2), + RARE_EARTH_MID.getCrushed(2), + new int[] {10000, 9000, 8000}, + 20 * 60, + (int) GT_Values.V[3]); + + // IV Rare Earth + GT_Values.RA.addChemicalBathRecipe( + ItemUtils.getSimpleStack(aRareEarth, 9), + FluidUtils.getFluidStack(aNitric, 6000), + RARE_EARTH_HIGH.getCrushed(3), + RARE_EARTH_HIGH.getCrushed(3), + RARE_EARTH_HIGH.getCrushed(3), + new int[] {9000, 8000, 7000}, + 20 * 90, + (int) GT_Values.V[5]); + + + } + + + public static void processCopperRecipes() { + + // Rare Earth Processing + /*GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1), + new ItemStack[] { + ELEMENT.getInstance().YTTRIUM.getSmallDust(1), + ELEMENT.getInstance().NEODYMIUM.getSmallDust(1), + ELEMENT.getInstance().LANTHANUM.getSmallDust(1), + ELEMENT.getInstance().CERIUM.getSmallDust(1), + ELEMENT.getInstance().CADMIUM.getSmallDust(1), + ELEMENT.getInstance().CAESIUM.getSmallDust(1), + ORES.SAMARSKITE_YB.getSmallDust(1), + ORES.FLORENCITE.getSmallDust(1), + ORES.FLUORCAPHITE.getSmallDust(1), + //ELEMENT.getInstance().YTTERBIUM.getTinyDust(1), + //ELEMENT.getInstance().SAMARIUM.getTinyDust(1), + //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1) + }, + new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500);*/ + + } + +} diff --git a/src/Java/gtPlusPlus/everglades/GTplusplus_Everglades.java b/src/Java/gtPlusPlus/everglades/GTplusplus_Everglades.java index 698a5ec80a..6c8a790037 100644 --- a/src/Java/gtPlusPlus/everglades/GTplusplus_Everglades.java +++ b/src/Java/gtPlusPlus/everglades/GTplusplus_Everglades.java @@ -115,6 +115,7 @@ public class GTplusplus_Everglades implements ActionListener { MaterialGenerator.generateOreMaterial(ORES.MIESSIITE); MaterialGenerator.generateOreMaterial(ORES.KASHINITE); MaterialGenerator.generateOreMaterial(ORES.IRARSITE); + MaterialGenerator.generateOreMaterial(ORES.GREENOCKITE); MaterialGenerator.generateOreMaterial(ORES.RADIOBARITE); MaterialGenerator.generateOreMaterial(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java index 1cb999241a..52f7ab24f3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -55,9 +55,6 @@ public class RecipeGen_Ore extends RecipeGen_Base { //if (material.getMaterialComposites().length > 1){ Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]"); int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier); - if (tVoltageMultiplier < 120) { - tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 480 : 120; - } final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1); Material bonusA = null; //Ni @@ -362,7 +359,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { mInternalOutputs[4], mInternalOutputs[5], mChances, - 20*1*(tVoltageMultiplier/10), + (int) Math.max(material.getMass() * 3L * 1, 1), tVoltageMultiplier)){ Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+matDust.getDisplayName()); } @@ -445,7 +442,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { null, mInternalOutputs, mChances, - 20*1*(tVoltageMultiplier/10), + (int) Math.max(material.getMass() * 4L * 1, 1), tVoltageMultiplier)){ Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "+matDust.getDisplayName()); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java index 06373c9e1d..35714aee26 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java @@ -1,10 +1,10 @@ package gtPlusPlus.xmod.gregtech.recipes; -import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.ORES; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -28,7 +28,7 @@ public class RecipesToRemove { Logger.INFO("Removed vanilla GT Rare Earth processing."); //Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs //Best not to set this unless the original recipe is removed. - Materials.RareEarth.mChemicalFormula = "(" + /*Materials.RareEarth.mChemicalFormula = "(" +ELEMENT.getInstance().YTTRIUM.vChemicalSymbol +ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol +ELEMENT.getInstance().LANTHANUM.vChemicalSymbol @@ -38,7 +38,18 @@ public class RecipesToRemove { +ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol +ELEMENT.getInstance().SAMARIUM.vChemicalSymbol +ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+ - ")"; + ")";*/ + + Material[] aLowTierOutputMaterials = new Material[] { + ORES.GREENOCKITE + }; + + + + + + + } } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index bc4b170654..193df880f0 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -2969,4 +2969,60 @@ item.itemCactusCharcoal.name=Cactus Charcoal item.itemCactusCoke.name=Cactus Coke item.itemSugarCharcoal.name=Sugar Charcoal item.itemSugarCoke.name=Sugar Coke -item.LiquidHydrogen.name=Liquid Hydrogen Cell [LOH] \ No newline at end of file +item.LiquidHydrogen.name=Liquid Hydrogen Cell [LOH] + + + +//Added 24/8/19 +//Debug Labels +tile.blockDoorAlloy.name=Reinforced Door +tile.blockInhibitorObelisk.name=Inhibitor Obelisk +tile.Battlesign.name=Battlesign +tile.blockMagicBox.name=Magic Box +tile.blockManaPod.name=Mana Pod Stem +tile.buildToolBlock.name=Tool Block +tile.blockRedPlasma.name=Red Plasma Block +tile.pipeBlock.name=Pipe +item.null.name=REPORT ERROR TO ALKALUS + + +//Added 24/8/19 +tile.OreGreenockite.name=Greenockite Ore +item.crushedGreenockite.name=Crushed Greenockite Ore +item.crushedCentrifugedGreenockite.name=Centrifuged Crushed Greenockite Ore +item.crushedPurifiedGreenockite.name=Purified Crushed Greenockite Ore +item.dustImpureGreenockite.name=Impure Greenockite Dust +item.dustPureGreenockite.name=Purified Greenockite Dust +item.itemDustGreenockite.name=Greenockite Dust +item.itemDustTinyGreenockite.name=Tiny Pile of Greenockite Dust +item.itemDustSmallGreenockite.name=Small Pile of Greenockite Dust + +tile.OreRareEarthI.name=Rare Earth (I) Ore +item.crushedRareEarthI.name=Crushed Rare Earth (I) Ore +item.crushedCentrifugedRareEarthI.name=Centrifuged Crushed Rare Earth (I) Ore +item.crushedPurifiedRareEarthI.name=Purified Crushed Rare Earth (I) Ore +item.dustImpureRareEarthI.name=Impure Rare Earth (I) Dust +item.dustPureRareEarthI.name=Purified Rare Earth (I) Dust +item.itemDustRareEarthI.name=Rare Earth (I) Dust +item.itemDustTinyRareEarthI.name=Tiny Pile of Rare Earth (I) Dust +item.itemDustSmallRareEarthI.name=Small Pile of Rare Earth (I) Dust + +tile.OreRareEarthII.name=Rare Earth (II) Ore +item.crushedRareEarthII.name=Crushed Rare Earth (II) Ore +item.crushedCentrifugedRareEarthII.name=Centrifuged Crushed Rare Earth (II) Ore +item.crushedPurifiedRareEarthII.name=Purified Crushed Rare Earth (II) Ore +item.dustImpureRareEarthII.name=Impure Rare Earth (II) Dust +item.dustPureRareEarthII.name=Purified Rare Earth (II) Dust +item.itemDustRareEarthII.name=Rare Earth (II) Dust +item.itemDustTinyRareEarthII.name=Tiny Pile of Rare Earth (II) Dust +item.itemDustSmallRareEarthII.name=Small Pile of Rare Earth (II) Dust + +tile.OreRareEarthIII.name=Rare Earth (III) Ore +item.crushedRareEarthIII.name=Crushed Rare Earth (III) Ore +item.crushedCentrifugedRareEarthIII.name=Centrifuged Crushed Rare Earth (III) Ore +item.crushedPurifiedRareEarthIII.name=Purified Crushed Rare Earth (III) Ore +item.dustImpureRareEarthIII.name=Impure Rare Earth (III) Dust +item.dustPureRareEarthIII.name=Purified Rare Earth (III) Dust +item.itemDustRareEarthIII.name=Rare Earth (III) Dust +item.itemDustTinyRareEarthIII.name=Tiny Pile of Rare Earth (III) Dust +item.itemDustSmallRareEarthIII.name=Small Pile of Rare Earth (III) Dust \ No newline at end of file -- cgit From b851ee133b5f0a0d1ca5837d9dac3cdfec922561 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 24 Aug 2019 21:21:48 +0100 Subject: + Added new recipes for Hydrogen Chloride, Sodium Hydroxide, Brine. + Added new UV/IR laser lens. $ Fixed Chemical formula not showing up correctly on some mixed materials. $ Fixed Tooltips of Rare Earth materials being too long. $ Fixed Voltage of Rare Earth materials being a tier too high. --- src/Java/gtPlusPlus/core/item/ModItems.java | 6 +- .../core/item/base/BaseItemComponent.java | 13 +- .../core/item/base/ore/BaseOreComponent.java | 14 +- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 116 ++++++++++++-- src/Java/gtPlusPlus/core/material/Material.java | 21 ++- .../core/material/nuclear/FLUORIDES.java | 55 +------ .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 21 ++- .../core/recipe/RECIPES_RareEarthProcessing.java | 174 ++++++++++++++++++--- .../gtPlusPlus/core/util/minecraft/ItemUtils.java | 7 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 1 + .../interfaces/internal/IGregtech_RecipeAdder.java | 6 +- .../common/items/MetaGeneratedGregtechItems.java | 2 + .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 31 ++++ .../textures/items/MU-metaitem.01/140.png | Bin 0 -> 660 bytes 14 files changed, 371 insertions(+), 96 deletions(-) create mode 100644 src/resources/assets/miscutils/textures/items/MU-metaitem.01/140.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 3b919ee431..007079b9c8 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -565,9 +565,9 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TUNGSTEN_TITANIUM_CARBIDE); //LFTR Fuel components - MaterialGenerator.generate(FLUORIDES.HYDROXIDE); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIA); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIUM); //LFTR fuel component + MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component + MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component + MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component MaterialGenerator.generate(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component MaterialGenerator.generate(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component MaterialGenerator.generate(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 90e831cbb4..dc2c0232a6 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -169,9 +169,20 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial != null){ - if ((!this.componentMaterial.vChemicalFormula.equals("??")) && (!this.componentMaterial.vChemicalFormula.equals("?")) && (this.componentMaterial.getState() != MaterialState.PURE_LIQUID)) { + if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } + else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + String temp = componentMaterial.vChemicalFormula; + temp = temp.replace(" ", ""); + temp = temp.replace("-", ""); + temp = temp.replace("_", ""); + temp = temp.replace("!", ""); + temp = temp.replace("@", ""); + temp = temp.replace("#", ""); + temp = temp.replace(" ", ""); + list.add(temp); + } if (this.componentMaterial.isRadioactive){ list.add(CORE.GT_Tooltip_Radioactive); diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 277114a6ae..c5b7191ddd 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -128,10 +128,20 @@ public class BaseOreComponent extends Item{ public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if (this.materialName != null && !this.materialName.equals("")){ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.equals("??") && !this.componentMaterial.vChemicalFormula.equals("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - + else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + String temp = componentMaterial.vChemicalFormula; + temp = temp.replace(" ", ""); + temp = temp.replace("-", ""); + temp = temp.replace("_", ""); + temp = temp.replace("!", ""); + temp = temp.replace("@", ""); + temp = temp.replace("#", ""); + temp = temp.replace(" ", ""); + list.add(temp); + } if (this.componentMaterial.isRadioactive){ list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel); } diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index 236af1b060..aa80f784a9 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -3,8 +3,8 @@ package gtPlusPlus.core.material; import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; import gtPlusPlus.core.client.CustomTextureSet.TextureSets; -import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; public final class MISC_MATERIALS { @@ -17,6 +17,7 @@ public final class MISC_MATERIALS { public static void run() { MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_OXIDE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false); + WATER.registerComponentForMaterial(FluidUtils.getWater(1000)); } public static final Material STRONTIUM_OXIDE = new Material( @@ -52,7 +53,7 @@ public final class MISC_MATERIALS { false, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1), - new MaterialStack(FLUORIDES.HYDROXIDE, 2) + new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2) }); public static final Material SELENIUM_DIOXIDE = new Material( @@ -116,14 +117,12 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.getInstance().CARBON, 1), new MaterialStack(ELEMENT.getInstance().OXYGEN, 2) }); - - - - + + /* * Rare Earth Materials */ - + public static final Material RARE_EARTH_LOW = new Material( "Rare Earth (I)", //Material Name MaterialState.ORE, //State @@ -145,7 +144,7 @@ public final class MISC_MATERIALS { new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Cobaltite), 1), new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1) }); - + public static final Material RARE_EARTH_MID = new Material( "Rare Earth (II)", //Material Name MaterialState.ORE, //State @@ -167,7 +166,7 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.STANDALONE.WHITE_METAL, 1), new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1) }); - + public static final Material RARE_EARTH_HIGH = new Material( "Rare Earth (III)", //Material Name MaterialState.ORE, //State @@ -190,6 +189,105 @@ public final class MISC_MATERIALS { new MaterialStack(ORES.AGARDITE_LA, 1), }); + public static final Material WATER = new Material( + "Water", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 1) + }); + + //OH + public static final Material HYDROXIDE = new Material( + "Hydroxide", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().OXYGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1) + }); + + //NH3 + public static final Material AMMONIA = new Material( + "Ammonia", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -77, //Melting Point in C + -33, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3) + }); + + //NH4 + public static final Material AMMONIUM = new Material( + "Ammonium", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4) + }); + + + public static final Material HYDROGEN_CHLORIDE = new Material( + "Hydrogen Chloride", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1), + new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), + }); + + + public static final Material SODIUM_CHLORIDE = new Material( + "Sodium Chloride", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SODIUM, 1), + new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), + }); + + + public static final Material SODIUM_HYDROXIDE = new Material( + "Sodium Hydroxide", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SODIUM, 1), + new MaterialStack(HYDROXIDE, 1), + }); + + public static final Material SALT_WATER = new Material( + "Salt Water", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(WATER, 3), + new MaterialStack(SODIUM_CHLORIDE, 1), + }); + + public static final Material BRINE = new Material( + "Brine", + MaterialState.PURE_LIQUID, + new MaterialStack[]{ + new MaterialStack(SALT_WATER, 1), + new MaterialStack(SODIUM_CHLORIDE, 2), + }); + } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 5fca2fb2fe..904d1fb4df 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -85,8 +85,17 @@ public class Material { public static AutoMap invalidMaterials = new AutoMap(); + + + public Material(final String materialName, final MaterialState defaultState, final MaterialStack... inputs){ + this(materialName, defaultState, null, inputs); + } + + public Material(final String materialName, final MaterialState defaultState, final short[] rgba, final MaterialStack... inputs){ + this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", 0, false, false, inputs); + } - public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, MaterialStack[] materialStacks) { + public Material(final String materialName, final MaterialState defaultState, final short[] rgba, int radiationLevel, MaterialStack... materialStacks) { this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks); } @@ -1335,7 +1344,17 @@ public class Material { } + public boolean registerComponentForMaterial(FluidStack aStack) { + return registerComponentForMaterial(this, aStack); + } + private static boolean registerComponentForMaterial(Material componentMaterial, FluidStack aStack) { + if (componentMaterial != null && aStack != null && componentMaterial.vMoltenFluid == null) { + componentMaterial.vMoltenFluid = aStack.getFluid(); + return true; + } + return false; + } public boolean registerComponentForMaterial(ComponentTypes aPrefix, ItemStack aStack) { return registerComponentForMaterial(this, aPrefix.getGtOrePrefix(), aStack); diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java index b7a5f6074d..bfa08d3c29 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.material.nuclear; import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.state.MaterialState; @@ -166,54 +167,6 @@ public class FLUORIDES { //LFTR sub components - //OH - public static final Material HYDROXIDE = new Material( - "Hydroxide", //Material Name - MaterialState.PURE_LIQUID, //State - null, //Material Colour - -1, //Melting Point in C - -1, //Boiling Point in C - -1, //Protons - -1, - false, //Uses Blast furnace? - //Material Stacks with Percentage of required elements. - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().OXYGEN, 1), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1) - }); - - //NH3 - public static final Material AMMONIA = new Material( - "Ammonia", //Material Name - MaterialState.PURE_LIQUID, //State - null, //Material Colour - -77, //Melting Point in C - -33, //Boiling Point in C - -1, //Protons - -1, - false, //Uses Blast furnace? - //Material Stacks with Percentage of required elements. - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3) - }); - - //NH4 - public static final Material AMMONIUM = new Material( - "Ammonium", //Material Name - MaterialState.PURE_LIQUID, //State - null, //Material Colour - -1, //Melting Point in C - -1, //Boiling Point in C - -1, //Protons - -1, - false, //Uses Blast furnace? - //Material Stacks with Percentage of required elements. - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4) - }); - //(NH4)HF2 public static final Material AMMONIUM_BIFLUORIDE = new Material( "Ammonium Bifluoride", //Material Name @@ -226,7 +179,7 @@ public class FLUORIDES { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(FLUORIDES.AMMONIUM, 1), + new MaterialStack(MISC_MATERIALS.AMMONIUM, 1), new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1), new MaterialStack(ELEMENT.getInstance().FLUORINE, 2) }); @@ -244,7 +197,7 @@ public class FLUORIDES { //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1), - new MaterialStack(FLUORIDES.HYDROXIDE, 2) + new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2) }); // (NH4)2Be(OH)2 / (NH4)2BeF4 @@ -259,7 +212,7 @@ public class FLUORIDES { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(FLUORIDES.AMMONIUM, 2), + new MaterialStack(MISC_MATERIALS.AMMONIUM, 2), new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1) }); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index a481ff17bf..3d36ffb2ab 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -724,6 +724,26 @@ public class RECIPES_GREGTECH { 480*4); + //Wood's Glass Laser Lens + CORE.RA.addBlastSmelterRecipe( + new ItemStack[] { + ItemUtils.getGregtechCircuit(5), + ItemList.Shape_Mold_Ball.get(0), + ELEMENT.getInstance().BARIUM.getDust(1), + ELEMENT.getInstance().SODIUM.getDust(1), + ELEMENT.getInstance().SILICON.getDust(2), + ELEMENT.getInstance().NICKEL.getDust(1), + ItemUtils.getItemStackOfAmountFromOreDict("dustGlass", 5) + }, + FluidUtils.getUUM(1000), + null, + new ItemStack[] { + GregtechItemList.Laser_Lens_WoodsGlass.get(1) + }, + new int[] {10000}, + 20 * 300, + (int) GT_Values.V[3]); + } @@ -1893,7 +1913,6 @@ public class RECIPES_GREGTECH { Materials.Titanium.mBlastFurnaceTemp); } - } private static void autoclaveRecipes() { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java index f8059f8217..d3c0b4c093 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java @@ -1,46 +1,168 @@ package gtPlusPlus.core.recipe; +import static gtPlusPlus.core.material.MISC_MATERIALS.BRINE; +import static gtPlusPlus.core.material.MISC_MATERIALS.HYDROGEN_CHLORIDE; import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_HIGH; import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_LOW; import static gtPlusPlus.core.material.MISC_MATERIALS.RARE_EARTH_MID; +import static gtPlusPlus.core.material.MISC_MATERIALS.SALT_WATER; +import static gtPlusPlus.core.material.MISC_MATERIALS.SODIUM_CHLORIDE; +import static gtPlusPlus.core.material.MISC_MATERIALS.SODIUM_HYDROXIDE; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.ORES; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; public class RECIPES_RareEarthProcessing { - public static void init() { + private static ItemStack mDustSodiumHydroxide; + private static ItemStack mDustSalt; + private static FluidStack mSaltWater; + private static FluidStack mBrine; + private static FluidStack mHydrogenChloride; - // Set Material Tiers correctly - ORES.GREENOCKITE.vTier = 1; - RARE_EARTH_LOW.vTier = 1; - RARE_EARTH_MID.vTier = 3; - RARE_EARTH_HIGH.vTier = 5; + public static void init() { - // Set Material Voltages correctly - ORES.GREENOCKITE.vVoltageMultiplier = 30; - RARE_EARTH_LOW.vVoltageMultiplier = 30; - RARE_EARTH_MID.vVoltageMultiplier = 480; - RARE_EARTH_HIGH.vVoltageMultiplier = 7680; + // Salt Check and Assignment + mDustSalt = ItemUtils.getItemStackOfAmountFromOreDict("dustSalt", 1); + if (mDustSalt == null) { + MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CHLORIDE, false); + mDustSalt = SODIUM_CHLORIDE.getDust(1); + } + else { + SODIUM_CHLORIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSalt); + } - // Generate Ore Materials + // Salt water Check and Assignment + mSaltWater = FluidUtils.getFluidStack("saltwater", 1000); + if (mSaltWater == null) { + Fluid f = SALT_WATER.generateFluid(); + SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); + mSaltWater = SALT_WATER.getFluid(1000); + } + else { + SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(mSaltWater, 1000)); + } + + // Brine Check and assignment + mBrine = FluidUtils.getFluidStack("brine", 1000); + if (mBrine == null) { + Fluid f = BRINE.generateFluid(); + BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); + mBrine = BRINE.getFluid(1000); + } + else { + BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(mBrine, 1000)); + } + + // Check Sodium Hydroxide Exists, generate if not. + mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1); + if (mDustSodiumHydroxide == null) { + mDustSodiumHydroxide = ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide_GT5U", 1); + if (mDustSodiumHydroxide == null) { + MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_HYDROXIDE, false); + mDustSodiumHydroxide = SODIUM_HYDROXIDE.getDust(1); + } + else { + SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide); + } + } + else { + SODIUM_HYDROXIDE.registerComponentForMaterial(OrePrefixes.dust, mDustSodiumHydroxide); + } + + // Hydrogen Chloride Check and assignment + mHydrogenChloride = FluidUtils.getFluidStack("hydrogenchloride", 1000); + if (mHydrogenChloride == null) { + HYDROGEN_CHLORIDE.generateFluid(); + mHydrogenChloride = BRINE.getFluid(1000); + } + else { + HYDROGEN_CHLORIDE.registerComponentForMaterial(FluidUtils.getFluidStack(mHydrogenChloride, 1000)); + } + + + // Add Process for creating Brine + CORE.RA.addBrewingRecipe( + ItemUtils.getSimpleStack(mDustSalt, 16), + MISC_MATERIALS.SALT_WATER.getFluid(2000), + FluidUtils.getFluidStack(mBrine, 4000), + 20 * 20, + 120, + false); + + // Chloralkali process + GT_Values.RA.addElectrolyzerRecipe( + CI.getNumberedCircuit(16), + CI.emptyCells(4), + FluidUtils.getFluidStack(mBrine, 4000), + null, // Out + ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 2), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2), + ItemUtils.getSimpleStack(mDustSodiumHydroxide, 2), + null, + null, + null, + new int[] {10000, 10000, 10000}, + 20 * 30, + (int) GT_Values.V[2]); + + // Generate Special Laser Recipe + CORE.RA.addUvLaserRecipe( + ELEMENT.getInstance().CHLORINE.getCell(2), + ELEMENT.getInstance().HYDROGEN.getCell(2), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 4), + 20 * 30, + 480); + + + // Set Material Tiers correctly + ORES.GREENOCKITE.vTier = 1; + RARE_EARTH_LOW.vTier = 1; + RARE_EARTH_MID.vTier = 3; + RARE_EARTH_HIGH.vTier = 5; + + // Set Material Voltages correctly + ORES.GREENOCKITE.vVoltageMultiplier = 30; + RARE_EARTH_LOW.vVoltageMultiplier = 30; + RARE_EARTH_MID.vVoltageMultiplier = 480; + RARE_EARTH_HIGH.vVoltageMultiplier = 7680; + + // Set Material Tooltips to be shorter + RARE_EARTH_LOW.vChemicalFormula = "??????"; + RARE_EARTH_MID.vChemicalFormula = "??????"; + RARE_EARTH_HIGH.vChemicalFormula = "??????"; + + // Set Material Tooltips to be shorter + RARE_EARTH_LOW.vChemicalSymbol = "??"; + RARE_EARTH_MID.vChemicalSymbol = "??"; + RARE_EARTH_HIGH.vChemicalSymbol = "??"; + + // Generate Ore Materials MaterialGenerator.generateOreMaterial(RARE_EARTH_LOW); MaterialGenerator.generateOreMaterial(RARE_EARTH_MID); MaterialGenerator.generateOreMaterial(RARE_EARTH_HIGH); - + ItemStack aRareEarth = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.RareEarth, 1L); - + Fluid aSulfuric = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid(); - Fluid aHydrocholric = FluidUtils.getFluidStack("hydrochloricacid_gt5u", 1).getFluid(); - Fluid aNitric = FluidUtils.getFluidStack("nitricacid", 1).getFluid(); + Fluid aHydrocholric = FluidUtils.getFluidStack("hydrogenchloride", 1).getFluid(); + Fluid aNitric = FluidUtils.getFluidStack("hydrofluoricacid", 1).getFluid(); + + // LV Rare Earth GT_Values.RA.addChemicalBathRecipe( @@ -52,7 +174,7 @@ public class RECIPES_RareEarthProcessing { new int[] {10000, 10000, 9000}, 20 * 30, (int) GT_Values.V[1]); - + // HV Rare Earth GT_Values.RA.addChemicalBathRecipe( ItemUtils.getSimpleStack(aRareEarth, 6), @@ -63,7 +185,7 @@ public class RECIPES_RareEarthProcessing { new int[] {10000, 9000, 8000}, 20 * 60, (int) GT_Values.V[3]); - + // IV Rare Earth GT_Values.RA.addChemicalBathRecipe( ItemUtils.getSimpleStack(aRareEarth, 9), @@ -74,12 +196,12 @@ public class RECIPES_RareEarthProcessing { new int[] {9000, 8000, 7000}, 20 * 90, (int) GT_Values.V[5]); - - - } - - - public static void processCopperRecipes() { + + + } + + + public static void processCopperRecipes() { // Rare Earth Processing /*GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1), @@ -98,7 +220,7 @@ public class RECIPES_RareEarthProcessing { //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1) }, new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500);*/ - - } + + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index cd5583e223..25d1eb2793 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -221,7 +221,12 @@ public class ItemUtils { if (size < 0 || size > 64) { size = 1; } - Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta); + //Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta); + //Logger.INFO(""+ReflectionUtils.getMethodName(0)); + //Logger.INFO(""+ReflectionUtils.getMethodName(1)); + //Logger.INFO(""+ReflectionUtils.getMethodName(2)); + //Logger.INFO(""+ReflectionUtils.getMethodName(3)); + //Logger.INFO(""+ReflectionUtils.getMethodName(4)); final ItemStack metaStack = new ItemStack(item, size, meta); return metaStack; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 93d81034f6..726fc1869d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -102,6 +102,7 @@ public enum GregtechItemList implements GregtechItemContainer { Carbyne_Sheet_Finished, //End Game Laser Engraver Lens + Laser_Lens_WoodsGlass, Laser_Lens_Special, //Bombs diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 0df892828e..94ddda283d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -255,7 +255,11 @@ public interface IGregtech_RecipeAdder { public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial); - boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, + public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + + + public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); + public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 8fc5996c6e..db691cefc7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -337,6 +337,8 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregTech_API.registerCover(mMachineCasingCovers[i].get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[i][0]}), new GTPP_Cover_ToggleVisual()); } } + GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums", new Object[0])); + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index b8c791b1a0..83704b6af9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -19,11 +19,13 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator; @@ -1115,6 +1117,35 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } + @Override + public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) { + // Generate Special Laser Recipe + GT_Recipe u = new Recipe_GT( + false, + new ItemStack[] { + aInput1, + aInput2, + }, + new ItemStack[] { + aOutput + }, + GregtechItemList.Laser_Lens_WoodsGlass.get(1), + new int[] { + 10000 + }, + new FluidStack[] {}, + new FluidStack[] {}, + time, + (int) eu, + 0); + return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.mRecipeList.add(u); + } + + @Override + public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) { + return addUvLaserRecipe(aInput1, aInput2, aOutput, time, eu); + } + diff --git a/src/resources/assets/miscutils/textures/items/MU-metaitem.01/140.png b/src/resources/assets/miscutils/textures/items/MU-metaitem.01/140.png new file mode 100644 index 0000000000..8b38dcd9ce Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/MU-metaitem.01/140.png differ -- cgit From 82f4a138efb59d8fdc4a492a190d3c8d7c53fbff Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 13 Oct 2019 21:54:43 +0100 Subject: + Added Round-Robinator recipes. % Adjusted Zirconium Carbide tier, and changed the materials used for LV tiered recipes. % Finished work on the Round-Robinator logic. $ Removed PSS log spam. $ Many minor bug fixes. --- src/Java/gtPlusPlus/api/objects/data/AutoMap.java | 7 +- .../gtPlusPlus/api/objects/minecraft/BlockPos.java | 2 +- .../api/objects/minecraft/FakeBlockPos.java | 2 +- src/Java/gtPlusPlus/api/objects/random/XSTR.java | 7 + .../core/block/machine/Machine_RoundRobinator.java | 78 ++- .../core/container/Container_RoundRobinator.java | 247 +++++--- .../core/gui/machine/GUI_RoundRobinator.java | 86 ++- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 46 +- .../core/inventories/Inventory_RoundRobinator.java | 7 +- .../core/item/base/dusts/BaseItemDust.java | 3 +- .../core/item/base/dusts/BaseItemDustUnique.java | 2 +- .../item/base/itemblock/ItemBlockBasicTile.java | 6 +- .../base/itemblock/ItemBlockRoundRobinator.java | 111 ++++ .../core/item/bauble/FireProtectionBauble.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 43 ++ src/Java/gtPlusPlus/core/recipe/common/CI.java | 6 +- .../machines/TileEntityRoundRobinator.java | 695 +++++++++++++++++---- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 28 +- .../gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java | 2 +- .../plugin/fixes/vanilla/VanillaBedHeightFix.java | 2 +- src/Java/gtPlusPlus/preloader/DevHelper.java | 2 +- ...chMetaTileEntity_PowerSubStationController.java | 5 +- src/resources/assets/miscutils/lang/en_US.lang | 11 +- .../RoundRobinator/RoundRobinator_Side_0.png | Bin 0 -> 1448 bytes .../RoundRobinator/RoundRobinator_Side_1.png | Bin 0 -> 1444 bytes .../RoundRobinator/RoundRobinator_Side_2.png | Bin 0 -> 1446 bytes .../RoundRobinator/RoundRobinator_Side_3.png | Bin 0 -> 1446 bytes .../RoundRobinator/RoundRobinator_Side_4.png | Bin 0 -> 1443 bytes .../RoundRobinator/RoundRobinator_Top_0.png | Bin 0 -> 1405 bytes .../RoundRobinator/RoundRobinator_Top_1.png | Bin 0 -> 1403 bytes .../RoundRobinator/RoundRobinator_Top_2.png | Bin 0 -> 1403 bytes .../RoundRobinator/RoundRobinator_Top_3.png | Bin 0 -> 1402 bytes .../RoundRobinator/RoundRobinator_Top_4.png | Bin 0 -> 1400 bytes .../miscutils/textures/gui/RoundRobinator.png | Bin 0 -> 1648 bytes 34 files changed, 1113 insertions(+), 287 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png create mode 100644 src/resources/assets/miscutils/textures/gui/RoundRobinator.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index 3583a04a74..9e7f702200 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -212,11 +212,12 @@ public class AutoMap implements Iterable, Cloneable, Serializable, Collect @Override public boolean retainAll(Collection c) { - AutoMap aTempAllocation = new AutoMap(); + AutoMap aTempAllocation = new AutoMap(); boolean aTrue = false; aTempAllocation = this; - aTempAllocation.removeAll(c); - aTrue = this.removeAll(aTempAllocation); + aTempAllocation.removeAll(c); + aTempAllocation.clear(); + aTrue = aTempAllocation.isEmpty(); aTempAllocation.clear(); return aTrue; } diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java index 7c11e7232b..ab359c3853 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java @@ -19,7 +19,7 @@ public class BlockPos implements Serializable{ public final int yPos; public final int zPos; public final int dim; - public final World world; + public final transient World world; public static BlockPos generateBlockPos(String sUUID) { String[] s2 = sUUID.split("@"); diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java index d0c1f3f040..d5db8081dc 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java @@ -12,7 +12,7 @@ import net.minecraftforge.common.DimensionManager; public class FakeBlockPos extends BlockPos { private static final long serialVersionUID = -6442245826092414593L; - private Block aBlockAtPos; + private transient Block aBlockAtPos; private int aBlockMetaAtPos = 0; public static FakeBlockPos generateBlockPos(String sUUID) { diff --git a/src/Java/gtPlusPlus/api/objects/random/XSTR.java b/src/Java/gtPlusPlus/api/objects/random/XSTR.java index 6357e9895c..6ce1cbeb6c 100644 --- a/src/Java/gtPlusPlus/api/objects/random/XSTR.java +++ b/src/Java/gtPlusPlus/api/objects/random/XSTR.java @@ -115,6 +115,13 @@ public class XSTR extends Random implements Cloneable { */ @Override public XSTR clone() { + try { + super.clone(); + } + catch (CloneNotSupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return new XSTR(this.getSeed()); } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index 71814cb868..8ba7c2533b 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -1,14 +1,25 @@ package gtPlusPlus.core.block.machine; +import java.util.List; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; @@ -19,24 +30,12 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.handler.GuiHandler; -import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.util.minecraft.InventoryUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip { @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; + private IIcon[] textureTop = new IIcon[5]; @SideOnly(Side.CLIENT) - private IIcon textureFront; + private IIcon[] textureFront = new IIcon[5]; /** * Determines which tooltip is displayed within the itemblock. @@ -55,8 +54,8 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt this.setResistance(1f); this.setBlockName("blockRoundRobinator"); this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockRoundRobinator"); - LanguageRegistry.addName(this, "Round-Robinator"); + GameRegistry.registerBlock(this, ItemBlockRoundRobinator.class, "blockRoundRobinator"); + //LanguageRegistry.addName(this, "Round-Robinator"); } @@ -65,19 +64,23 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt */ @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) - { - return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (this.textureFront)); + public IIcon getIcon(final int aSide, final int aMeta) { + if (aSide < 2) { + return this.textureTop[aMeta]; + } + else { + return this.textureFront[aMeta]; + } } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) - { - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); - this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); - this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G"); - this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"); + public void registerBlockIcons(final IIconRegister p_149651_1_){ + this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "RoundRobinator_Side"); + for (int i=0;i<5;i++) { + this.textureTop[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Top_"+i); + this.textureFront[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Side_"+i); + } } /** @@ -109,16 +112,14 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt if (!mDidScrewDriver) { final TileEntity te = world.getTileEntity(x, y, z); if ((te != null) && (te instanceof TileEntityRoundRobinator)){ - player.openGui(GTplusplus.instance, GuiHandler.GUI16, world, x, y, z); - return true; + return ((TileEntityRoundRobinator) te).onRightClick((byte) side, player, x, y, z); } + return false; } else { return true; - } - + } } - return false; } @Override @@ -149,9 +150,7 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt @Override public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { - if (stack.hasDisplayName()) { - ((TileEntityRoundRobinator) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName()); - } + super.onBlockPlacedBy(world, x, y, z, entity, stack); } @Override @@ -159,4 +158,17 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt return false; } + @Override + public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + //super.getSubBlocks(aItem, p_149666_2_, aList); + for (int i=0;i<5;i++) { + aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); + } + } + + @Override + public IIcon getIcon(IBlockAccess aBlockAccess, int x, int y, int z, int aSide) { + return super.getIcon(aBlockAccess, x, y, z, aSide); + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java index ad2aef02f8..0da2933dfa 100644 --- a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java @@ -1,39 +1,52 @@ package gtPlusPlus.core.container; +import java.util.Iterator; + +import org.apache.commons.lang3.ArrayUtils; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.Inventory_RoundRobinator; -import gtPlusPlus.core.slots.SlotIntegratedCircuit; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; public class Container_RoundRobinator extends Container { - protected TileEntityRoundRobinator tile_entity; + public TileEntityRoundRobinator tile_entity; public final Inventory_RoundRobinator inventoryChest; private final World worldObj; private final int posX; private final int posY; private final int posZ; + + private final boolean[] mActiveData = new boolean[] {false, false, false, false}; - public static final int SLOT_OUTPUT = 25; - - public static int StorageSlotNumber = 26; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory + public static int mStorageSlotNumber = 4; // Number of slots in storage area + public static int mInventorySlotNumber = 36; // Inventory Slots (Inventory // and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All + public static int mFullSlotNumber = mInventorySlotNumber + mStorageSlotNumber; // All // slots public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) { this.tile_entity = te; this.inventoryChest = te.getInventory(); + boolean [] aTemp = te.getActiveSides(); + if (aTemp != null && aTemp.length == 4) { + for (int i=0;i<4;i++) { + mActiveData[i] = aTemp[i]; + } + } int var6; int var7; @@ -54,44 +67,20 @@ public class Container_RoundRobinator extends Container { }*/ - int xStart = 8; - int yStart = 5; + int xStart = 134; + int yStart = 32; try { //0 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart, yStart)); - //1-10 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+18)); - //11-20 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+54)); - //21-24 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+54)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart+17)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart+17)); Logger.INFO("2"); //Add Output - this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); - o++; + //this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); + //o++; Logger.INFO("3"); @@ -112,6 +101,7 @@ public class Container_RoundRobinator extends Container { Logger.INFO("4"); } catch (Throwable t) {} + this.detectAndSendChanges(); } @@ -121,10 +111,14 @@ public class Container_RoundRobinator extends Container { if (!aPlayer.worldObj.isRemote) { if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); + } + else if (aSlotIndex < 4) { + this.tile_entity.toggleSide(aSlotIndex+2); + Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString()); } } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + return GT_Values.NI; + //return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @Override @@ -140,51 +134,136 @@ public class Container_RoundRobinator extends Container { return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; } + - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, true)) { return null; } - * - * var4.onSlotChange(var5, var3); } else if (par2 >= - * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if - * (!this.mergeItemStack(var5, InventoryOutSlotNumber, - * FullSlotNumber, false)) { return null; } } else if (par2 >= - * InventoryOutSlotNumber && par2 < FullSlotNumber) { if - * (!this.mergeItemStack(var5, InOutputSlotNumber, - * InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, - * false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - if (var5.stackSize == var3.stackSize) { - return null; - } + public final void addCraftingToCrafters(ICrafting par1ICrafting) { + try { + super.addCraftingToCrafters(par1ICrafting); + } catch (Throwable var3) { + + } + } + + public final void removeCraftingFromCrafters(ICrafting par1ICrafting) { + try { + super.removeCraftingFromCrafters(par1ICrafting); + } catch (Throwable var3) { + } + } - var4.onPickupFromSlot(par1EntityPlayer, var5); + public final void detectAndSendChanges() { + try { + super.detectAndSendChanges(); + detectAndSendChangesEx(); + } catch (Throwable var2) { } + } - return var3; + public final void updateProgressBar(int par1, int par2) { + try { + super.updateProgressBar(par1, par2); + updateProgressBarEx(par1, par2); + } catch (Throwable var4) { + } } + + + public int mSide_1 = 0; + public int mSide_2 = 0; + public int mSide_3 = 0; + public int mSide_4 = 0; + public int mTier = 1; + public int mTickRate = 50; + + private int oSide_1 = 0; + private int oSide_2 = 0; + private int oSide_3 = 0; + private int oSide_4 = 0; + private int oTier = 1; + private int oTickRate = 50; + + private int mTimer = 0; + + + + public void detectAndSendChangesEx() { + super.detectAndSendChanges(); + if (!this.tile_entity.getWorldObj().isRemote) { + boolean [] aTemp = tile_entity.getActiveSides(); + for (int i=0;i<4;i++) { + mActiveData[i] = aTemp[i]; + } + this.mSide_1 = aTemp[0] ? 1 : 0; + this.mSide_2 = aTemp[1] ? 1 : 0; + this.mSide_3 = aTemp[2] ? 1 : 0; + this.mSide_4 = aTemp[3] ? 1 : 0; + this.mTier = this.tile_entity.getTier(); + this.mTickRate = this.tile_entity.getTickRate(); + + String InventoryContents = ArrayUtils.toString(aTemp, "null"); + //Logger.INFO("Test: "+InventoryContents); + ++this.mTimer; + Iterator var2 = this.crafters.iterator(); + + while (true) { + ICrafting var1; + do { + if (!var2.hasNext()) { + this.oSide_1 = this.mSide_1; + this.oSide_2 = this.mSide_2; + this.oSide_3 = this.mSide_3; + this.oSide_4 = this.mSide_4; + this.oTier = this.mTier; + this.oTickRate = this.mTickRate; + return; + } + var1 = (ICrafting) var2.next(); + if (this.mTimer % 500 == 10 || this.oSide_1 != this.mSide_1) { + var1.sendProgressBarUpdate(this, 2, this.mSide_1); + } + if (this.mTimer % 500 == 10 || this.oSide_2 != this.mSide_2) { + var1.sendProgressBarUpdate(this, 4, this.mSide_2); + } + if (this.mTimer % 500 == 10 || this.oSide_3 != this.mSide_3) { + var1.sendProgressBarUpdate(this, 6, this.mSide_3); + } + if (this.mTimer % 500 == 10 || this.oSide_4 != this.mSide_4) { + var1.sendProgressBarUpdate(this, 8, this.mSide_4); + } + if (this.mTimer % 500 == 10 || this.oTier != this.mTier) { + var1.sendProgressBarUpdate(this, 10, this.mTier); + } + if (this.mTimer % 500 == 10 || this.oTickRate != this.mTickRate) { + var1.sendProgressBarUpdate(this, 12, this.mTickRate); + } + } while (this.mTimer % 500 != 10); + + } + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBarEx(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 2 : + this.mSide_1 = par2; + break; + case 4 : + this.mSide_2 = par2; + break; + case 6 : + this.mSide_3 = par2; + case 8 : + this.mSide_4 = par2; + case 10 : + this.mTier = par2; + case 12 : + this.mTickRate = par2; + break; + } - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java index 7a9417c806..c5a8341d8a 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java @@ -1,29 +1,75 @@ package gtPlusPlus.core.gui.machine; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; import gtPlusPlus.core.container.Container_RoundRobinator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class GUI_RoundRobinator extends GuiContainer { private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png"); + private TileEntityRoundRobinator mTile; + private Container_RoundRobinator mContainer; + private static final Method mDrawItemStack; + + static { + mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); + } public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te){ - super(new Container_RoundRobinator(player_inventory, te)); + this(new Container_RoundRobinator(player_inventory, te)); + mTile = te; + } + + private GUI_RoundRobinator(final Container_RoundRobinator aContainer){ + super(aContainer); + mContainer = aContainer; } @Override protected void drawGuiContainerForegroundLayer(final int i, final int j){ - super.drawGuiContainerForegroundLayer(i, j); + super.drawGuiContainerForegroundLayer(i, j); + + int xStart = 134; + int yStart = 31; + mTile = this.mContainer.tile_entity; + + int tier = mContainer.mTier; + int aTickRate = mContainer.mTickRate; + + fontRendererObj.drawString("Round Robinator", 85, 4, Utils.rgbtoHexValue(50, 150, 50)); + fontRendererObj.drawString("Tier: "+tier, 85, 12, Utils.rgbtoHexValue(50, 150, 50)); + fontRendererObj.drawString("Rate: 1 Item/"+aTickRate+"t", 85, 20, Utils.rgbtoHexValue(50, 150, 50)); + + boolean[] aStates = new boolean[] {mContainer.mSide_1 == 0 ? false : true, mContainer.mSide_2 == 0 ? false : true, mContainer.mSide_3 == 0 ? false : true,mContainer.mSide_4 == 0 ? false : true}; + + fontRendererObj.drawString("West: "+(aStates[0] ? "Active" : "Disabled"), 5, 5, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("North: "+(aStates[1] ? "Active" : "Disabled"), 5, 15, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("South: "+(aStates[2] ? "Active" : "Disabled"), 5, 25, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("East: "+(aStates[3] ? "Active" : "Disabled"), 5, 35, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("Toggling South will visually", 5, 65, Utils.rgbtoHexValue(150, 50, 50)); + fontRendererObj.drawString("toggle East, This is a visual bug.", 5, 74, Utils.rgbtoHexValue(150, 50, 50)); + drawStatus(aStates[0], xStart, yStart); + drawStatus(aStates[1], xStart+18, yStart); + drawStatus(aStates[2], xStart, yStart+18); + drawStatus(aStates[3], xStart+18, yStart+18); + } @Override @@ -33,6 +79,34 @@ public class GUI_RoundRobinator extends GuiContainer { final int x = (this.width - this.xSize) / 2; final int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + + + + } + + private static ItemStack aGreenGlass; + private static ItemStack aRedGlass; + + private void drawStatus(boolean aStateActive, int x, int y) { + if (aGreenGlass == null) { + Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem(); + aGreenGlass = ItemUtils.simpleMetaStack(pane, 5, 1); + } + if (aRedGlass == null) { + Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem(); + aRedGlass = ItemUtils.simpleMetaStack(pane, 14, 1); + } + if (mDrawItemStack != null) { + try { + if (aStateActive) { + mDrawItemStack.invoke(this, new Object[]{aGreenGlass, x, y, ""}); + } + else { + mDrawItemStack.invoke(this, new Object[]{aRedGlass, x, y, ""}); + } + } + catch (Throwable t) {} + } } //This method is called when the Gui is first called! diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index 2141210650..e44c9a8f20 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -2,16 +2,22 @@ package gtPlusPlus.core.handler; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.*; +import gtPlusPlus.core.container.Container_BackpackBase; +import gtPlusPlus.core.container.Container_CircuitProgrammer; +import gtPlusPlus.core.container.Container_DecayablesChest; +import gtPlusPlus.core.container.Container_FishTrap; +import gtPlusPlus.core.container.Container_Grindle; +import gtPlusPlus.core.container.Container_ModularityTable; +import gtPlusPlus.core.container.Container_PestKiller; +import gtPlusPlus.core.container.Container_ProjectTable; +import gtPlusPlus.core.container.Container_RoundRobinator; +import gtPlusPlus.core.container.Container_SuperJukebox; +import gtPlusPlus.core.container.Container_TradeTable; +import gtPlusPlus.core.container.Container_Workbench; +import gtPlusPlus.core.container.Container_WorkbenchAdvanced; import gtPlusPlus.core.container.box.LunchBoxContainer; import gtPlusPlus.core.container.box.MagicBagContainer; import gtPlusPlus.core.container.box.ToolBoxContainer; @@ -22,20 +28,38 @@ import gtPlusPlus.core.gui.item.GuiBaseGrindle; import gtPlusPlus.core.gui.item.box.LunchBoxGui; import gtPlusPlus.core.gui.item.box.MagicBagGui; import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.*; +import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; +import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; +import gtPlusPlus.core.gui.machine.GUI_FishTrap; +import gtPlusPlus.core.gui.machine.GUI_ModularityTable; +import gtPlusPlus.core.gui.machine.GUI_PestKiller; +import gtPlusPlus.core.gui.machine.GUI_ProjectTable; +import gtPlusPlus.core.gui.machine.GUI_RoundRobinator; +import gtPlusPlus.core.gui.machine.GUI_SuperJukebox; +import gtPlusPlus.core.gui.machine.GUI_TradeTable; +import gtPlusPlus.core.gui.machine.GUI_Workbench; +import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.inventories.BaseInventoryGrindle; import gtPlusPlus.core.inventories.box.LunchBoxInventory; import gtPlusPlus.core.inventories.box.MagicBagInventory; import gtPlusPlus.core.inventories.box.ToolBoxInventory; -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; import gtPlusPlus.core.tileentities.base.TileEntityBase; import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; -import gtPlusPlus.core.tileentities.machines.*; +import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; +import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; +import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; public class GuiHandler implements IGuiHandler { diff --git a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java index 58d60b595f..a47f250c39 100644 --- a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.inventories; -import gtPlusPlus.core.recipe.common.CI; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -9,10 +8,10 @@ import net.minecraft.nbt.NBTTagList; public class Inventory_RoundRobinator implements IInventory{ - private final String name = "Circuit Programmer"; + private final String name = "Round Robinator"; /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 26; + public static final int INV_SIZE = 4; /** Inventory's size must be same as number of slots you add to the Container class */ private ItemStack[] inventory = new ItemStack[INV_SIZE]; @@ -167,7 +166,7 @@ public class Inventory_RoundRobinator implements IInventory{ */ @Override public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - return (itemstack.getItem() == CI.getNumberedCircuit(0).getItem()); + return true; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 1b13d34495..9022f864cb 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -87,8 +87,7 @@ public class BaseItemDust extends BaseItemComponent { else if (amount == 10) { doesThings[0] = false; doesThings[1] = true; - doesThings[2] = false; - + doesThings[2] = false; } else if (amount == 100) { doesThings[0] = false; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index e1c3e179ee..e4fa06c58e 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -118,7 +118,7 @@ public class BaseItemDustUnique extends Item{ private String getCorrectTexture(final String pileSize){ if (!CORE.ConfigSwitches.useGregtechTextures){ - if ((pileSize == "dust") || (pileSize == "Dust")){ + if ((pileSize.equals("dust")) || (pileSize.equals("Dust"))){ this.setTextureName(CORE.MODID + ":" + "dust");} else{ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index c52eb0d222..42890ddfa6 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -44,11 +44,7 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { // Round-Robinator - list.add("Attempts to output items evenly on all four horizontal planes"); - list.add("Each tier operates at a factor of one operation every (20/tier)ticks"); - list.add("Top and bottom do not pull, so you must push item in"); - list.add("Sides can be disabled with a screwdriver"); + } else if (this.mID == 7) { } else { list.add("Bad Tooltip ID - " + mID); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java new file mode 100644 index 0000000000..fa18d745fb --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -0,0 +1,111 @@ +package gtPlusPlus.core.item.base.itemblock; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class ItemBlockRoundRobinator extends ItemBlockWithMetadata +{ + private final Block mBlock; + + public ItemBlockRoundRobinator(final Block aBlock){ + super(aBlock, aBlock); + this.mBlock = aBlock; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + list.add("Attempts to output items evenly on all four horizontal planes"); + if (stack.getItemDamage() == 0) { + list.add("1 Item per enabled side every 400 ticks"); + } + else if (stack.getItemDamage() == 1) { + list.add("1 Item per enabled side every 100 ticks"); + } + else if (stack.getItemDamage() == 2) { + list.add("1 Item per enabled side every 20 ticks"); + } + else if (stack.getItemDamage() == 3) { + list.add("1 Item per enabled side every 10 ticks"); + } + else if (stack.getItemDamage() == 4) { + list.add("1 Item per enabled side every 1 ticks"); + } + list.add("Top and bottom do not pull, so you must push item in"); + list.add("Sides can also be disabled with a screwdriver"); + super.addInformation(stack, aPlayer, list, bool); + } + + /** + * Gets an icon index based on an item's damage value + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int p_77617_1_) + { + return this.mBlock.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + @Override + public int getMetadata(final int p_77647_1_) + { + return p_77647_1_; + } + + @Override + public String getUnlocalizedName(final ItemStack stack) { + return this.getUnlocalizedName() + "." + stack.getItemDamage(); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return 0; + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java index 93a5a969f7..6a8751b682 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java @@ -29,7 +29,7 @@ public class FireProtectionBauble extends BaseBauble { private static Field isImmuneToFire; static { - isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.IsObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire"); + isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire"); } public static boolean fireImmune(Entity aEntity) { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 0bd5c0cf76..bc1c7fc398 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -230,6 +230,7 @@ public class RECIPES_Machines { fakeMachineCasingCovers(); ztonesCoverRecipes(); superBuses(); + roundRobinators(); } private static void initModItems(){ @@ -2251,4 +2252,46 @@ public class RECIPES_Machines { } + private static void roundRobinators() { + + RecipeUtils.addShapedGregtechRecipe( + ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper), + CI.craftingToolWrench, CI.machineCasing_ULV, CI.craftingToolScrewdriver, + ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1)); + + ItemStack[] aRobinators = new ItemStack[] { + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 1, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 2, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 3, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 4, 1), + }; + + int aCostMultiplier = GTNH ? 2 : 1; + + for (int i = 0; i < 5; i++) { + if (i == 0) { + continue; + } + int aTier = i+1; + ItemStack[] aInputs = new ItemStack[] { + aRobinators[i-1], + CI.getTieredMachineHull(aTier, 1 * aCostMultiplier), + CI.getConveyor(aTier, 2 * aCostMultiplier), + CI.getElectricMotor(aTier, 2 * aCostMultiplier), + CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier), + CI.getTieredComponent(OrePrefixes.circuit, i, 2 * aCostMultiplier), + }; + + CORE.RA.addSixSlotAssemblingRecipe( + aInputs, + CI.getAlternativeTieredFluid(aTier, (144 * 2 * i)), //Input Fluid + aRobinators[i], + 45 * 10 * 1 * (i+1), + MaterialUtils.getVoltageForTier(i)); + + } + } + } diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 15589ada84..63477cda19 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -547,7 +547,7 @@ public class CI { private static final Material[] aMaterial_Main = new Material[] { ALLOY.POTIN, - ALLOY.ZIRCONIUM_CARBIDE, + ALLOY.TUMBAGA, ALLOY.EGLIN_STEEL, ALLOY.INCONEL_792, ALLOY.TUNGSTEN_TITANIUM_CARBIDE, @@ -561,7 +561,7 @@ public class CI { }; private static final Material[] aMaterial_Secondary = new Material[] { - ALLOY.TUMBAGA, + ALLOY.STEEL, ALLOY.SILICON_CARBIDE, ALLOY.TUNGSTEN_CARBIDE, ALLOY.INCONEL_690, @@ -576,7 +576,7 @@ public class CI { }; private static final Material[] aMaterial_Tertiary = new Material[] { - ALLOY.STEEL, + ELEMENT.getInstance().LEAD, ELEMENT.getInstance().ALUMINIUM, ALLOY.STAINLESS_STEEL, ELEMENT.getInstance().TUNGSTEN, diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java index 13ba5ca44d..4950718f4a 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java @@ -1,19 +1,36 @@ package gtPlusPlus.core.tileentities.machines; +import java.util.List; + +import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.handler.GuiHandler; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.sys.KeyboardUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.IHopper; import net.minecraft.tileentity.TileEntity; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.inventories.Inventory_RoundRobinator; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.PlayerUtils; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; -public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory { +public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory, IHopper { private int tickCount = 0; private final Inventory_RoundRobinator inventoryContents; @@ -21,7 +38,9 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent public int locationX; public int locationY; public int locationZ; - private int aCurrentMode = 0; + private int aData = 1111; + private int aTier = 1; + private int aTickRate = 100; public TileEntityRoundRobinator() { this.inventoryContents = new Inventory_RoundRobinator(); @@ -34,6 +53,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.locationX = this.xCoord; this.locationY = this.yCoord; this.locationZ = this.zCoord; + this.aTier = this.getWorldObj().getBlockMetadata(locationX, locationY, locationZ) + 1; return true; } } @@ -41,8 +61,8 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } //Rename to hasCircuitToConfigure - public final boolean hasCircuitToConfigure() { - for (ItemStack i : this.getInventory().getInventory()) { + public final boolean hasInventoryContents() { + for (ItemStack i : this.aHopperInventory) { if (i == null) { continue; } @@ -56,76 +76,54 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent public Inventory_RoundRobinator getInventory() { return this.inventoryContents; } - - public boolean addOutput() { - ItemStack[] aInputs = this.getInventory().getInventory().clone(); - //Check if there is output in slot. - Boolean hasOutput = false; - if (aInputs[25] != null) { - hasOutput = true; - } - AutoMap aValidSlots = new AutoMap(); - int aSlotCount = 0; - for (ItemStack i : aInputs) { - if (i != null) { - aValidSlots.put(aSlotCount); - } - aSlotCount++; - } - for (int e : aValidSlots) { - boolean doAdd = false; - ItemStack g = this.getStackInSlot(e); - int aSize = 0; - ItemStack aInputStack = null; - if (g != null) { - if (!hasOutput) { - aSize = g.stackSize; - doAdd = true; - } - else { - ItemStack f = this.getStackInSlot(25); - if (f != null) { - if (f.getItemDamage() == e) { - aSize = f.stackSize + g.stackSize; - if (aSize > 64) { - aInputStack = g.copy(); - aInputStack.stackSize = (aSize-64); - } - doAdd = true; - } - } - else { - doAdd = true; - aSize = g.stackSize; - } - } - if (doAdd) { - ItemStack aOutput = CI.getNumberedCircuit(e); - if (aOutput != null) { - aOutput.stackSize = aSize; - this.setInventorySlotContents(e, aInputStack); - this.setInventorySlotContents(25, aOutput); - return true; - } - } - } - continue; - } - return false; + + public int getTier() { + return this.aTier; + } + + public int getTickRate() { + return this.aTickRate; } @Override public void updateEntity() { try{ - if (!this.worldObj.isRemote) { - if (tickCount % 10 == 0) { - if (hasCircuitToConfigure()) { - this.addOutput(); - this.markDirty(); + // TODO + if (this.worldObj != null && !this.worldObj.isRemote){ + setTileLocation(); + aTickRate = (60-(aTier*10)); + if (this.getTier() == 1) { + // 20 s + aTickRate = 400; + } + else if (this.getTier() == 2) { + // 5 + aTickRate = 100; + } + else if (this.getTier() == 3) { + // 1 + aTickRate = 20; + } + else if (this.getTier() == 4) { + // 1/5 + aTickRate = 10; + } + else if (this.getTier() == 5) { + // 1/20 + aTickRate = 1; + } + else { + aTickRate = 999999; + } + + if (tickCount % getTickRate() == 0) { + if (hasInventoryContents()) { + Logger.INFO("Trying to move items. "+aTickRate); + this.tryProcessItems(); } } - this.tickCount++; - } + this.tickCount++; + } } catch (final Throwable t){} } @@ -144,55 +142,26 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent @Override public void writeToNBT(final NBTTagCompound nbt) { super.writeToNBT(nbt); - // Utils.LOG_WARNING("Trying to write NBT data to TE."); - final NBTTagCompound chestData = new NBTTagCompound(); - this.inventoryContents.writeToNBT(chestData); - nbt.setTag("ContentsChest", chestData); if (this.hasCustomInventoryName()) { nbt.setString("CustomName", this.getCustomName()); } - nbt.setInteger("aCurrentMode", aCurrentMode); + nbt.setInteger("aCurrentMode", aData); + this.writeToNBT2(nbt); } @Override public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); - // Utils.LOG_WARNING("Trying to read NBT data from TE."); - this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); if (nbt.hasKey("CustomName", 8)) { this.setCustomName(nbt.getString("CustomName")); } - aCurrentMode = nbt.getInteger("aCurrentMode"); - } - - @Override - public int getSizeInventory() { - return this.getInventory().getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.getInventory().getStackInSlot(slot); - } - - @Override - public ItemStack decrStackSize(final int slot, final int count) { - return this.getInventory().decrStackSize(slot, count); - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - return this.getInventory().getStackInSlotOnClosing(slot); - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.getInventory().setInventorySlotContents(slot, stack); + aData = nbt.getInteger("aCurrentMode"); + this.readFromNBT2(nbt); } @Override public int getInventoryStackLimit() { - return this.getInventory().getInventoryStackLimit(); + return 64; } @Override @@ -205,7 +174,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().openInventory(); + //this.getInventory().openInventory(); } @Override @@ -213,32 +182,27 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().closeInventory(); + //this.getInventory().closeInventory(); } @Override public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - return this.getInventory().isItemValidForSlot(slot, itemstack); + return true; } @Override - public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - final int[] accessibleSides = new int[this.getSizeInventory()]; - for (int r=0; r= 0 && p_102007_1_ <= 24; + public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int aSide) { + return aSide < 2; } @Override - public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { - return p_102008_1_ == 25; + public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int aSide) { + return false; } public String getCustomName() { @@ -251,7 +215,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent @Override public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.circuitprogrammer"; + return this.hasCustomInventoryName() ? this.customName : "container.roundrobinator"; } @Override @@ -272,15 +236,37 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.readFromNBT(tag); } - public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) { - try { - if (aCurrentMode == 24) { - aCurrentMode = 0; + + public boolean onRightClick(byte side, EntityPlayer player, int x, int y, int z) { + if (player != null && player.getHeldItem() == null) { + if (!player.isSneaking() && !KeyboardUtils.isShiftKeyDown()) { + player.openGui(GTplusplus.instance, GuiHandler.GUI16, player.getEntityWorld(), x, y, z); } else { - aCurrentMode++; + String InventoryContents = ItemUtils.getArrayStackNames(this.aHopperInventory); + PlayerUtils.messagePlayer(player, "Contents: "+InventoryContents+" | "+getDataString()); + } + return true; + } + else { + return false; + } + } + + public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) { + try { + if (side < 2) { + // Top/Bottom } - PlayerUtils.messagePlayer(player, "Now configuring units for type "+aCurrentMode+"."); + else { + if (toggleSide(side)) { + PlayerUtils.messagePlayer(player, "Enabling side "+side+"."); + } + else { + PlayerUtils.messagePlayer(player, "Disabling side "+side+"."); + } + PlayerUtils.messagePlayer(player, "Mode String: "+aData+""); + } return true; } catch (Throwable t) { @@ -288,4 +274,461 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } } + public int getDataString() { + return aData; + } + + public boolean[] getActiveSides() { + this.markDirty(); + String s = String.valueOf(aData); + if (s == null || s.length() != 4) { + s = "1111"; + } + boolean[] aActiveSides = new boolean[4]; + for (int i=0;i<4;i++) { + char ch = s.charAt(i); + if (ch == '1') { + aActiveSides[i] = true; + } + else { + aActiveSides[i] = false; + } + } + return aActiveSides; + } + + /** + * Toggle active state of side + * @param aSide - Forge Direction / Side + * @return - True if the side is now Active, false if now disabled. + */ + public boolean toggleSide(int aSide) { + setSideActive(!getSideActive(aSide), aSide); + return getSideActive(aSide); + } + + + public void setSideActive(boolean aActive, int aSide) { + try { + if (aSide < 2) { + } + else { + if (aData < 1111) { + aData = 1111; + } + else if (aData > 2222) { + aData = 2222; + } + String s = String.valueOf(aData); + StringBuilder aDataString = new StringBuilder(s); + int aIndex = aSide - 2; + if (aActive) { + aDataString.setCharAt(aIndex, '1'); + } + else { + aDataString.setCharAt(aIndex, '2'); + } + aData = Integer.valueOf(aDataString.toString()); + this.markDirty(); + } + } + catch (Throwable t) { + } + } + + public boolean getSideActive(int aSide) { + this.markDirty(); + try { + if (aSide < 2) { + return false; + } + else { + if (aData < 1111) { + aData = 1111; + } + else if (aData > 2222) { + aData = 2222; + } + String s = String.valueOf(aData); + int aIndex = aSide - 2; + char ch = s.charAt(aIndex); + if (ch == '1') { + return true; + } + else { + return false; + } + + } + } + catch (Throwable t) { + return false; + } + } + + @Override + public double getXPos() { + return this.locationX; + } + + @Override + public double getYPos() { + return this.locationY; + } + + @Override + public double getZPos() { + return this.locationZ; + } + + + + + + + + + // TODO + + + + /* + * Hopper Code + */ + + + private ItemStack[] aHopperInventory = new ItemStack[5]; + + public int getSizeInventory() { + return this.aHopperInventory.length; + } + + public ItemStack getStackInSlot(int aSlot) { + return this.aHopperInventory[aSlot]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int aSlot, int aMinimumSizeOfExistingStack) + { + if (this.aHopperInventory[aSlot] != null) + { + ItemStack itemstack; + + if (this.aHopperInventory[aSlot].stackSize <= aMinimumSizeOfExistingStack) + { + itemstack = this.aHopperInventory[aSlot]; + this.aHopperInventory[aSlot] = null; + return itemstack; + } + else + { + itemstack = this.aHopperInventory[aSlot].splitStack(aMinimumSizeOfExistingStack); + + if (this.aHopperInventory[aSlot].stackSize == 0) + { + this.aHopperInventory[aSlot] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int aSlot) + { + if (this.aHopperInventory[aSlot] != null) + { + ItemStack itemstack = this.aHopperInventory[aSlot]; + this.aHopperInventory[aSlot] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int aSlot, ItemStack aStack) + { + this.aHopperInventory[aSlot] = aStack; + + if (aStack != null && aStack.stackSize > this.getInventoryStackLimit()) + { + aStack.stackSize = this.getInventoryStackLimit(); + } + } + + public boolean tryProcessItems() { + if (this.worldObj != null && !this.worldObj.isRemote) { + boolean didSomething = false; + if (!this.isEmpty()) { + Logger.INFO("Has Items, Trying to push to all active directions."); + didSomething = this.tryPushItemsIntoNeighbours(); + } + if (didSomething) { + this.markDirty(); + return true; + } + } + return false; + } + + /** + * Is Empty + * @return + */ + private boolean isEmpty() { + ItemStack[] aitemstack = this.aHopperInventory; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = aitemstack[j]; + + if (itemstack != null) { + return false; + } + } + + return true; + } + + private boolean tryPushItemsIntoNeighbours() { + + boolean aDidPush = false; + + for (int u = 2; u < 6; u++) { + if (!this.getSideActive(u)) { + Logger.INFO("Not pushing on side "+u); + continue; + } + + Logger.INFO("Pushing on side "+u); + IInventory iinventory = this.getInventoryFromFacing(u); + + if (iinventory == null) { + Logger.INFO("No inventory found."); + continue; + } + else { + + int i = Facing.oppositeSide[u]; + Logger.INFO("Using Opposite direction: "+i); + + if (this.isInventoryFull(iinventory, i)) { + Logger.INFO("Target is full, skipping."); + continue; + } + else { + Logger.INFO("Target has space, let's move a single item."); + for (int j = 0; j < this.getSizeInventory(); ++j) { + if (this.getStackInSlot(j) != null) { + ItemStack itemstack = this.getStackInSlot(j).copy(); + ItemStack itemstack1 = setStackInNeighbour(iinventory, this.decrStackSize(j, 1), i); + if (itemstack1 == null || itemstack1.stackSize == 0) { + iinventory.markDirty(); + aDidPush = true; + continue; + } + this.setInventorySlotContents(j, itemstack); + } + } + } + } + } + + return aDidPush; + } + + private boolean isInventoryFull(IInventory aInv, int aSide) { + if (aInv instanceof ISidedInventory && aSide > -1) { + ISidedInventory isidedinventory = (ISidedInventory)aInv; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide); + + for (int l = 0; l < aint.length; ++l) + { + ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]); + + if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) + { + return false; + } + } + } + else { + int j = aInv.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = aInv.getStackInSlot(k); + + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + } + return true; + } + + public static ItemStack setStackInNeighbour(IInventory aNeighbour, ItemStack aStack, int aSide) { + if (aNeighbour instanceof ISidedInventory && aSide > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)aNeighbour; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide); + + for (int l = 0; l < aint.length && aStack != null && aStack.stackSize > 0; ++l) + { + aStack = tryMoveStack(aNeighbour, aStack, aint[l], aSide); + } + } + else + { + int j = aNeighbour.getSizeInventory(); + + for (int k = 0; k < j && aStack != null && aStack.stackSize > 0; ++k) + { + aStack = tryMoveStack(aNeighbour, aStack, k, aSide); + } + } + + if (aStack != null && aStack.stackSize == 0) + { + aStack = null; + } + + return aStack; + } + + private static boolean canInsertItemIntoNeighbour(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) { + return !aNeighbour.isItemValidForSlot(aSlot, aStack) ? false : !(aNeighbour instanceof ISidedInventory) || ((ISidedInventory)aNeighbour).canInsertItem(aSlot, aStack, aSide); + } + + private static ItemStack tryMoveStack(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) { + ItemStack itemstack1 = aNeighbour.getStackInSlot(aSlot); + if (canInsertItemIntoNeighbour(aNeighbour, aStack, aSlot, aSide)) { + boolean aDidSomething = false; + if (itemstack1 == null) { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit()); + if (max >= aStack.stackSize) { + aNeighbour.setInventorySlotContents(aSlot, aStack); + aStack = null; + } + else { + aNeighbour.setInventorySlotContents(aSlot, aStack.splitStack(max)); + } + aDidSomething = true; + } + else if (areItemStacksEqual(itemstack1, aStack)) { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit()); + if (max > itemstack1.stackSize) { + int l = Math.min(aStack.stackSize, max - itemstack1.stackSize); + aStack.stackSize -= l; + itemstack1.stackSize += l; + aDidSomething = l > 0; + } + } + if (aDidSomething){ + aNeighbour.markDirty(); + } + } + return aStack; + } + + private IInventory getInventoryFromFacing(int aSide) + { + int i = aSide; + return tryFindInvetoryAtXYZ(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i])); + } + + public static IInventory tryFindInvetoryAtXYZ(World aWorld, double aX, double aY, double aZ) + { + IInventory iinventory = null; + int sX = MathHelper.floor_double(aX); + int sY = MathHelper.floor_double(aY); + int sZ = MathHelper.floor_double(aZ); + TileEntity tileentity = aWorld.getTileEntity(sX, sY, sZ); + + if (tileentity != null && tileentity instanceof IInventory) + { + iinventory = (IInventory)tileentity; + + if (iinventory instanceof TileEntityChest) + { + Block block = aWorld.getBlock(sX, sY, sZ); + + if (block instanceof BlockChest) + { + iinventory = ((BlockChest)block).func_149951_m(aWorld, sX, sY, sZ); + } + } + } + + if (iinventory == null) + { + List list = aWorld.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1.0D, aY + 1.0D, aZ + 1.0D), IEntitySelector.selectInventories); + + if (list != null && list.size() > 0) + { + iinventory = (IInventory)list.get(aWorld.rand.nextInt(list.size())); + } + } + + return iinventory; + } + + private static boolean areItemStacksEqual(ItemStack aStack, ItemStack aStack2) { + return aStack.getItem() != aStack2.getItem() ? false : (aStack.getItemDamage() != aStack2.getItemDamage() ? false : (aStack.stackSize > aStack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(aStack, aStack2))); + } + + public void readFromNBT2(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10); + this.aHopperInventory = new ItemStack[this.getSizeInventory()]; + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + if (b0 >= 0 && b0 < this.aHopperInventory.length) { + this.aHopperInventory[b0] = ItemStack.loadItemStackFromNBT( + nbttagcompound1 + ); + } + } + } + + public void writeToNBT2(NBTTagCompound aNBT) { + super.writeToNBT(aNBT); + NBTTagList nbttaglist = new NBTTagList(); + for (int i = 0; i < this.aHopperInventory.length; ++i) { + if (this.aHopperInventory[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.aHopperInventory[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + aNBT.setTag("Items", nbttaglist); + } + + + + + + + } diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index b5f5fa7989..dae1a663d7 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -220,7 +220,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { @Override public int compareTo(CachedRecipe o) { - if (o instanceof DecayableRecipeNEI) { + boolean b = DecayableRecipeNEI.class.isInstance(o); + if (b) { DecayableRecipeNEI p = (DecayableRecipeNEI) o; if (p.time > this.time) { return 1; @@ -232,5 +233,30 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { } return 0; } + + @Override + public boolean equals(Object obj) { + if (obj != null) { + if (DecayableRecipeNEI.class.isInstance(obj)) { + DecayableRecipeNEI p = (DecayableRecipeNEI) obj; + if (p != null) { + // Time check first to keep it simple and not unbox the Recipes. + if (p.time == this.time) { + ItemStack aInput = p.input.item; + ItemStack aOutput = p.output.item; + if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) { + if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) { + return true; + } + } + } + } + + } + } + return false; + } + + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java index 6612ab703f..e3c980e6a4 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java @@ -928,7 +928,7 @@ extends TemplateRecipeHandler { } - public class recipeCompare implements Comparator { + public class RecipeCompare implements Comparator { public int compare(GT_Recipe a, GT_Recipe b) { if (a.mEUt != b.mEUt) { return a.mEUt - b.mEUt; diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java index 5f3b1d8abd..f33cc71fc6 100644 --- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java +++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java @@ -23,7 +23,7 @@ public class VanillaBedHeightFix implements IBugFix { mParent = minstance; if (DevHelper.isValidHelperObject()) { Method m; - if (DevHelper.IsObfuscatedEnvironment()) { + if (DevHelper.isObfuscatedEnvironment()) { m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class); } else { diff --git a/src/Java/gtPlusPlus/preloader/DevHelper.java b/src/Java/gtPlusPlus/preloader/DevHelper.java index d942de503a..81d36d591b 100644 --- a/src/Java/gtPlusPlus/preloader/DevHelper.java +++ b/src/Java/gtPlusPlus/preloader/DevHelper.java @@ -32,7 +32,7 @@ public class DevHelper { - public static boolean IsObfuscatedEnvironment() { + public static boolean isObfuscatedEnvironment() { // Are we in a 'decompiled' environment? boolean deobfuscatedEnvironment = false; byte[] bs; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index dda1a6b0c0..7300b3507b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -21,6 +21,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_PowerSubStation; import gtPlusPlus.xmod.gregtech.api.gui.GUI_PowerSubStation; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; @@ -120,7 +121,9 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe checkMachineProblem(problem); } private void checkMachineProblem(String msg) { - Logger.INFO("Power Sub-Station problem: " + msg); + if (!AsmConfig.disableAllLogging) { + Logger.INFO("Power Sub-Station problem: " + msg); + } } public static int getCellTier(Block aBlock, int aMeta) { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 193df880f0..a66ac39435 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3025,4 +3025,13 @@ item.dustImpureRareEarthIII.name=Impure Rare Earth (III) Dust item.dustPureRareEarthIII.name=Purified Rare Earth (III) Dust item.itemDustRareEarthIII.name=Rare Earth (III) Dust item.itemDustTinyRareEarthIII.name=Tiny Pile of Rare Earth (III) Dust -item.itemDustSmallRareEarthIII.name=Small Pile of Rare Earth (III) Dust \ No newline at end of file +item.itemDustSmallRareEarthIII.name=Small Pile of Rare Earth (III) Dust + + + +//Added 13/10/19 +tile.blockRoundRobinator.0.name=Round Robinator I +tile.blockRoundRobinator.1.name=Round Robinator II +tile.blockRoundRobinator.2.name=Round Robinator III +tile.blockRoundRobinator.3.name=Round Robinator IV +tile.blockRoundRobinator.4.name=Round Robinator V \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png new file mode 100644 index 0000000000..cbf604f2b3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png new file mode 100644 index 0000000000..3b7ac3d50e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png new file mode 100644 index 0000000000..a5a5e2c559 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png new file mode 100644 index 0000000000..b68c900ddd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png new file mode 100644 index 0000000000..df182aeaa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png new file mode 100644 index 0000000000..85bc3f16cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png new file mode 100644 index 0000000000..f82185ebdb Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png new file mode 100644 index 0000000000..345476e03c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png new file mode 100644 index 0000000000..971164eb3e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png new file mode 100644 index 0000000000..5b5bac3ad2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png differ diff --git a/src/resources/assets/miscutils/textures/gui/RoundRobinator.png b/src/resources/assets/miscutils/textures/gui/RoundRobinator.png new file mode 100644 index 0000000000..54c06f22ae Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/RoundRobinator.png differ -- cgit From f41f53aea4d42d26001572b72a1f3e40feb3f159 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 14 Oct 2019 21:19:09 +0100 Subject: + Initial work on Algae. --- src/Java/gtPlusPlus/core/util/Utils.java | 3 - .../plugin/agrichem/AlgaeDefinition.java | 60 ++++++ .../gtPlusPlus/plugin/agrichem/AlgaeUtils.java | 11 + .../gtPlusPlus/plugin/agrichem/Core_Agrichem.java | 2 + .../gtPlusPlus/plugin/agrichem/IAlgalItem.java | 12 ++ .../plugin/agrichem/item/algae/ItemAlgaeBase.java | 235 +++++++++++++++++++++ .../plugin/agrichem/logic/AlgaeGeneticData.java | 130 ++++++++++++ .../agrichem/logic/AlgaeGrowthRequirement.java | 5 + .../textures/items/bioscience/BasicAlgae.png | Bin 0 -> 1122 bytes .../items/bioscience/BasicAlgae_Overlay.png | Bin 0 -> 1045 bytes 10 files changed, 455 insertions(+), 3 deletions(-) create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae_Overlay.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java index 0325198213..c73f9ee7a4 100644 --- a/src/Java/gtPlusPlus/core/util/Utils.java +++ b/src/Java/gtPlusPlus/core/util/Utils.java @@ -378,9 +378,6 @@ public class Utils { } final Color c = new Color(r, g, b); String temp = Integer.toHexString(c.getRGB() & 0xFFFFFF).toUpperCase(); - - // System.out.println( "hex: " + Integer.toHexString( c.getRGB() & - // 0xFFFFFF ) + " hex value:"+temp); temp = Utils.appenedHexNotationToString(String.valueOf(temp)); Logger.WARNING("Made " + temp + " - Hopefully it's not a mess."); Logger.WARNING("It will decode into " + Integer.decode(temp) + "."); diff --git a/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java new file mode 100644 index 0000000000..c6e98581ff --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java @@ -0,0 +1,60 @@ +package gtPlusPlus.plugin.agrichem; + +public enum AlgaeDefinition { + + /* + * In general, the productivity of freshwater algae is primarily limited by + * the availability of the nutrient phosphate (PO4-3), while that of + * marine algae is limited by nitrate (NO3-) or ammonium (NH4+). + * Some algal species, however, may have unusual nutrient requirements, + * and their productivity may be limited by certain micronutrients, + * such as silica, in the case of diatoms. + */ + + Euglenophyta("Euglenophyta", "Euglenoids", true, false, getRGB(147, 168, 50)), + Chrysophyta("Chrysophyta", "Golden-Brown Algae", true, true, getRGB(186, 146, 0)), + Pyrrophyta("Pyrrophyta", "Fire Algae", true, true, getRGB(250, 118, 2)), + Chlorophyta("Chlorophyta", "Green Algae", true, true, getRGB(99, 181, 62)), + Rhodophyta("Rhodophyta", "Red Algae", false, true, getRGB(153, 5, 22)), + Paeophyta("Paeophyta", "Brown Algae", false, true, getRGB(94, 78, 47)), + Xanthophyta("Xanthophyta", "Yellow-Green Algae", true, false, getRGB(118, 138, 16)); + + public final String mScientificName; + public final String mSimpleName; + public final boolean mSaltWater; + public final boolean mFreshWater; + public final int mColour; + + AlgaeDefinition(String aScientificName, String aSimpleName, boolean aFresh, boolean aSalt, int aColour) { + mScientificName = aScientificName; + mSimpleName = aSimpleName; + mFreshWater = aFresh; + mSaltWater = aSalt; + mColour = aColour; + } + + public static AlgaeDefinition getByIndex(int aIndex) { + switch(aIndex) { + default: + case 0: + return Euglenophyta; + case 1: + return Chrysophyta; + case 2: + return Pyrrophyta; + case 3: + return Chlorophyta; + case 4: + return Rhodophyta; + case 5: + return Paeophyta; + case 6: + return Xanthophyta; + } + } + + private final static int getRGB(int r, int g, int b) { + return AlgaeUtils.rgbtoHexValue(r, g, b); + } + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java new file mode 100644 index 0000000000..73ff23888c --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java @@ -0,0 +1,11 @@ +package gtPlusPlus.plugin.agrichem; + +import gtPlusPlus.core.util.Utils; + +public class AlgaeUtils { + + public static int rgbtoHexValue(final int r, final int g, final int b) { + return Utils.rgbtoHexValue(r, g, b); + } + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java index fd346590d4..316e1cc143 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java @@ -2,6 +2,7 @@ package gtPlusPlus.plugin.agrichem; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.plugin.agrichem.fluids.FluidLoader; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase; import gtPlusPlus.plugin.manager.Core_Manager; public class Core_Agrichem implements IPlugin { @@ -17,6 +18,7 @@ public class Core_Agrichem implements IPlugin { @Override public boolean preInit() { FluidLoader.generate(); + new ItemAlgaeBase(); return true; } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java b/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java new file mode 100644 index 0000000000..fada07d062 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java @@ -0,0 +1,12 @@ +package gtPlusPlus.plugin.agrichem; + +import gtPlusPlus.plugin.agrichem.logic.AlgaeGeneticData; +import net.minecraft.item.ItemStack; + +public interface IAlgalItem { + + public abstract AlgaeDefinition getAlgaeType(ItemStack aStack); + + public abstract AlgaeGeneticData getSpeciesData(ItemStack aStack); + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java new file mode 100644 index 0000000000..6b31a42809 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java @@ -0,0 +1,235 @@ +package gtPlusPlus.plugin.agrichem.item.algae; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.plugin.agrichem.AlgaeDefinition; +import gtPlusPlus.plugin.agrichem.IAlgalItem; +import gtPlusPlus.plugin.agrichem.logic.AlgaeGeneticData; +import gtPlusPlus.plugin.agrichem.logic.AlgaeGrowthRequirement; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemAlgaeBase extends Item implements IAlgalItem { + + protected IIcon base; + protected IIcon overlay; + + public ItemAlgaeBase() { + this.setHasSubtypes(true); + this.setMaxDamage(127); + this.setNoRepair(); + this.setMaxStackSize(32); + this.setUnlocalizedName("BasicAlgaeItem"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + if (!p_77663_1_.hasTagCompound() || p_77663_1_.getTagCompound().hasNoTags()) { + p_77663_1_ = initNBT(p_77663_1_); + } + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return EnumChatFormatting.UNDERLINE+super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + int aDam = aStack.getItemDamage(); + try { + aList.add(AlgaeDefinition.getByIndex(aDam).mSimpleName); + if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) { + aStack = initNBT(aStack); + } + else { + NBTTagCompound aNBT = aStack.getTagCompound(); + boolean mRequiresLight = aNBT.getBoolean("mRequiresLight"); + boolean mSaltWater = aNBT.getBoolean("mSaltWater"); + boolean mFreshWater = aNBT.getBoolean("mFreshWater"); + byte mTempTolerance = aNBT.getByte("mTempTolerance"); + float mFertility = aNBT.getFloat("mFertility"); + float mProductionSpeed = aNBT.getFloat("mProductionSpeed"); + byte mLifespan = aNBT.getByte("mLifespan"); + int mGeneration = aNBT.getInteger("mGeneration"); + + aList.add("Requires Light: "+mRequiresLight); + aList.add("Salt Water: "+mSaltWater); + aList.add("Fresh Water: "+mFreshWater); + aList.add("Temp Tolerance: "+mTempTolerance); + aList.add("Growth: "+mFertility); + aList.add("Production: "+mProductionSpeed); + aList.add("Lifespan in days: "+mLifespan); + aList.add("Generation: "+mGeneration); + } + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.uncommon; + } + + @Override + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + for (int i=0;i 5) { + aGenes = new AlgaeGeneticData(); + aTag = aGenes.writeToNBT(); + } + else { + byte aTemp, aLifespan; + float aFert, aSpeed; + + int aDam = aStack.getItemDamage(); + aTemp = (byte) (aDam == 3 ? 0 : aDam == 4 ? 2 : 1); + aLifespan = (byte) (aDam == 3 ? 1 : aDam == 4 ? 3f : 2f); + aFert = (float) (aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f); + aSpeed = (float) (aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f); + + aGenes = new AlgaeGeneticData( + true, true, + AlgaeDefinition.getByIndex(aDam).mSaltWater, AlgaeDefinition.getByIndex(aDam).mFreshWater, + aTemp, + aFert, + aSpeed, + aLifespan, + 0, + new AutoMap()); + aTag = aGenes.writeToNBT(); + } + } + else { + aTag = aStack.getTagCompound(); + } + + + + + return new AlgaeGeneticData(aTag); + } + + + + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java new file mode 100644 index 0000000000..dfe0f50b47 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java @@ -0,0 +1,130 @@ +package gtPlusPlus.plugin.agrichem.logic; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraft.nbt.NBTTagCompound; + +public class AlgaeGeneticData { + + private final int mLifespan; + + private final int mGeneration; + + private final boolean mIsDominant; + + private final boolean mRequiresLight; + + private final boolean mSaltWater; + + private final boolean mFreshWater; + + private final byte mTempTolerance; + + private final float mFertility; + + private final float mProductionSpeed; + + private final AutoMap mSpecialRequirements; + + + public AlgaeGeneticData() { + this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new AutoMap()); + } + + public AlgaeGeneticData(boolean isDominant, boolean requiresLight, boolean isSalt, boolean isFresh, + byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration, AutoMap aRequirements) { + mIsDominant = isDominant; + mRequiresLight = requiresLight; + mSaltWater = isSalt; + mFreshWater = isFresh; + mTempTolerance = aTempTolerance; + mFertility = aFertility; + mProductionSpeed = aSpeed; + mLifespan = aLifespan; + mGeneration = aGeneration; + mSpecialRequirements = aRequirements; + } + + + public AlgaeGeneticData(NBTTagCompound aNBT) { + if (aNBT == null || aNBT.hasNoTags()) { + mIsDominant = true; + mRequiresLight = true; + mSaltWater = true; + mFreshWater = true; + mTempTolerance = 0; + mFertility = 1; + mProductionSpeed = 1; + mLifespan = 30; + mGeneration = 0; + } + else { + mIsDominant = aNBT.getBoolean("mIsDominant"); + mRequiresLight = aNBT.getBoolean("mRequiresLight"); + mSaltWater = aNBT.getBoolean("mSaltWater"); + mFreshWater = aNBT.getBoolean("mFreshWater"); + mTempTolerance = aNBT.getByte("mTempTolerance"); + mFertility = aNBT.getFloat("mFertility"); + mProductionSpeed = aNBT.getFloat("mProductionSpeed"); + mLifespan = aNBT.getByte("mLifespan"); + mGeneration = aNBT.getInteger("mGeneration"); + } + mSpecialRequirements = new AutoMap(); + } + + /** + * In MC Days + */ + public final int getLifespan() { + return this.mLifespan; + } + + public final boolean isDominant() { + return this.mIsDominant; + } + + public final boolean RequiresLight() { + return this.mRequiresLight; + } + + public final boolean isSaltWater() { + return this.mSaltWater; + } + + public final boolean isFreshWater() { + return this.mFreshWater; + } + + public final byte getTempTolerance() { + return this.mTempTolerance; + } + + public final float getFertility() { + return this.mFertility; + } + + public final float getProductionSpeed() { + return this.mProductionSpeed; + } + + public final int getGeneration() { + return this.mGeneration; + } + + public final AutoMap getSpecialRequirements() { + return this.mSpecialRequirements; + } + + public NBTTagCompound writeToNBT() { + NBTTagCompound aGenes = new NBTTagCompound(); + aGenes.setBoolean("mIsDominant", this.mIsDominant); + aGenes.setBoolean("mRequiresLight", this.mRequiresLight); + aGenes.setBoolean("mSaltWater", this.mSaltWater); + aGenes.setBoolean("mFreshWater", this.mFreshWater); + aGenes.setInteger("mLifespan", this.mLifespan); + aGenes.setInteger("mGeneration", this.mGeneration); + aGenes.setByte("mTempTolerance", this.mTempTolerance); + aGenes.setFloat("mFertility", this.mFertility); + aGenes.setFloat("mProductionSpeed", this.mProductionSpeed); + return aGenes; + } +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java new file mode 100644 index 0000000000..6bddc9d085 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java @@ -0,0 +1,5 @@ +package gtPlusPlus.plugin.agrichem.logic; + +public class AlgaeGrowthRequirement { + +} diff --git a/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae.png b/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae.png new file mode 100644 index 0000000000..efa1a6e0ca Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae_Overlay.png b/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae_Overlay.png new file mode 100644 index 0000000000..aaea7803b5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/BasicAlgae_Overlay.png differ -- cgit From 351b0e3bda46103d43890cd5313bbb9b19ab0872 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 16 Oct 2019 16:49:24 +0100 Subject: + Added some new items for Biochem recipes. --- .gitignore | 1 + .../gtPlusPlus/plugin/agrichem/Core_Agrichem.java | 2 + .../plugin/agrichem/block/AgrichemFluids.java | 26 ++++ .../agrichem/item/algae/ItemAgrichemBase.java | 169 +++++++++++++++++++++ src/resources/assets/miscutils/lang/en_US.lang | 28 +++- .../textures/items/bioscience/MetaItem1/0.png | Bin 0 -> 605 bytes .../textures/items/bioscience/MetaItem1/1.png | Bin 0 -> 627 bytes .../textures/items/bioscience/MetaItem1/10.png | Bin 0 -> 516 bytes .../textures/items/bioscience/MetaItem1/11.png | Bin 0 -> 392 bytes .../textures/items/bioscience/MetaItem1/12.png | Bin 0 -> 704 bytes .../textures/items/bioscience/MetaItem1/13.png | Bin 0 -> 373 bytes .../textures/items/bioscience/MetaItem1/14.png | Bin 0 -> 427 bytes .../textures/items/bioscience/MetaItem1/15.png | Bin 0 -> 210 bytes .../textures/items/bioscience/MetaItem1/16.png | Bin 0 -> 157 bytes .../textures/items/bioscience/MetaItem1/17.png | Bin 0 -> 194 bytes .../textures/items/bioscience/MetaItem1/18.png | Bin 0 -> 237 bytes .../textures/items/bioscience/MetaItem1/19.png | Bin 0 -> 174 bytes .../textures/items/bioscience/MetaItem1/2.png | Bin 0 -> 633 bytes .../textures/items/bioscience/MetaItem1/20.png | Bin 0 -> 354 bytes .../textures/items/bioscience/MetaItem1/21.png | Bin 0 -> 273 bytes .../textures/items/bioscience/MetaItem1/22.png | Bin 0 -> 332 bytes .../textures/items/bioscience/MetaItem1/3.png | Bin 0 -> 646 bytes .../textures/items/bioscience/MetaItem1/4.png | Bin 0 -> 622 bytes .../textures/items/bioscience/MetaItem1/5.png | Bin 0 -> 490 bytes .../textures/items/bioscience/MetaItem1/6.png | Bin 0 -> 455 bytes .../textures/items/bioscience/MetaItem1/7.png | Bin 0 -> 452 bytes .../textures/items/bioscience/MetaItem1/8.png | Bin 0 -> 624 bytes .../textures/items/bioscience/MetaItem1/9.png | Bin 0 -> 277 bytes 28 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/0.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/1.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/10.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/11.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/12.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/13.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/14.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/15.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/16.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/17.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/18.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/19.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/2.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/20.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/21.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/3.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/4.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/5.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/6.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/7.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/9.png (limited to 'src/resources') diff --git a/.gitignore b/.gitignore index 2144086d21..9edc02f6d4 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,4 @@ scripts /src/Java/gtPlusPlus/xmod/ob/TileEntitySprinkler_ASM.java /src/Java/gtPlusPlus/xmod/thermalfoundation/asm/OreDictionaryArbiter_ASM.java /GeneratedIcons +/unused libs diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java index 316e1cc143..894a5b2349 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java @@ -2,6 +2,7 @@ package gtPlusPlus.plugin.agrichem; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.plugin.agrichem.fluids.FluidLoader; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase; import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase; import gtPlusPlus.plugin.manager.Core_Manager; @@ -19,6 +20,7 @@ public class Core_Agrichem implements IPlugin { public boolean preInit() { FluidLoader.generate(); new ItemAlgaeBase(); + new ItemAgrichemBase(); return true; } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java new file mode 100644 index 0000000000..ad869afc47 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java @@ -0,0 +1,26 @@ +package gtPlusPlus.plugin.agrichem.block; + +public class AgrichemFluids { + + /* + * Saline Water - saltwater + * Sulfuric Waste Water - sulfuricapatite + * Methanol - methanol + * Hot Water - ic2hotwater + * Acetic Acid + * Propionic Acid + * Fermentation Base + * Ethylene - ethylene + * Ethanol - bioethanol + * Diluted SA - filutedsulfuricacid + * Sulfuric Acid - sulfuricacid + * Urea + * Formaldehyde - fluid.formaldehyde + * Liquid Resin + * Methane - methane + * Benzene - benzene + * Ethylbenzene - fluid.ethylbenzene + * Styrene - styrene + */ + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java new file mode 100644 index 0000000000..b636fa7006 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java @@ -0,0 +1,169 @@ +package gtPlusPlus.plugin.agrichem.item.algae; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemAgrichemBase extends Item { + + protected IIcon base[] = new IIcon[22]; + + /* + * 0 - Algae Biomass + * 1 - Green Algae Biomass + * 2 - Brown Algae Biomass + * 3 - Golden-Brown Algae Biomass + * 4 - Red Algae Biomass + * 5 - Cellulose Fiber + * 6 - Golden-Brown Cellulose Fiber + * 7 - Red Cellulose Fiber + * 8 - Compost + * 9 - Wood Pellet + * 10 - Wood Brick + * 11 - Cellulose Pulp + * 12 - Raw Bio Resin + * 13 - Catalyst Carrier + * 14 - Green Metal Catalyst + * 15 - Alginic Acid + * 16 - Alumina + * 17 - Aluminium Pellet + * 18 - Sodium Aluminate + * 19 - Sodium Hydroxide // Exists in Newer GT + * 20 - Sodium Carbonate + * 21 - Lithium Chloride + */ + + public ItemAgrichemBase() { + this.setHasSubtypes(true); + this.setMaxDamage(127); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setUnlocalizedName("BasicAgrichemItem"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + try { + + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public boolean requiresMultipleRenderPasses() { + return false; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + for (int i=0;i Date: Wed, 16 Oct 2019 20:37:36 +0100 Subject: + Added first batch of Bio Recipes. % Updated some Textures. --- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 15 + .../util/minecraft/gregtech/PollutionUtils.java | 10 + .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 523 +++++++++++++++++++++ .../gtPlusPlus/plugin/agrichem/Core_Agrichem.java | 19 +- .../plugin/agrichem/block/AgrichemFluids.java | 46 ++ .../plugin/agrichem/item/algae/ItemBioChip.java | 138 ++++++ .../xmod/gregtech/api/enums/GregtechItemList.java | 4 +- src/resources/assets/miscutils/lang/en_US.lang | 11 +- .../textures/items/bioscience/MetaItem1/15.png | Bin 210 -> 376 bytes .../textures/items/bioscience/MetaItem1/16.png | Bin 157 -> 397 bytes .../textures/items/bioscience/MetaItem1/17.png | Bin 194 -> 306 bytes .../textures/items/bioscience/MetaItem1/18.png | Bin 237 -> 442 bytes .../textures/items/bioscience/MetaItem1/19.png | Bin 174 -> 347 bytes .../textures/items/bioscience/MetaItem1/20.png | Bin 354 -> 364 bytes .../textures/items/bioscience/MetaItem1/21.png | Bin 273 -> 280 bytes .../textures/items/bioscience/MetaItem1/22.png | Bin 332 -> 0 bytes 16 files changed, 760 insertions(+), 6 deletions(-) create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java create mode 100644 src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java delete mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index 6e1e6ea5ad..b38451bba3 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -103,6 +103,21 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.getInstance().NITROGEN, 1) }); + public static final Material CARBON_MONOXIDE = new Material( + "Carbon Monoxide", + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CARBON, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 1) + }); + public static final Material CARBON_DIOXIDE = new Material( "Carbon Dioxide", MaterialState.PURE_LIQUID, //State diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index 2f42e36bec..a0a684d3c6 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -248,10 +248,20 @@ public class PollutionUtils { else { MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false); } + if (CM != null) { Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); PollutionUtils.mPollutionFluidStacks.put(CM); + ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1); + if (ItemUtils.checkForInvalidItems(cellCD)) { + Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); + MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); + } + } + else { + MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false); } + if (SD != null) { Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it."); PollutionUtils.mPollutionFluidStacks.put(SD); diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java new file mode 100644 index 0000000000..b6e4ce8881 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -0,0 +1,523 @@ +package gtPlusPlus.plugin.agrichem; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gtPlusPlus.core.item.chemistry.AgriculturalChem; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.MISC_MATERIALS; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +public class BioRecipes { + + private static Item mFert; + private static Item mDustDirt; + + private static Fluid mSalineWater; + private static Fluid mDistilledWater; + private static Fluid mThermalWater; + private static Fluid mAir; + private static Fluid mSulfuricWasteWater; + private static Fluid mAmmonia; + private static Fluid mMethanol; + private static Fluid mAceticAcid; + private static Fluid mPropionicAcid; + private static Fluid mLiquidPlastic; + private static Fluid mFermentationBase; + private static Fluid mCarbonDioxide; + private static Fluid mCarbonMonoxide; + private static Fluid mEthylene; + private static Fluid mEthanol; + private static Fluid mChlorine; + private static Fluid mHydrogen; + private static Fluid mDilutedSulfuricAcid; + private static Fluid mSulfuricAcid; + private static Fluid mUrea; + private static Fluid mFormaldehyde; + private static Fluid mLiquidResin; + private static Fluid mMethane; + private static Fluid mBenzene; + private static Fluid mEthylbenzene; + private static Fluid mStyrene; + + + private static final ItemStack getGreenAlgaeRecipeChip() { + return getBioChip(4); + } + private static final ItemStack getBrownAlgaeRecipeChip() { + return getBioChip(8); + } + private static final ItemStack getGoldenBrownAlgaeRecipeChip() { + return getBioChip(12); + } + private static final ItemStack getRedAlgaeRecipeChip() { + return getBioChip(16); + } + + private static final ItemStack getBioChip(int aID) { + return ItemUtils.simpleMetaStack(Core_Agrichem.mBioCircuit, aID, 0); + } + + public static void init() { + Core_Agrichem.mInstance.log("Setting Variables"); + initRecipeVars(); + Core_Agrichem.mInstance.log("Generating Biochip Recipes"); + recipeBioChip(); + Core_Agrichem.mInstance.log("Generating Recipes"); + recipeAlgaeBiomass(); + Core_Agrichem.mInstance.log("Finished with recipes"); + } + + private static final void initRecipeVars() { + mFert = AgriculturalChem.dustOrganicFertilizer; + mDustDirt = AgriculturalChem.dustDirt; + + + mDistilledWater = FluidUtils.getDistilledWater(1).getFluid(); + mSalineWater = FluidUtils.getFluidStack("saltwater", 1).getFluid(); + mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid(); + mAir = FluidUtils.getFluidStack("air", 1).getFluid(); + mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid(); + mAmmonia = MISC_MATERIALS.AMMONIA.getFluid(1).getFluid(); + mEthylene = FluidUtils.getFluidStack("ethylene", 1).getFluid(); + mEthanol = FluidUtils.getFluidStack("bioethanol", 1).getFluid(); + mDilutedSulfuricAcid = FluidUtils.getFluidStack("dilutedsulfuricacid", 1).getFluid(); + mSulfuricAcid = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid(); + mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid(); + mMethane = FluidUtils.getFluidStack("methane", 1).getFluid(); + mBenzene = FluidUtils.getFluidStack("benzene", 1).getFluid(); + mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid(); + mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid(); + mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid(); + mLiquidPlastic = FluidUtils.getFluidStack("plastic", 1).getFluid(); + mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluid(1).getFluid(); + mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluid(1).getFluid(); + mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid(); + mHydrogen = FluidUtils.getFluidStack("hydrogen", 1).getFluid(); + mAceticAcid = AgrichemFluids.mAceticAcid; + mPropionicAcid = AgrichemFluids.mPropionicAcid; + mUrea = AgrichemFluids.mUrea; + mLiquidResin = AgrichemFluids.mLiquidResin; + mFermentationBase = AgrichemFluids.mFermentationBase; + + + + } + + private static void recipeAlgaeBiomass() { + + // TODO + // Add in recipes to get initial Biomass + + recipeGreenAlgae(); + recipeBrownAlgae(); + recipeGoldenBrownAlgae(); + recipeRedAlgae(); + recipeWoodPellets(); + recipeWoodBricks(); + recipeCellulosePulp(); + recipeCatalystCarrier(); + recipeAluminiumSilverCatalyst(); + recipeAceticAcid(); + recipePropionicAcid(); + recipeFermentationBase(); + recipeEthanol(); + recipeCelluloseFibre(); + recipeGoldenBrownCelluloseFiber(); + recipeRedCelluloseFiber(); + recipeSodiumHydroxide(); + recipeSodiumCarbonate(); + recipeAluminiumPellet(); + recipeAlumina(); + recipeAluminium(); + recipeCalciumCarbonate(); + recipeLithiumChloride(); + recipeAlginicAcid(); + recipeSulfuricAcid(); + recipeUrea(); + recipeRawBioResin(); + recipeLiquidResin(); + recipeCompost(); + recipeMethane(); + recipeBenzene(); + recipeStyrene(); + } + + private static void recipeGreenAlgae() { + // Compost + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + + // Turn into Cellulose + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getGreenAlgaeRecipeChip(), + ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 30) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5), + 20 * 30, + 16); + + + } + + private static void recipeBrownAlgae() { + // Compost + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + + // Alginic acid + GT_Values.RA.addExtractorRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 1), + 20 * 15, + 30); + + // Lithium Chloride + GT_Values.RA.addBlastRecipe( + getBrownAlgaeRecipeChip(), + ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mLithiumChloride, 1), + GT_Values.NI, + 120, + 120, + 1200); + + // Sodium Carbonate + CORE.RA.addChemicalRecipe( + getBrownAlgaeRecipeChip(), + ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20), + FluidUtils.getDistilledWater(2000), + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mSodiumCarbonate, 1), + 20 * 30, + 30); + + } + + private static void recipeGoldenBrownAlgae() { + // Compost + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + + // Turn into Cellulose + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getGoldenBrownAlgaeRecipeChip(), + ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 30) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownCelluloseFiber, 5), + 20 * 30, + 64); + + } + + private static void recipeRedAlgae() { + // Compost + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + + // Turn into Cellulose + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getRedAlgaeRecipeChip(), + ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 30) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mRedCelluloseFiber, 5), + 20 * 30, + 256); + + } + + private static void recipeCelluloseFibre() { + + CORE.RA.addChemicalRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 20), + ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 2), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 10), + 30 * 20, + 16); + + // Craft into Wood Pellets + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(2), + ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2), + 20 * 30, + 30); + + // Methanol Extraction + GT_Values.RA.addFluidExtractionRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12), + GT_Values.NI, + FluidUtils.getFluidStack(mMethanol, 50), + 10000, + 20 * 30, + 30); + + // Compost + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5), + ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + + + } + + private static void recipeWoodPellets() { + // Shapeless Recipe + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1) + }, ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2)); + + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(2), + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 8) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2), + 20, + 8); + + // CO2 + CORE.RA.addFluidExtractionRecipe( + GT_Values.NI, + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + FluidUtils.getFluidStack(mCarbonDioxide, 70), + 10*20, + 30); + + + // Add Charcoal Recipe + if (LoadedMods.Railcraft) { + RailcraftUtils.addCokeOvenRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2), + true, + true, + ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3), + GT_Values.NF, + 1200); + } + CORE.RA.addCokeOvenRecipe( + ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + getBioChip(3), + null, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3), + 120, + 16); + + + } + + private static void recipeWoodBricks() { + + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(3), + ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 1), + 100, + 16); + } + + private static void recipeCellulosePulp() { + + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(2), + ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 4) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(Items.paper, 1), + 50, + 16); + } + + private static void recipeCatalystCarrier() { + + } + + private static void recipeAluminiumSilverCatalyst() { + + } + + private static void recipeAceticAcid() { + + } + + private static void recipeFermentationBase() { + + } + + private static void recipePropionicAcid() { + + } + + private static void recipeEthanol() { + + } + + private static void recipeGoldenBrownCelluloseFiber() { + + } + + private static void recipeRedCelluloseFiber() { + + } + + private static void recipeSodiumHydroxide() { + + } + + private static void recipeSodiumCarbonate() { + + } + + private static void recipeAluminiumPellet() { + + } + + private static void recipeAlumina() { + + } + + private static void recipeAluminium() { + + } + + private static void recipeCalciumCarbonate() { + + } + + private static void recipeLithiumChloride() { + + } + + private static void recipeAlginicAcid() { + + } + + private static void recipeSulfuricAcid() { + + } + + private static void recipeUrea() { + + } + + private static void recipeRawBioResin() { + + } + + private static void recipeLiquidResin() { + + } + + private static void recipeCompost() { + + } + + private static void recipeMethane() { + + } + + private static void recipeBenzene() { + + } + + private static void recipeStyrene() { + + } + + private static void recipeBioChip() { + + GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L, new Object[0]), + RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}); + + + long bits = RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE; + + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, + new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, + new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, + new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, + new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, + new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, + new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, + new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, + new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, + new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, + new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, + new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, + new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, + new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, + new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, + new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, + new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, + new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, + new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, + new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, + new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, + new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, + new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, + new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, + new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); + } + + +} diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java index 57c3f765a9..bb467699a7 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java @@ -4,10 +4,13 @@ import java.util.List; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; import gtPlusPlus.plugin.agrichem.fluids.FluidLoader; import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase; import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase; +import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip; import gtPlusPlus.plugin.manager.Core_Manager; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -17,6 +20,7 @@ public class Core_Agrichem implements IPlugin { final static Core_Agrichem mInstance; public static Item mAlgae; + public static Item mBioCircuit; public static Item mAgrichemItem1; /* @@ -75,15 +79,22 @@ public class Core_Agrichem implements IPlugin { } @Override - public boolean preInit() { + public boolean preInit() { + mInstance.log("Generating Fluids"); FluidLoader.generate(); + AgrichemFluids.init(); + mInstance.log("Generating Items"); mAlgae = new ItemAlgaeBase(); mAgrichemItem1 = new ItemAgrichemBase(); + mBioCircuit = new ItemBioChip(); + mInstance.log("Setting Bio Circuit"); + GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit); return true; } @Override public boolean init() { + mInstance.log("Setting Items"); mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1); mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1); mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1); @@ -130,6 +141,7 @@ public class Core_Agrichem implements IPlugin { mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1); mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); + mInstance.log("OreDicting Items"); ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae"); @@ -156,13 +168,14 @@ public class Core_Agrichem implements IPlugin { ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); } ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); - ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); - + ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); return true; } @Override public boolean postInit() { + mInstance.log("Generating Recipes"); + BioRecipes.init(); return true; } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java index ad869afc47..1f686cf810 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java @@ -1,5 +1,9 @@ package gtPlusPlus.plugin.agrichem.block; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + public class AgrichemFluids { /* @@ -22,5 +26,47 @@ public class AgrichemFluids { * Ethylbenzene - fluid.ethylbenzene * Styrene - styrene */ + + public static Fluid mAceticAcid; + public static Fluid mPropionicAcid; + public static Fluid mFermentationBase; + public static Fluid mUrea; + public static Fluid mLiquidResin; + + + public static void init() { + if (!FluidRegistry.isFluidRegistered("aceticacid")) { + mAceticAcid = FluidUtils.generateFluidNoPrefix("aceticacid", "Acetic Acid", 200, new short[] { 97, 168, 96, 100 }, true); + } + else { + mAceticAcid = FluidRegistry.getFluid("aceticacid"); + } + if (!FluidRegistry.isFluidRegistered("propionicacid")) { + mPropionicAcid = FluidUtils.generateFluidNoPrefix("propionicacid", "Propionic Acid", 200, new short[] { 198, 209, 148, 100 }, true); + } + else { + mPropionicAcid = FluidRegistry.getFluid("propionicacid"); + } + if (!FluidRegistry.isFluidRegistered("fermentation.base")) { + mFermentationBase = FluidUtils.generateFluidNoPrefix("fermentation.base", "Fermentation Base", 200, new short[] { 107, 100, 63, 100 }, true); + } + else { + mFermentationBase = FluidRegistry.getFluid("fermentation.base"); + } + if (!FluidRegistry.isFluidRegistered("ureamix")) { + mUrea = FluidUtils.generateFluidNoPrefix("ureamix", "Urea Mix", 200, new short[] { 71, 55, 12, 100 }, true); + } + else { + mUrea = FluidRegistry.getFluid("ureamix"); + } + if (!FluidRegistry.isFluidRegistered("liquidresin")) { + mLiquidResin = FluidUtils.generateFluidNoPrefix("liquidresin", "Liquid Resin", 200, new short[] { 59, 58, 56, 100 }, true); + } + else { + mLiquidResin = FluidRegistry.getFluid("liquidresin"); + } + } + + } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java new file mode 100644 index 0000000000..5ecfbbabe9 --- /dev/null +++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java @@ -0,0 +1,138 @@ +package gtPlusPlus.plugin.agrichem.item.algae; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemBioChip extends Item { + + protected IIcon base; + + public ItemBioChip() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + this.setUnlocalizedName("BioRecipeSelector"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + try { + aList.add("Configuration == "+aStack.getItemDamage()); + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1)); + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return stack.getItemDamage(); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } + + @Override + public void registerIcons(final IIconRegister u) { + this.base = u.registerIcon(CORE.MODID + ":" + "bioscience/BioCircuit"); + } + + @Override + public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { + return this.base; + } + + @Override + public IIcon getIconFromDamage(int damage) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return this.base; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName(); + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 726fc1869d..7a83392c07 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -39,6 +39,9 @@ public enum GregtechItemList implements GregtechItemContainer { Emitter_ULV, Sensor_ULV, + //Recipe Circuit + Circuit_BioRecipeSelector, + //Circuits Old_Circuit_Primitive, Old_Circuit_Basic, Old_Circuit_Good, Old_Circuit_Advanced, Old_Circuit_Data, Old_Circuit_Elite, @@ -611,7 +614,6 @@ public enum GregtechItemList implements GregtechItemContainer { private ItemStack mStack; private boolean mHasNotBeenSet = true; - public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas; @Override public GregtechItemList set(final Item aItem) { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index fe78eaf5ea..cbba0cc3d8 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3038,6 +3038,14 @@ tile.blockRoundRobinator.4.name=Round Robinator V //Added 16/10/19 + +item.BioRecipeSelector.name=Programmed Circuit +item.FermentationBase.name=Cell of Fermentation Base +item.ureamix.name=Cell of Urea Mix +item.liquidresin.name=Cell of Liquid Resin +item.propionicacid.name=Propionic Acid Cell +item.aceticacid.name=Acetic Acid Cell + item.BasicAgrichemItem.0.name=Algae Biomass item.BasicAgrichemItem.1.name=Green Algae Biomass item.BasicAgrichemItem.2.name=Brown Algae Biomass @@ -3059,5 +3067,4 @@ item.BasicAgrichemItem.17.name=Aluminium Pellet item.BasicAgrichemItem.18.name=Sodium Aluminate item.BasicAgrichemItem.19.name=Sodium Hydroxide item.BasicAgrichemItem.20.name=Sodium Carbonate -item.BasicAgrichemItem.21.name=Carlcium Carbonate -item.BasicAgrichemItem.22.name=Lithium Chloride \ No newline at end of file +item.BasicAgrichemItem.21.name=Lithium Chloride \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/15.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/15.png index 7b10c11773..31951671cd 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/15.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/15.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/16.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/16.png index 7a78764496..2c6e0b8cb6 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/16.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/16.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/17.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/17.png index 677a1aa6d0..4309f3a975 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/17.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/17.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/18.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/18.png index 5b1833bea9..e82660e9f8 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/18.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/18.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/19.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/19.png index a8b45c9288..dc2070e635 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/19.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/19.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/20.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/20.png index ab9ddf3e1b..9b536f84d0 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/20.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/20.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/21.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/21.png index 042d30a9a9..1a04c2415c 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/21.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/21.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png deleted file mode 100644 index 1aa59863ea..0000000000 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png and /dev/null differ -- cgit From 68e266e0a227aaf90294d2a8ffd5081dc3bb640e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 24 Oct 2019 00:58:51 +0100 Subject: + Added Chemical Plant. + Added more Bio Recipes. $ Fixed Strontium Hydroxide generating before it's components. $ Fixed existing Bio Recipes not working. --- src/Java/gregtech/api/util/Recipe_GT.java | 18 + .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + src/Java/gtPlusPlus/core/item/ModItems.java | 8 +- .../core/item/chemistry/AgriculturalChem.java | 183 ++++- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 36 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 10 +- .../core/slots/SlotChemicalPlantInput.java | 45 ++ .../gtPlusPlus/core/slots/SlotNoInputLogging.java | 25 + .../gtPlusPlus/core/util/minecraft/FluidUtils.java | 6 +- src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java | 456 ++++++++++++ src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 7 +- .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 817 ++++++++++++++++++--- .../gtPlusPlus/plugin/agrichem/Core_Agrichem.java | 134 +--- .../plugin/agrichem/block/AgrichemFluids.java | 16 + .../xmod/forestry/bees/custom/GTPP_Bees.java | 1 - .../xmod/gregtech/api/enums/GregtechItemList.java | 6 +- .../gui/fluidreactor/Container_FluidReactor.java | 182 +++++ .../api/gui/fluidreactor/GUI_FluidReactor.java | 122 +++ .../interfaces/internal/IGregtech_RecipeAdder.java | 7 + .../common/blocks/textures/TexturesGtBlock.java | 9 +- .../GregtechMetaTileEntity_ChemicalReactor.java | 706 ++++++++++++++++++ .../gregtech/loaders/RecipeGen_FluidCanning.java | 63 +- .../xmod/gregtech/loaders/RecipeGen_Fluids.java | 20 +- .../xmod/gregtech/loaders/RecipeGen_Recycling.java | 2 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 48 ++ .../gregtech/GregtechFluidReactor.java | 24 + .../xmod/growthcraft/fishtrap/FishTrapHandler.java | 4 +- .../recipe/TF_Gregtech_Recipes.java | 6 +- .../TileEntities/FluidReactor/OVERLAY_FRONT.png | Bin 0 -> 313 bytes .../FluidReactor/OVERLAY_FRONT_ACTIVE.png | Bin 0 -> 704 bytes .../FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta | 6 + .../TileEntities/FluidReactor/OVERLAY_SIDE.png | Bin 0 -> 333 bytes .../FluidReactor/OVERLAY_SIDE_ACTIVE.png | Bin 0 -> 1049 bytes .../FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta | 6 + .../TileEntities/FluidReactor/OVERLAY_TOP.png | Bin 0 -> 228 bytes .../FluidReactor/OVERLAY_TOP_ACTIVE.png | Bin 0 -> 224 bytes .../assets/miscutils/textures/gui/FluidReactor.png | Bin 0 -> 3587 bytes .../textures/items/bioscience/BioCircuit.png | Bin 0 -> 432 bytes .../textures/items/bioscience/MetaItem1/8.png | Bin 624 -> 654 bytes 39 files changed, 2640 insertions(+), 334 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java create mode 100644 src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java create mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/gui/FluidReactor.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png (limited to 'src/resources') diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index 1e37c9be13..af7fe38f38 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -18,6 +18,7 @@ import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.nei.GT_NEI_MultiBlockHandler; @@ -260,6 +261,23 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ //Basic Washer Map public static final GT_Recipe_Map sSimpleWasherRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); + + public static final Gregtech_Recipe_Map sFluidChemicalReactorRecipes = new Gregtech_Recipe_Map( + new HashSet(100), + "gt.recipe.fluidchemicaleactor", + "Chemical Plant", + null, + CORE.MODID+":textures/gui/FluidReactor", + 0, + 0, + 0, + 2, + 1, + "Tier: ", + 1, + E, + true, + false); //RTG Fuel Map diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index fd30457b46..0b1078366a 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -135,6 +135,7 @@ public class COMPAT_HANDLER { GregtechSolarTower.run(); GregtechLargeTurbinesAndHeatExchanger.run(); GregtechPowerBreakers.run(); + GregtechFluidReactor.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 96fe5694cc..8bfcfe2d70 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -1055,10 +1055,10 @@ public final class ModItems { GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron)); GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1)); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9); } else { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index fd0d044c05..324a3aa9ee 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item.chemistry; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.List; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -15,6 +16,11 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.plugin.agrichem.BioRecipes; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase; +import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -71,6 +77,60 @@ public class AgriculturalChem extends ItemPackage { // Fertilizer + + public static Item mAlgae; + public static Item mBioCircuit; + public static Item mAgrichemItem1; + + /* + * 0 - Algae Biomass + * 1 - Green Algae Biomass + * 2 - Brown Algae Biomass + * 3 - Golden-Brown Algae Biomass + * 4 - Red Algae Biomass + * 5 - Cellulose Fiber + * 6 - Golden-Brown Cellulose Fiber + * 7 - Red Cellulose Fiber + * 8 - Compost + * 9 - Wood Pellet + * 10 - Wood Brick + * 11 - Cellulose Pulp + * 12 - Raw Bio Resin + * 13 - Catalyst Carrier + * 14 - Green Metal Catalyst + * 15 - Alginic Acid + * 16 - Alumina + * 17 - Aluminium Pellet + * 18 - Sodium Aluminate + * 19 - Sodium Hydroxide // Exists in Newer GT + * 20 - Sodium Carbonate + * 21 - Lithium Chloride + */ + + public static ItemStack mAlgaeBiosmass; + public static ItemStack mGreenAlgaeBiosmass; + public static ItemStack mBrownAlgaeBiosmass; + public static ItemStack mGoldenBrownAlgaeBiosmass; + public static ItemStack mRedAlgaeBiosmass; + public static ItemStack mCelluloseFiber; + public static ItemStack mGoldenBrownCelluloseFiber; + public static ItemStack mRedCelluloseFiber; + public static ItemStack mCompost; + public static ItemStack mWoodPellet; + public static ItemStack mWoodBrick; + public static ItemStack mCellulosePulp; + public static ItemStack mRawBioResin; + public static ItemStack mCatalystCarrier; + public static ItemStack mGreenCatalyst; + public static ItemStack mAlginicAcid; + public static ItemStack mAlumina; + public static ItemStack mAluminiumPellet; + public static ItemStack mSodiumAluminate; + public static ItemStack mSodiumHydroxide; + public static ItemStack mSodiumCarbonate; + public static ItemStack mLithiumChloride; + + @Override public void items() { // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon @@ -82,7 +142,91 @@ public class AgriculturalChem extends ItemPackage { "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0]; // Dirt Dust :) - dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0]; + dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0]; + + mAlgae = new ItemAlgaeBase(); + mAgrichemItem1 = new ItemAgrichemBase(); + mBioCircuit = new ItemBioChip(); + GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit); + + + + mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1); + mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1); + mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1); + mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1); + mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1); + mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1); + mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1); + mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1); + mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1); + mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1); + mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1); + mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1); + mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1); + mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1); + mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1); + mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1); + mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1); + mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1); + mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1); + + /** + * If It exists, don't add a new one. + */ + if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) { + List aTest = OreDictionary.getOres("dustSodiumHydroxide", false); + ItemStack aTestStack; + if (aTest.isEmpty()) { + aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false); + if (aTest.isEmpty()) { + aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); + } + else { + aTestStack = aTest.get(0); + } + } + else { + aTestStack = aTest.get(0); + } + mSodiumHydroxide = aTestStack; + } + else { + mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); + } + mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1); + mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); + + ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); + ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); + ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae"); + ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae"); + + ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose"); + ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose"); + + ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood"); + ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood"); + ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose"); + + ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty"); + ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver"); + ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid"); + ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina"); + ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium"); + + ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate"); + if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) { + ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); + } + ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); + ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + + + } @Override @@ -156,20 +300,20 @@ public class AgriculturalChem extends ItemPackage { } - private static AutoMap mMeats = new AutoMap(); - private static AutoMap mFish = new AutoMap(); - private static AutoMap mFruits = new AutoMap(); - private static AutoMap mVege = new AutoMap(); - private static AutoMap mNuts = new AutoMap(); - private static AutoMap mSeeds = new AutoMap(); - private static AutoMap mPeat = new AutoMap(); - private static AutoMap mBones = new AutoMap(); - private static AutoMap mBoneMeal = new AutoMap(); - - private static AutoMap mList_Master_Meats = new AutoMap(); - private static AutoMap mList_Master_FruitVege = new AutoMap(); - private static AutoMap mList_Master_Bones = new AutoMap(); - private static AutoMap mList_Master_Seeds = new AutoMap(); + public final static AutoMap mMeats = new AutoMap(); + public final static AutoMap mFish = new AutoMap(); + public final static AutoMap mFruits = new AutoMap(); + public final static AutoMap mVege = new AutoMap(); + public final static AutoMap mNuts = new AutoMap(); + public final static AutoMap mSeeds = new AutoMap(); + private final static AutoMap mPeat = new AutoMap(); + private final static AutoMap mBones = new AutoMap(); + private final static AutoMap mBoneMeal = new AutoMap(); + + public final static AutoMap mList_Master_Meats = new AutoMap(); + public final static AutoMap mList_Master_FruitVege = new AutoMap(); + public final static AutoMap mList_Master_Seeds = new AutoMap(); + private final static AutoMap mList_Master_Bones = new AutoMap(); private static void processAllOreDict() { processOreDict("listAllmeatraw", mMeats); @@ -323,6 +467,10 @@ public class AgriculturalChem extends ItemPackage { } } } + + public static ItemStack aFertForestry; + public static ItemStack aFertIC2; + private static void addMiscRecipes() { @@ -342,6 +490,7 @@ public class AgriculturalChem extends ItemPackage { Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound"); Object aItemInstance = aFertField.get(aItemRegInstance); if (aItemInstance instanceof Item) { + aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance); Item aForestryFert = (Item) aItemInstance; CORE.RA.addDehydratorRecipe( new ItemStack[] { CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null, @@ -359,6 +508,7 @@ public class AgriculturalChem extends ItemPackage { * IC2 Support */ if (LoadedMods.IndustrialCraft2) { + aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1); CORE.RA.addDehydratorRecipe( new ItemStack[] { CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null, null, new ItemStack[] { ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod, @@ -414,6 +564,9 @@ public class AgriculturalChem extends ItemPackage { addAdvancedOrganiseFertRecipes(); addMiscRecipes(); + + BioRecipes.init(); + return true; } } diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index b38451bba3..8dad69f70a 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -38,24 +38,6 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.getInstance().OXYGEN, 1) }); - public static final Material STRONTIUM_HYDROXIDE = new Material( - "Strontium Hydroxide", - MaterialState.SOLID, - TextureSet.SET_METALLIC, - null, - -1, - -1, - -1, - -1, - false, - "Sr(OH)2", - 0, - false, - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1), - new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2) - }); - public static final Material SELENIUM_DIOXIDE = new Material( "Selenium Dioxide", MaterialState.PURE_LIQUID, //State @@ -303,6 +285,24 @@ public final class MISC_MATERIALS { new MaterialStack(SODIUM_CHLORIDE, 2), }); + public static final Material STRONTIUM_HYDROXIDE = new Material( + "Strontium Hydroxide", + MaterialState.SOLID, + TextureSet.SET_METALLIC, + null, + -1, + -1, + -1, + -1, + false, + "Sr(OH)2", + 0, + false, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1), + new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2) + }); + } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index f237eb9f37..3f631e0bca 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1588,18 +1588,18 @@ public class RECIPES_GREGTECH { private static void fluidExtractorRecipes() { //FLiBe fuel - CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), null, + CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), FluidUtils.getFluidStack("li2bef4", 144), 100, 500); //LFTR Fuel 1 - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), null, + CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), null, + CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), null, + CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500); //ZIRCONIUM_TETRAFLUORIDE - CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), null, + CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256); diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java new file mode 100644 index 0000000000..6cd13dc209 --- /dev/null +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -0,0 +1,45 @@ +package gtPlusPlus.core.slots; + +import gregtech.api.util.Recipe_GT; +import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class SlotChemicalPlantInput extends Slot { + + public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) { + super(inventory, index, x, y); + } + + @Override + public boolean isItemValid(final ItemStack itemstack) { + return isItemValidForChemicalPlantSlot(itemstack); + } + + public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { + boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack); + if (!validItem) { + for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) { + if (f.mFluidInputs.length > 0) { + for (FluidStack g : f.mFluidInputs) { + if (g != null) { + if (FluidContainerRegistry.containsFluid(aStack, g)) { + return true; + } + } + } + } + } + } + return validItem; + } + + @Override + public int getSlotStackLimit() { + return 64; + } + +} diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java new file mode 100644 index 0000000000..42bc7ce346 --- /dev/null +++ b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java @@ -0,0 +1,25 @@ +package gtPlusPlus.core.slots; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public class SlotNoInputLogging extends SlotNoInput { + + private final int aSlotIndex; + + public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) { + super(inventory, index, x, y); + aSlotIndex = index; + } + + @Override + public boolean isItemValid(final ItemStack itemstack) { + if (ItemUtils.checkForInvalidItems(itemstack)) { + Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex); + } + return false; + } + +} diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index 8902947c0d..d7b6bc0a30 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -463,8 +463,7 @@ public class FluidUtils { if (dustStack != null){ CORE.RA.addFluidExtractionRecipe( - dustStack, //Input - null, //Input 2 + dustStack, //Input 2 FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output 1*20, //Duration 16 //Eu Tick @@ -472,8 +471,7 @@ public class FluidUtils { } if (dustStack2 != null){ CORE.RA.addFluidExtractionRecipe( - dustStack2, //Input - null, //Input 2 + dustStack2, //Input 2 FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output 1*20, //Duration 16 //Eu Tick diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java new file mode 100644 index 0000000000..5c5d1169aa --- /dev/null +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -0,0 +1,456 @@ +package gtPlusPlus.nei; + +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.common.event.FMLInterModComms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gtPlusPlus.core.lib.CORE; +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.guihook.IContainerInputHandler; +import codechicken.nei.guihook.IContainerTooltipHandler; +import codechicken.nei.recipe.*; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GT_NEI_FluidReactor +extends TemplateRecipeHandler { + public static final int sOffsetX = 5; + public static final int sOffsetY = 11; + + static { + GuiContainerManager.addInputHandler(new GT_RectHandler()); + GuiContainerManager.addTooltipHandler(new GT_RectHandler()); + } + + protected final Gregtech_Recipe_Map mRecipeMap; + + public GT_NEI_FluidReactor(final Gregtech_Recipe_Map sfluidchemicalreactorrecipes) { + this.mRecipeMap = sfluidchemicalreactorrecipes; + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0])); + if (!NEI_GT_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } + + public static void drawText(final int aX, final int aY, final String aString, final int aColor) { + Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_FluidReactor(this.mRecipeMap); + } + + @Override + public void loadCraftingRecipes(final String outputId, final Object... results) { + if (outputId.equals(this.getOverlayIdentifier())) { + for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { + if (!tRecipe.mHidden) { + this.arecipes.add(new CachedDefaultRecipe(tRecipe)); + } + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(final ItemStack aResult) { + final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); + + final ArrayList tResults = new ArrayList(); + tResults.add(aResult); + tResults.add(GT_OreDictUnificator.get(true, aResult)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); + if (tFluid != null) { + tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + if (tData.fluid.isFluidEqual(tFluid)) { + tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); + } + } + } + for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { + if (!tRecipe.mHidden) { + final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + for (final ItemStack tStack : tResults) { + if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { + this.arecipes.add(tNEIRecipe); + break; + } + } + } + } + } + + @Override + public void loadUsageRecipes(final ItemStack aInput) { + final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); + + final ArrayList tInputs = new ArrayList(); + tInputs.add(aInput); + tInputs.add(GT_OreDictUnificator.get(false, aInput)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); + if (tFluid != null) { + tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { + if (tData.fluid.isFluidEqual(tFluid)) { + tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); + } + } + } + for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { + if (!tRecipe.mHidden) { + final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + for (final ItemStack tStack : tInputs) { + if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { + this.arecipes.add(tNEIRecipe); + break; + } + } + } + } + } + + @Override + public String getOverlayIdentifier() { + return this.mRecipeMap.mNEIName; + } + + @Override + public void drawBackground(final int recipe) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); + } + + @Override + public int recipiesPerPage() { + return 1; + } + + @Override + public String getRecipeName() { + return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); + } + + @Override + public String getGuiTexture() { + return CORE.MODID+":textures/gui/FluidReactor.png"; + } + + @Override + public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { + final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); + if ((tObject instanceof CachedDefaultRecipe)) { + final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; + for (final PositionedStack tStack : tRecipe.mOutputs) { + if (aStack == tStack.item) { + if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { + break; + } + currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); + break; + } + } + for (final PositionedStack tStack : tRecipe.mInputs) { + if (aStack == tStack.item) { + if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || + (tStack.item.stackSize != 0)) { + break; + } + currenttip.add("Does not get consumed in the process"); + break; + } + } + } + return currenttip; + } + + @Override + public void drawExtras(final int aRecipeIndex) { + final int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + if (tEUt != 0) { + drawText(10, 73, "Total: " + (tDuration * tEUt) + " EU", -16777216); + drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); + if (this.mRecipeMap.mShowVoltageAmperageInNEI) { + drawText(10, 93, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); + drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); + } else { + drawText(10, 93, "Voltage: unspecified", -16777216); + drawText(10, 103, "Amperage: unspecified", -16777216); + } + } + if (tDuration > 0) { + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); + } + if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { + drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } + } + + public static class GT_RectHandler + implements IContainerInputHandler, IContainerTooltipHandler { + @Override + public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { + if (this.canHandle(gui)) { + if (button == 0) { + return this.transferRect(gui, false); + } + if (button == 1) { + return this.transferRect(gui, true); + } + } + return false; + } + + @Override + public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { + return false; + } + + public boolean canHandle(final GuiContainer gui) { + return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + } + + @Override + public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { + if ((this.canHandle(gui)) && (currenttip.isEmpty())) { + if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { + currenttip.add("Recipes"); + } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { + currenttip.add("Recipes"); + }*/ + + } + return currenttip; + } + + private boolean transferRect(final GuiContainer gui, final boolean usage) { + if (gui instanceof GT_GUIContainer_BasicMachine) { + return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); + } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { + return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); + }*/ + return false; + } + + @Override + public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { + return currenttip; + } + + @Override + public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { + return currenttip; + } + + @Override + public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { + return false; + } + + @Override + public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { + } + + @Override + public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { + } + + @Override + public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { + } + + @Override + public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { + return false; + } + + @Override + public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { + } + + @Override + public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { + } + } + + public class FixedPositionedStack + extends PositionedStack { + public final int mChance; + public boolean permutated = false; + + public FixedPositionedStack(final Object object, final int x, final int y) { + this(object, x, y, 0); + } + + public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { + super(object, x, y, true); + this.mChance = aChance; + } + + @Override + public void generatePermutations() { + if (this.permutated) { + return; + } + final ArrayList tDisplayStacks = new ArrayList(); + for (final ItemStack tStack : this.items) { + if (GT_Utility.isStackValid(tStack)) { + if (tStack.getItemDamage() == 32767) { + final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); + if (!permutations.isEmpty()) { + ItemStack stack; + for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { + stack = i$.next(); + } + } else { + final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); + base.stackTagCompound = tStack.stackTagCompound; + tDisplayStacks.add(base); + } + } else { + tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); + } + } + } + this.items = (tDisplayStacks.toArray(new ItemStack[0])); + if (this.items.length == 0) { + this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; + } + this.permutated = true; + this.setPermutationToRender(0); + } + } + + public class CachedDefaultRecipe + extends TemplateRecipeHandler.CachedRecipe { + public final GT_Recipe mRecipe; + public final List mOutputs = new ArrayList(); + public final List mInputs = new ArrayList(); + + public CachedDefaultRecipe(final GT_Recipe aRecipe) { + super(); + this.mRecipe = aRecipe; + + int tStartIndex = 0; + + // Four Input Slots + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 3, -4)); + } + tStartIndex++; + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 21, -4)); + } + tStartIndex++; + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 39, -4)); + } + tStartIndex++; + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 57, -4)); + } + tStartIndex++; + + + if (aRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + } + tStartIndex = 0; + + //Four Output Slots + if (aRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + } + tStartIndex++; + if (aRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + } + tStartIndex++; + if (aRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + } + tStartIndex++; + if (aRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + } + tStartIndex++; + + + //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) + if (aRecipe.mFluidInputs.length >= 1) { + if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31)); + } + if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31)); + } + if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31)); + } + if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31)); + } + } + + if (aRecipe.mFluidOutputs.length > 0) { + if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5)); + } + if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23)); + } + } + } + + @Override + public List getIngredients() { + return this.getCycledIngredients(GT_NEI_FluidReactor.this.cycleticks / 10, this.mInputs); + } + + @Override + public PositionedStack getResult() { + return null; + } + + @Override + public List getOtherStacks() { + return this.mOutputs; + } + } +} diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index ab949bd517..ad03040059 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -18,10 +18,13 @@ implements IConfigureNEI { } } for (final Gregtech_Recipe_Map tMap : gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sMappings) { - if (tMap.mNEIAllowed) { - new GT_NEI_MultiBlockHandler(tMap); + if (tMap.mNEIAllowed) { + if (!tMap.mUnlocalizedName.equals(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mUnlocalizedName)) { + new GT_NEI_MultiBlockHandler(tMap); + } } } + new GT_NEI_FluidReactor(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes); sIsAdded = true; API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index b6e4ce8881..a80ae58b65 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -1,24 +1,39 @@ package gtPlusPlus.plugin.agrichem; +import static gtPlusPlus.core.lib.CORE.GTNH; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_ModHandler.RecipeBits; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.MISC_MATERIALS; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils; +import ic2.core.Ic2Items; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; public class BioRecipes { @@ -51,6 +66,8 @@ public class BioRecipes { private static Fluid mBenzene; private static Fluid mEthylbenzene; private static Fluid mStyrene; + private static Fluid mButanol; + private static Fluid mAcetone; private static final ItemStack getGreenAlgaeRecipeChip() { @@ -67,17 +84,17 @@ public class BioRecipes { } private static final ItemStack getBioChip(int aID) { - return ItemUtils.simpleMetaStack(Core_Agrichem.mBioCircuit, aID, 0); + return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, aID, 0); } public static void init() { - Core_Agrichem.mInstance.log("Setting Variables"); + Logger.INFO("[Bio] Setting Variables"); initRecipeVars(); - Core_Agrichem.mInstance.log("Generating Biochip Recipes"); + Logger.INFO("[Bio] Generating Biochip Recipes"); recipeBioChip(); - Core_Agrichem.mInstance.log("Generating Recipes"); + Logger.INFO("[Bio] Generating Recipes"); recipeAlgaeBiomass(); - Core_Agrichem.mInstance.log("Finished with recipes"); + Logger.INFO("[Bio] Finished with recipes"); } private static final void initRecipeVars() { @@ -101,7 +118,7 @@ public class BioRecipes { mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid(); mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid(); mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid(); - mLiquidPlastic = FluidUtils.getFluidStack("plastic", 1).getFluid(); + mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid(); mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluid(1).getFluid(); mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluid(1).getFluid(); mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid(); @@ -110,10 +127,9 @@ public class BioRecipes { mPropionicAcid = AgrichemFluids.mPropionicAcid; mUrea = AgrichemFluids.mUrea; mLiquidResin = AgrichemFluids.mLiquidResin; - mFermentationBase = AgrichemFluids.mFermentationBase; - - - + mFermentationBase = AgrichemFluids.mFermentationBase; + mButanol = AgrichemFluids.mButanol; + mAcetone = AgrichemFluids.mAcetone; } private static void recipeAlgaeBiomass() { @@ -153,22 +169,32 @@ public class BioRecipes { recipeMethane(); recipeBenzene(); recipeStyrene(); + + registerFuels(); } + private static void registerFuels() { + // Gas Fuels + //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1); + + //Combustion Fuels + GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 250, 0); + + } private static void recipeGreenAlgae() { // Compost GT_ModHandler.addPulverisationRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 10), - ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); // Turn into Cellulose CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getGreenAlgaeRecipeChip(), - ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 30) + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 30) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5), - 20 * 30, + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5), + 30 * 30, 16); @@ -177,23 +203,23 @@ public class BioRecipes { private static void recipeBrownAlgae() { // Compost GT_ModHandler.addPulverisationRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10), - ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); // Alginic acid GT_Values.RA.addExtractorRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10), - ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 1), 20 * 15, 30); // Lithium Chloride GT_Values.RA.addBlastRecipe( getBrownAlgaeRecipeChip(), - ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20), + ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20), GT_Values.NF, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mLithiumChloride, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 1), GT_Values.NI, 120, 120, @@ -202,10 +228,10 @@ public class BioRecipes { // Sodium Carbonate CORE.RA.addChemicalRecipe( getBrownAlgaeRecipeChip(), - ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20), + ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20), FluidUtils.getDistilledWater(2000), GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mSodiumCarbonate, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 1), 20 * 30, 30); @@ -214,63 +240,63 @@ public class BioRecipes { private static void recipeGoldenBrownAlgae() { // Compost GT_ModHandler.addPulverisationRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 10), - ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); // Turn into Cellulose CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getGoldenBrownAlgaeRecipeChip(), - ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 30) + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 30) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownCelluloseFiber, 5), - 20 * 30, - 64); + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5), + 30 * 30, + 120); } private static void recipeRedAlgae() { // Compost GT_ModHandler.addPulverisationRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 10), - ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); // Turn into Cellulose CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getRedAlgaeRecipeChip(), - ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 30) + ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mRedCelluloseFiber, 5), - 20 * 30, - 256); + ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5), + 30 * 30, + 240); } private static void recipeCelluloseFibre() { CORE.RA.addChemicalRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 20), - ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 2), + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20), + ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2), GT_Values.NF, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 10), - 30 * 20, + ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 10), + 45 * 20, 16); // Craft into Wood Pellets CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getBioChip(2), - ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12) + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2), 20 * 30, 30); // Methanol Extraction GT_Values.RA.addFluidExtractionRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12), + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12), GT_Values.NI, FluidUtils.getFluidStack(mMethanol, 50), 10000, @@ -279,8 +305,8 @@ public class BioRecipes { // Compost GT_ModHandler.addPulverisationRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5), - ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1)); + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5), + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); } @@ -288,30 +314,29 @@ public class BioRecipes { private static void recipeWoodPellets() { // Shapeless Recipe RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1) - }, ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2)); + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1) + }, ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2)); // Assembly Recipe CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getBioChip(2), - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 8) + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 8) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2), - 20, + ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2), + 20 * 5, 8); // CO2 CORE.RA.addFluidExtractionRecipe( - GT_Values.NI, - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), FluidUtils.getFluidStack(mCarbonDioxide, 70), 10*20, 30); @@ -320,7 +345,7 @@ public class BioRecipes { // Add Charcoal Recipe if (LoadedMods.Railcraft) { RailcraftUtils.addCokeOvenRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2), true, true, ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3), @@ -328,7 +353,7 @@ public class BioRecipes { 1200); } CORE.RA.addCokeOvenRecipe( - ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2), getBioChip(3), null, GT_Values.NF, @@ -347,8 +372,8 @@ public class BioRecipes { ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50) }, GT_Values.NF, - ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 1), - 100, + ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1), + 100 * 20, 16); } @@ -357,64 +382,352 @@ public class BioRecipes { // Assembly Recipe CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getBioChip(2), - ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 4) + ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4) }, GT_Values.NF, ItemUtils.getSimpleStack(Items.paper, 1), - 50, + 60 * 20, 16); } private static void recipeCatalystCarrier() { - + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(20), + ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", GTNH ? 8 : 4), + ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 4 : 2), + ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1), + 300 * 20, + 16); } private static void recipeAluminiumSilverCatalyst() { - + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(20), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4), + ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10), + 600 * 20, + 30); } private static void recipeAceticAcid() { + /* GT_Values.RA.addMixerRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10), + var2, + var3, var4, + var5, // Fluid in + var6, // Fluid out + var7, // Item Out + var8, // Time + var9); // Eu + */ + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mMethanol, 700), + FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 300), + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 250), + }, + 120 * 20, + 60, + 1); + + CORE.RA.addDehydratorRecipe( + CI.emptyCells(1), + FluidUtils.getFluidStack(mFermentationBase, 4000), + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1) + }, + 60 * 20, + 16); + + } private static void recipeFermentationBase() { + AutoMap aFruitVege = AgriculturalChem.mList_Master_FruitVege; + AutoMap aSeeds = AgriculturalChem.mList_Master_Seeds; + ArrayList aMap = OreDictionary.getOres("cropSugarbeet"); + for (ItemStack a : aFruitVege) { + if (aMap.contains(a)) { + continue; + } + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(2), + ItemUtils.getSimpleStack(a, 10) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200), + }, + 60 * 20, + 30, + 1); + } + for (ItemStack a : aSeeds) { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(3), + ItemUtils.getSimpleStack(a, 20) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50), + }, + 60 * 20, + 30, + 1); + } + + // Sugar Cane + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(4), + ItemUtils.getSimpleStack(Items.reeds, 16) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75), + }, + 60 * 20, + 30, + 1); + + // Sugar Beet + if (OreDictionary.doesOreNameExist("cropSugarbeet")) { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(4), + ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 8) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75), + }, + 60 * 20, + 30, + 1); + } + + // Produce Acetone, Butanol and Ethanol + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(5), + ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48), + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 16), + ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16), + }, + new FluidStack[] { + + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 6), + ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 3), + ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 1), + CI.emptyCells(38) + }, + new FluidStack[] { + + }, + 900 * 20, + 240, + 2); + } private static void recipePropionicAcid() { - + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mEthylene, 500), + FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 500), + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 250), + }, + 20 * 20, + 60, + 1); } private static void recipeEthanol() { + GT_Values.RA.addDistilleryRecipe( + BioRecipes.getBioChip(2), + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000), + FluidUtils.getFluidStack(BioRecipes.mEthanol, 100), + null, + 20 * 20, + 60, + false); + } private static void recipeGoldenBrownCelluloseFiber() { - + CORE.RA.addFluidExtractionRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 20), + FluidUtils.getFluidStack(BioRecipes.mAmmonia, 50), + 20 * 30, + 120); } private static void recipeRedCelluloseFiber() { - + GT_Values.RA.addExtractorRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 20), + ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5), + 20 * 30, + 240); } private static void recipeSodiumHydroxide() { - + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(4) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mSalineWater, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mChlorine, 400), + FluidUtils.getFluidStack(BioRecipes.mHydrogen, 600), + }, + 300 * 20, + 120, + 2); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(5), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 5) + }, + new FluidStack[] { + + }, + 60 * 20, + 60, + 2); } private static void recipeSodiumCarbonate() { + if (OreDictionary.doesOreNameExist("fuelCoke")) { + + GT_Values.RA.addBlastRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 4), + ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 4), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24), + null, + 20 * 120, + 120, + 1600); + + } + + GT_Values.RA.addBlastRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24), + ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 4), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24), + null, + 20 * 120, + 120, + 1600); + } private static void recipeAluminiumPellet() { - + GT_Values.RA.addAutoclaveRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 3), + null, + ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4), + 10000, + 120 * 20, + 16); } private static void recipeAlumina() { - + GT_Values.RA.addBlastRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 24), + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 3), + FluidUtils.getFluidStack(mCarbonDioxide, 6000), + GT_Values.NF, + ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24), + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 2), + 20 * 120, + 120, + 1200); } private static void recipeAluminium() { - + GT_Values.RA.addBlastRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24), + ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 4), + GT_Values.NF, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24), + null, + 20 * 120, + 120, + 1600); } private static void recipeCalciumCarbonate() { @@ -427,97 +740,389 @@ public class BioRecipes { private static void recipeAlginicAcid() { + // Turn into Cellulose Pulp + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getBioChip(7), + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20), + ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 5) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20), + 90 * 20, + 16); } private static void recipeSulfuricAcid() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(7), + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 10), + ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 30) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5), + }, + 60 * 20, + 60, + 2); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(7), + ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5), + ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 15), + }, + 60 * 20, + 60, + 2); + } private static void recipeUrea() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(9), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mAmmonia, 600), + FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 400), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mUrea, 400), + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 600), + }, + 120 * 20, + 30, + 1); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(9), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mUrea, 200), + FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200) + }, + 120 * 20, + 30, + 1); } private static void recipeRawBioResin() { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(3), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10), + ItemUtils.getSimpleStack(Blocks.dirt, 20) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1), + }, + new FluidStack[] { + + }, + 60 * 20, + 30, + 1); } private static void recipeLiquidResin() { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(3), + ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mEthanol, 200), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 50), + }, + 60 * 20, + 30, + 1); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(3), + ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 144), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Ic2Items.resin, 1) + }, + new FluidStack[] { + + }, + 120 * 20, + 30, + 1); + + } private static void recipeCompost() { + ItemStack aFert; + if (LoadedMods.Forestry) { + aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 2); + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(11), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mUrea, 500), + }, + new ItemStack[] { + aFert + }, + new FluidStack[] { + + }, + 120 * 20, + 60, + 2); + } + aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 2); + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(12), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mUrea, 500), + }, + new ItemStack[] { + aFert + }, + new FluidStack[] { + + }, + 120 * 20, + 60, + 2); + } private static void recipeMethane() { - + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(12), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 20) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mMethane, 10), + }, + 20 * 20, + 30, + 1); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(13), + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 64), + ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 48), + ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 32) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mMethane, 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144/4)), + }, + 120 * 20, + 240, + 2); } private static void recipeBenzene() { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(19), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mMethane, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mBenzene, 500), + }, + 8 * 20, + 120, + 2); } private static void recipeStyrene() { - + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(20), + ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mStyrene, 25), + }, + 16 * 20, + 480, + 3); } private static void recipeBioChip() { - GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L, new Object[0]), - RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}); - - - long bits = RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE; - - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, + GT_ModHandler.addShapelessCraftingRecipe( + GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}); + + long bits = 0; + + + + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, + addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])}); } + public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { + Method mAddRecipe = ReflectionUtils.getMethod(GT_ModHandler.class, "addCraftingRecipe", new Class[] { + ItemStack.class, Enchantment[].class, int[].class, + boolean.class, boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, boolean.class, + boolean.class, Object[].class}); + boolean didInvoke = false; + if (mAddRecipe != null) { + try { + didInvoke = (boolean) mAddRecipe.invoke(null, aResult, + new Enchantment[] {}, + new int[] {}, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + aRecipe); + } + catch (IllegalAccessException | IllegalArgumentException + | InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return didInvoke; + + + } + } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java index bb467699a7..4cf31e9335 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java @@ -19,58 +19,6 @@ public class Core_Agrichem implements IPlugin { final static Core_Agrichem mInstance; - public static Item mAlgae; - public static Item mBioCircuit; - public static Item mAgrichemItem1; - - /* - * 0 - Algae Biomass - * 1 - Green Algae Biomass - * 2 - Brown Algae Biomass - * 3 - Golden-Brown Algae Biomass - * 4 - Red Algae Biomass - * 5 - Cellulose Fiber - * 6 - Golden-Brown Cellulose Fiber - * 7 - Red Cellulose Fiber - * 8 - Compost - * 9 - Wood Pellet - * 10 - Wood Brick - * 11 - Cellulose Pulp - * 12 - Raw Bio Resin - * 13 - Catalyst Carrier - * 14 - Green Metal Catalyst - * 15 - Alginic Acid - * 16 - Alumina - * 17 - Aluminium Pellet - * 18 - Sodium Aluminate - * 19 - Sodium Hydroxide // Exists in Newer GT - * 20 - Sodium Carbonate - * 21 - Lithium Chloride - */ - - public static ItemStack mAlgaeBiosmass; - public static ItemStack mGreenAlgaeBiosmass; - public static ItemStack mBrownAlgaeBiosmass; - public static ItemStack mGoldenBrownAlgaeBiosmass; - public static ItemStack mRedAlgaeBiosmass; - public static ItemStack mCelluloseFiber; - public static ItemStack mGoldenBrownCelluloseFiber; - public static ItemStack mRedCelluloseFiber; - public static ItemStack mCompost; - public static ItemStack mWoodPellet; - public static ItemStack mWoodBrick; - public static ItemStack mCellulosePulp; - public static ItemStack mRawBioResin; - public static ItemStack mCatalystCarrier; - public static ItemStack mGreenCatalyst; - public static ItemStack mAlginicAcid; - public static ItemStack mAlumina; - public static ItemStack mAluminiumPellet; - public static ItemStack mSodiumAluminate; - public static ItemStack mSodiumHydroxide; - public static ItemStack mSodiumCarbonate; - public static ItemStack mLithiumChloride; - static { mInstance = new Core_Agrichem(); @@ -84,98 +32,18 @@ public class Core_Agrichem implements IPlugin { FluidLoader.generate(); AgrichemFluids.init(); mInstance.log("Generating Items"); - mAlgae = new ItemAlgaeBase(); - mAgrichemItem1 = new ItemAgrichemBase(); - mBioCircuit = new ItemBioChip(); - mInstance.log("Setting Bio Circuit"); - GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit); return true; } @Override public boolean init() { - mInstance.log("Setting Items"); - mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1); - mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1); - mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1); - mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1); - mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1); - mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1); - mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1); - mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1); - mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1); - mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1); - mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1); - mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1); - mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1); - mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1); - mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1); - mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1); - mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1); - mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1); - mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1); - - /** - * If It exists, don't add a new one. - */ - if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) { - List aTest = OreDictionary.getOres("dustSodiumHydroxide", false); - ItemStack aTestStack; - if (aTest.isEmpty()) { - aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false); - if (aTest.isEmpty()) { - aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); - } - else { - aTestStack = aTest.get(0); - } - } - else { - aTestStack = aTest.get(0); - } - mSodiumHydroxide = aTestStack; - } - else { - mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); - } - mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1); - mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); - - mInstance.log("OreDicting Items"); - ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); - ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); - ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae"); - ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae"); - - ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose"); - ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose"); - ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose"); - ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose"); - ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose"); - - ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood"); - ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood"); - ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose"); - - ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty"); - ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver"); - ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid"); - ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina"); - ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium"); - - ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate"); - if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) { - ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); - } - ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); - ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + mInstance.log("Setting Items"); return true; } @Override public boolean postInit() { mInstance.log("Generating Recipes"); - BioRecipes.init(); return true; } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java index 1f686cf810..099645131a 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java @@ -32,6 +32,9 @@ public class AgrichemFluids { public static Fluid mFermentationBase; public static Fluid mUrea; public static Fluid mLiquidResin; + public static Fluid mAcetone; + public static Fluid mButanol; + public static void init() { @@ -65,6 +68,19 @@ public class AgrichemFluids { else { mLiquidResin = FluidRegistry.getFluid("liquidresin"); } + + if (!FluidRegistry.isFluidRegistered("acetone")) { + mAcetone = FluidUtils.generateFluidNoPrefix("acetone", "Acetone", 200, new short[] { 59, 58, 56, 100 }, true); + } + else { + mAcetone = FluidRegistry.getFluid("acetone"); + } + if (!FluidRegistry.isFluidRegistered("butanol")) { + mButanol = FluidUtils.generateFluidNoPrefix("butanol", "Butanol", 200, new short[] { 159, 58, 56, 100 }, true); + } + else { + mButanol = FluidRegistry.getFluid("butanol"); + } } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java index 7d45899911..49b8da0d1b 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java @@ -109,7 +109,6 @@ public class GTPP_Bees { private void addExtractorRecipe(ItemStack input, FluidStack output){ CORE.RA.addFluidExtractionRecipe( input, - null, output, 30, 8); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 7a83392c07..588c04d7e5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -478,6 +478,10 @@ public enum GregtechItemList implements GregtechItemContainer { Machine_ZPM_Component_Maker, Machine_UV_Component_Maker, + // Fluid Reactor + FluidReactor_LV, FluidReactor_HV, + FluidReactor_IV, FluidReactor_ZPM, + //Breakers BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV, BreakerBox_HV, BreakerBox_EV, BreakerBox_IV, @@ -601,7 +605,7 @@ public enum GregtechItemList implements GregtechItemContainer { FakeMachineCasingPlate_MV, FakeMachineCasingPlate_HV, FakeMachineCasingPlate_EV, FakeMachineCasingPlate_IV, FakeMachineCasingPlate_LuV, FakeMachineCasingPlate_ZPM, - FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX, + FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX, //---------------------------------------------------------------------------- diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java new file mode 100644 index 0000000000..0c64644166 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java @@ -0,0 +1,182 @@ +package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_Container_BasicMachine; +import gregtech.api.gui.GT_Slot_Render; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.slots.SlotChemicalPlantInput; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.item.ItemStack; + +public class Container_FluidReactor extends GT_Container_BasicMachine { + + public boolean mFluidTransfer_1 = false; + public boolean mFluidTransfer_2 = false; + public boolean oFluidTransfer_1 = false; + public boolean oFluidTransfer_2 = false; + + public Container_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + + // Gui Buttons + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 0, 8, 63)); // Fluid 1 + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 1, 44, 63)); + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 26, 63)); // Fluid 2 + + int tStartIndex = 3; + // Input Slots + this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 8, 7)); + this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 26, 7)); + this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 44, 7)); + this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 62, 7)); + + // Output Slots + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 16)); + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 16)); + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 34)); + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 34)); + + // Cell Collector Slot + this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 116, 63)); + + + // Inputs Fluids + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 8, 42)); + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 26, 42)); + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 44, 42)); + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 62, 42)); + + // Output Fluids + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 16)); + this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 34)); + + + + + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex == 0 || aSlotIndex == 2) { + if (this.mTileEntity != null && this.mTileEntity.isServerSide()) { + try { + final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return null; + } + if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) { + //Set Tile + if (aSlotIndex == 0) { + ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1; + } + else if (aSlotIndex == 2) { + ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2; + } + return null; + } + } + catch (Throwable t) { + t.printStackTrace(); + } + } + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (this.mTileEntity != null && this.mTileEntity.isServerSide()) { + try { + Iterator var2 = this.crafters.iterator(); + final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + Logger.INFO("bad"); + return; + } + if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) { + //Read from Tile + this.mFluidTransfer_1 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1; + this.mFluidTransfer_2 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2; + int mTimer; + mTimer = (int) ReflectionUtils.getField(this.getClass(), "mTimer").get(this); + while (true) { + ICrafting var1; + do { + if (!var2.hasNext()) { + this.oFluidTransfer_1 = this.mFluidTransfer_1; + this.oFluidTransfer_2 = this.mFluidTransfer_2; + return; + } + var1 = (ICrafting) var2.next(); + if (mTimer % 500 == 10 || this.oFluidTransfer_1 != this.mFluidTransfer_1) { + var1.sendProgressBarUpdate(this, -50, this.mFluidTransfer_1 ? 1 : 0); + } + if (mTimer % 500 == 10 || this.oFluidTransfer_2 != this.mFluidTransfer_2) { + var1.sendProgressBarUpdate(this, -51, this.mFluidTransfer_2 ? 1 : 0); + } + } while (mTimer % 500 != 10); + } + } + else { + Logger.INFO("bad cast"); + } + } + catch (IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + } + + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + if (par1 > 0) { + super.updateProgressBar(par1, par2); + } + else { + switch (par1) { + case -50 : + this.mFluidTransfer_1 = par2 != 0; + break; + case -51 : + this.mFluidTransfer_2 = par2 != 0; + break; + default : + break; + } + } + } + + public int getSlotStartIndex() { + return 3; + } + + public int getShiftClickStartIndex() { + return 3; + } + + public int getSlotCount() { + return this.getShiftClickSlotCount() + 5 + 2; + } + + public int getShiftClickSlotCount() { + return 4; + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java new file mode 100644 index 0000000000..1be79b40cc --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java @@ -0,0 +1,122 @@ +package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor; + +import gregtech.api.gui.GT_Container_BasicMachine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.lib.CORE; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.player.InventoryPlayer; + +public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine { + public final String mName; + public final String mNEI; + public final byte mProgressBarDirection; + public final byte mProgressBarAmount; + + public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, + String aTextureFile, String aNEI) { + this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); + } + + public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, + String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { + super(new Container_FluidReactor(aInventoryPlayer, aTileEntity), CORE.MODID+":textures/gui/FluidReactor.png"); + this.mProgressBarDirection = aProgressBarDirection; + this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); + this.mName = aName; + this.mNEI = aNEI; + } + + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRendererObj.drawString(this.mName, 82, 5, 4210752); + this.drawTooltip(par1, par2); + } + + private void drawTooltip(int x2, int y2) { + int xStart = (this.width - this.xSize) / 2; + int yStart = (this.height - this.ySize) / 2; + int x = x2 - xStart; + int y = y2 - yStart + 5; + List list = new ArrayList(); + if (y >= 67 && y <= 84) { + if (x >= 7 && x <= 24) { + list.add("Fluid 1 Auto-Output"); + } + if (x >= 25 && x <= 42) { + list.add("Fluid 2 Auto-Output"); + } + if (x >= 43 && x <= 61) { + list.add("Item Auto-Output"); + } + } + + if (!list.isEmpty()) { + this.drawHoveringText(list, x, y, this.fontRendererObj); + } + + } + + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + if (this.mContainer != null) { + if (((Container_FluidReactor) this.mContainer).mFluidTransfer_1) { + this.drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18); + } + if (((Container_FluidReactor) this.mContainer).mFluidTransfer_2) { + this.drawTexturedModalRect(x + 25, y + 62, 194, 18, 18, 18); + } + if (((GT_Container_BasicMachine) this.mContainer).mItemTransfer) { + this.drawTexturedModalRect(x + 43, y + 62, 176, 36, 18, 18); + } + + if (((GT_Container_BasicMachine) this.mContainer).mStuttering) { + this.drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18); + } + + if (this.mContainer.mMaxProgressTime > 0) { + int tSize = this.mProgressBarDirection < 2 ? 20 : 18; + int tProgress = Math + .max(1, Math + .min(tSize * this.mProgressBarAmount, + (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime + * tSize * this.mProgressBarAmount / this.mContainer.mMaxProgressTime)) + % (tSize + 1); + switch (this.mProgressBarDirection) { + case 0 : + this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18); + break; + case 1 : + this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18); + break; + case 2 : + this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress); + break; + case 3 : + this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); + break; + case 4 : + tProgress = 20 - tProgress; + this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18); + break; + case 5 : + tProgress = 20 - tProgress; + this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18); + break; + case 6 : + tProgress = 18 - tProgress; + this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress); + break; + case 7 : + tProgress = 18 - tProgress; + this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); + } + } + } + + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 2726b140ca..ceb2685b7f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -216,6 +216,8 @@ public interface IGregtech_RecipeAdder { public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput); + public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu); + public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu); public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn); @@ -269,4 +271,9 @@ public interface IGregtech_RecipeAdder { public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); + public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier); + + public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat); + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 09f3f2d1f5..6cac1fddea 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -350,8 +350,13 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active; - - + //Fluid Reactor Overlays + public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT"); + public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE"); + public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP"); + public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE"); //Crafting Overlays private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java new file mode 100644 index 0000000000..288b48ebb5 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -0,0 +1,706 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.E; + +import java.util.HashSet; +import java.util.List; + +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.slots.SlotChemicalPlantInput; +import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor; +import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.GUI_FluidReactor; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_BasicMachine { + + public boolean mFluidTransfer_1 = false; + public boolean mFluidTransfer_2 = false; + + public FluidStack[] mInputFluids = new FluidStack[4]; + public FluidStack[] mOutputFluids = new FluidStack[2]; + + private static final GT_Recipe_Map mFluidChemicalReactorRecipes = new GT_Recipe_Map( + new HashSet(100), + "gt.recipe.fluidchemicaleactor", + "Chemical Plant", + null, + CORE.MODID+":textures/gui/FluidReactor", + 0, + 0, + 0, + 2, + 1, + "Tier: ", + 1, + E, + true, + false); + + public GregtechMetaTileEntity_ChemicalReactor(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, + "For mixing fluids", 4, 4, "ChemicalReactor.png", "", + new ITexture[]{ + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top) + } + ); + } + + public GregtechMetaTileEntity_ChemicalReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + }*/ + + @Override + public String[] getDescription() { + return new String[]{this.mDescription, "Because why not?", }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + try { + GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + return y; + } + catch(Throwable t) { + t.printStackTrace(); + } + return null; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + try { + Container_FluidReactor y = new Container_FluidReactor(aPlayerInventory, aBaseMetaTileEntity); + return y; + } + catch(Throwable t) { + t.printStackTrace(); + } + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GUI_FluidReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), + this.mGUIName, + GT_Utility.isStringValid(this.mNEIName) + ? this.mNEIName + : (this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "")); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + if (mFluidChemicalReactorRecipes.mRecipeList.isEmpty()) { + for (Recipe_GT i :Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) { + mFluidChemicalReactorRecipes.add(i); + } + } + return mFluidChemicalReactorRecipes; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return (super.isFluidInputAllowed(aFluid)); + } + + @Override + public int getCapacity() { + return 8000 * Math.max(1, this.mTier); + } + + @Override + public int getInputSlot() { + return 3; + } + + @Override + public boolean isLiquidInput(byte aSide) { + return aSide > 1; + } + + @Override + public boolean isLiquidOutput(byte aSide) { + return aSide < 2; + } + + @Override + public int getOutputSlot() { + return super.getOutputSlot(); + } + + @Override + public int getStackDisplaySlot() { + return super.getStackDisplaySlot(); + } + + @Override + public boolean doesEmptyContainers() { + return true; + } + + @Override + public boolean canTankBeFilled() { + return super.canTankBeFilled(); + } + + @Override + public boolean canTankBeEmptied() { + return super.canTankBeEmptied(); + } + + @Override + public FluidStack getDisplayedFluid() { + return super.getDisplayedFluid(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mFluidTransfer_1", mFluidTransfer_1); + aNBT.setBoolean("mFluidTransfer_2", mFluidTransfer_2); + for (int i=0;i<4;i++) { + if (this.mInputFluids[i] != null) { + aNBT.setTag("mInputFluid"+i, this.mInputFluids[i].writeToNBT(new NBTTagCompound())); + } + } + for (int i=0;i<2;i++) { + if (this.mOutputFluids[i] != null) { + aNBT.setTag("mOutputFluid"+i, this.mOutputFluids[i].writeToNBT(new NBTTagCompound())); + } + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mFluidTransfer_1 = aNBT.getBoolean("mFluidTransfer_1"); + mFluidTransfer_2 = aNBT.getBoolean("mFluidTransfer_2"); + for (int i=0;i<4;i++) { + if (this.mInputFluids[i] == null) { + this.mInputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mInputFluid"+i)); + } + } + for (int i=0;i<2;i++) { + if (this.mOutputFluids[i] == null) { + this.mOutputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"+i)); + } + } + } + + /* + * Custom Fluid Handling - TODO + */ + + public FluidStack getFillableStack() { + return this.mFluid; + } + + public FluidStack setFillableStack(FluidStack aFluid) { + this.mFluid = aFluid; + return this.mFluid; + } + + public FluidStack getDrainableStack() { + return this.mFluid; + } + + public FluidStack setDrainableStack(FluidStack aFluid) { + this.mFluid = aFluid; + return this.mFluid; + } + + + + + + + + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + + // Re-implement basic machine logic from the ground up. + + if (aBaseMetaTileEntity.isServerSide()) { + this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; + this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; + this.doDisplayThings(); + boolean tSucceeded = false; + int i; + if (this.mMaxProgresstime > 0 && (this.mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) { + aBaseMetaTileEntity.setActive(true); + if (this.mProgresstime >= 0 && !this.drainEnergyForProcess((long) this.mEUt)) { + if (!this.mStuttering) { + this.stutterProcess(); + if (this.canHaveInsufficientEnergy()) { + this.mProgresstime = -100; + } + + this.mStuttering = true; + } + } else { + if (++this.mProgresstime >= this.mMaxProgresstime) { + for (i = 0; i < this.mOutputItems.length; ++i) { + for (i = 0; i < this.mOutputItems.length && !aBaseMetaTileEntity.addStackToSlot( + this.getOutputSlot() + (i + i) % this.mOutputItems.length, + this.mOutputItems[i]); ++i) { + ; + } + } + + if (this.mOutputFluid != null) { + if (this.getDrainableStack() == null) { + this.setDrainableStack(this.mOutputFluid.copy()); + } else if (this.mOutputFluid.isFluidEqual(this.getDrainableStack())) { + FluidStack var10000 = this.getDrainableStack(); + var10000.amount += this.mOutputFluid.amount; + } + } + + for (i = 0; i < this.mOutputItems.length; ++i) { + this.mOutputItems[i] = null; + } + + this.mOutputFluid = null; + this.mEUt = 0; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mStuttering = false; + tSucceeded = true; + this.endProcess(); + } + + if (this.mProgresstime > 5) { + this.mStuttering = false; + } + + XSTR aXSTR = new XSTR(); + if (GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000) == 0) { + GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), + (String) GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); + } + } + } else { + aBaseMetaTileEntity.setActive(false); + } + + boolean tRemovedOutputFluid = false; + if (this.doesAutoOutputFluids() && this.getDrainableStack() != null + && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing && (tSucceeded || aTick % 20L == 0L)) { + IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); + if (tTank != null) { + FluidStack tDrained = this.drain(1000, false); + if (tDrained != null) { + int tFilledAmount = tTank.fill( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); + if (tFilledAmount > 0) { + tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + this.drain(tFilledAmount, true), true); + } + } + } + + if (this.getDrainableStack() == null) { + tRemovedOutputFluid = true; + } + } + + int j; + if (this.doesAutoOutput() && !this.isOutputEmpty() + && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing + && (tSucceeded || this.mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600L == 0L)) { + TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); + j = 0; + + for (byte tCosts = 1; j < this.mOutputItems.length && tCosts > 0 + && aBaseMetaTileEntity.isUniversalEnergyStored(128L); ++j) { + tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, + aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), (List) null, + false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + if (tCosts > 0) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits((long) tCosts, true); + } + } + } + + if (this.mOutputBlocked != 0) { + if (this.isOutputEmpty()) { + this.mOutputBlocked = 0; + } else { + ++this.mOutputBlocked; + } + } + + if (this.allowToCheckRecipe()) { + if (this.mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() + && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600L == 0L || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) + && this.hasEnoughEnergyToCheckRecipe()) { + if (this.checkRecipe() == 2) { + if (this.mInventory[3] != null && this.mInventory[3].stackSize <= 0) { + this.mInventory[3] = null; + } + + i = this.getInputSlot(); + + for (j = i + this.mInputSlotCount; i < j; ++i) { + if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) { + this.mInventory[i] = null; + } + } + + for (i = 0; i < this.mOutputItems.length; ++i) { + this.mOutputItems[i] = GT_Utility.copy(new Object[]{this.mOutputItems[i]}); + if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) { + this.mOutputItems[i].stackSize = 64; + } + + this.mOutputItems[i] = GT_OreDictUnificator.get(true, this.mOutputItems[i]); + } + + if (this.mFluid != null && this.mFluid.amount <= 0) { + this.mFluid = null; + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + if (GT_Utility.isDebugItem(this.mInventory[this.dechargerSlotStartIndex()])) { + this.mEUt = this.mMaxProgresstime = 1; + } + + this.startProcess(); + } else { + this.mMaxProgresstime = 0; + + for (i = 0; i < this.mOutputItems.length; ++i) { + this.mOutputItems[i] = null; + } + + this.mOutputFluid = null; + } + } + } else if (!this.mStuttering) { + this.stutterProcess(); + this.mStuttering = true; + } + } + + + + } + + @Override + protected void doDisplayThings() { + // TODO Auto-generated method stub + super.doDisplayThings(); + } + + @Override + protected ItemStack getSpecialSlot() { + // TODO Auto-generated method stub + return super.getSpecialSlot(); + } + + @Override + protected ItemStack getOutputAt(int aIndex) { + // TODO Auto-generated method stub + return super.getOutputAt(aIndex); + } + + @Override + protected ItemStack[] getAllOutputs() { + // TODO Auto-generated method stub + return super.getAllOutputs(); + } + + @Override + protected ItemStack getInputAt(int aIndex) { + // TODO Auto-generated method stub + return super.getInputAt(aIndex); + } + + @Override + protected ItemStack[] getAllInputs() { + // TODO Auto-generated method stub + return super.getAllInputs(); + } + + @Override + protected boolean displaysInputFluid() { + return true; + } + + @Override + protected boolean displaysOutputFluid() { + return true; + } + + @Override + public boolean doesAutoOutput() { + return super.doesAutoOutput(); + } + + @Override + public boolean doesAutoOutputFluids() { + return this.mFluidTransfer_1 && this.mFluidTransfer_2; + } + + @Override + public void startProcess() { + super.startProcess(); + } + + @Override + public void endProcess() { + super.endProcess(); + } + + @Override + public String[] getInfoData() { + return super.getInfoData(); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack); + } + + @Override + public int checkRecipe() { + return super.checkRecipe(); + } + + @Override + public int checkRecipe(boolean skipOC) { + return super.checkRecipe(skipOC); + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + + /* if (aBaseMetaTileEntity != null) { + if (!aBaseMetaTileEntity.getWorld().isRemote) { + itemslots : for (int i=3;i<7;i++) { + ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i); + if (aStack != null) { + if (FluidContainerRegistry.isContainer(aStack)) { + if (this.isItemValidForSlot(i, aStack)) { + // Add Fluid + FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack); + if (aContainerFluid != null) { + fluidslots : for (FluidStack u : mInputFluids) { + if (u != null && u.isFluidEqual(aContainerFluid)) { + if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) { + + // Matching, not full, let's fill, then continue + u.amount += aContainerFluid.amount; + + // Update stack size + if (aStack.stackSize > 1) { + aStack.stackSize--; + } + else { + aStack = null; + } + + // Add Output container + // TODO + + continue itemslots; + } + else { + // Too full + break fluidslots; + } + } + else { + if (u == null ) { + + // Empty, let's fill, then continue + u = aContainerFluid.copy(); + + // Update stack size + if (aStack.stackSize > 1) { + aStack.stackSize--; + } + else { + aStack = null; + } + + // Add Output container + // TODO + + continue itemslots; + + } + else { + // Not empty, doesn't match, check next slot. + continue fluidslots; + } + } + } + + + + } + // Eat Input + + // Add Container to Output + } + } + } + } + } + }*/ + + } + + @Override + public FluidStack getFluid() { + return super.getFluid(); + } + + @Override + public int getFluidAmount() { + return super.getFluidAmount(); + } + + @Override + public int fill(FluidStack aFluid, boolean doFill) { + return super.fill(aFluid, doFill); + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) { + return super.drain(maxDrain, doDrain); + } + + @Override + protected void onEmptyingContainerWhenEmpty() { + super.onEmptyingContainerWhenEmpty(); + } + + @Override + public void setItemNBT(NBTTagCompound aNBT) { + super.setItemNBT(aNBT); + } + + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { + if (aIndex >= 3 && aIndex <= 6) { + return SlotChemicalPlantInput.isItemValidForChemicalPlantSlot(aStack); + } + return false; + } + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + return super.getAccessibleSlotsFromSide(aSide); + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + if (aIndex >= 3 && aIndex <= 6) { + return super.canInsertItem(aIndex, aStack, aSide); + } + return false; + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + if (aIndex >= 7 && aIndex <= 11) { + return super.canExtractItem(aIndex, aStack, aSide); + } + return false; + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + // TODO Auto-generated method stub + return super.canFill(aSide, aFluid); + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { + // TODO Auto-generated method stub + return super.canDrain(aSide, aFluid); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + // TODO Auto-generated method stub + return super.getTankInfo(aSide); + } + + @Override + public int fill_default( + ForgeDirection aSide, FluidStack aFluid, boolean doFill + ) { + // TODO Auto-generated method stub + return super.fill_default(aSide, aFluid, doFill); + } + + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + // TODO Auto-generated method stub + return super.fill(aSide, aFluid, doFill); + } + + @Override + public FluidStack drain( + ForgeDirection aSide, FluidStack aFluid, boolean doDrain + ) { + // TODO Auto-generated method stub + return super.drain(aSide, aFluid, doDrain); + } + + @Override + public FluidStack drain( + ForgeDirection aSide, int maxDrain, boolean doDrain + ) { + // TODO Auto-generated method stub + return super.drain(aSide, maxDrain, doDrain); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index ce4a6c629a..fbf61598d3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -31,7 +31,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { return isValid; } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) { - this(aExtracting, aEmpty, aFull, aFluid, null, null, null); + this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null); } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) { @@ -39,7 +39,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { } public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, Integer aDuration, Integer aEUt) { - this(aExtracting, aEmpty, aFull, aFluid, null, aDuration, aEUt); + this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt); } // Alternative Constructor @@ -68,7 +68,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { if (aExtracting) { aInput = aFull; aOutput = aEmpty; - aFluidInput = null; + aFluidInput = GT_Values.NF; aFluidOutput = aFluidIn; } else { @@ -93,23 +93,34 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { 0); - // Not Valid - if ((aExtracting && (aInput == null || aOutput == null ||(aFluidInput == null && aFluidOutput == null))) || (!aExtracting && (aInput == null || aOutput == null || (aFluidInput == null && aFluidOutput == null)))) { - isValid = false; - disableOptional = aExtracting; - recipe = null; + // Check Valid + boolean aTempValidityCheck = false; + if (aExtracting) { + if (aInput != null && aFluidOutput != null) { + aTempValidityCheck = true; + } } else { + if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) { + aTempValidityCheck = true; + } + } + + + if (aTempValidityCheck) { // Valid Recipe recipe = aRecipe; mRecipeGenMap.add(this); disableOptional = aExtracting; - isValid = true; + isValid = true; + } + else { + isValid = false; + disableOptional = aExtracting; + aRecipe.mEnabled = false; + aRecipe.mHidden = true; + recipe = null; } - - - - } @Override @@ -129,25 +140,23 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { } private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) { - if (aRecipe != null) { - if ((aRecipe.mDuration = GregTech_API.sRecipeFile.get("fluidextractor", aRecipe.mInputs[0], aRecipe.mDuration)) <= 0) { - return false; - } else { - GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); - return true; - } + if (aRecipe != null) { + int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); + aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + return aCount1 > aCount2; } return false; } private final boolean addFluidCannerRecipe(GT_Recipe recipe2) { - if (recipe2 != null) { - if ((recipe2.mDuration = GregTech_API.sRecipeFile.get("fluidcanner", recipe2.mOutputs[0], recipe2.mDuration)) <= 0) { - return false; - } else { - GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2); - return true; - } + if (recipe2 != null) { + int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2); + aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + return aCount1 > aCount2; } return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 799c6cd63b..2b4e52abb9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -48,8 +48,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ingot if (ItemUtils.checkForInvalidItems(material.getIngot(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getIngot(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getIngot(1), // Input material.getFluid(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -63,8 +63,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Plate if (ItemUtils.checkForInvalidItems(material.getPlate(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getPlate(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getPlate(1), // Input material.getFluid(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -78,8 +78,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Double Plate if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getPlateDouble(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getPlateDouble(1), // Input material.getFluid(288), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick @@ -93,8 +93,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Nugget if (ItemUtils.checkForInvalidItems(material.getNugget(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getNugget(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getNugget(1), // Input material.getFluid(16), // Fluid Output 16, // Duration material.vVoltageMultiplier // Eu Tick @@ -108,8 +108,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Block if (ItemUtils.checkForInvalidItems(material.getBlock(1))) - if (CORE.RA.addFluidExtractionRecipe(material.getBlock(1), // Input - null, // Input 2 + if (CORE.RA.addFluidExtractionRecipe( + material.getBlock(1), // Input material.getFluid(144 * 9), // Fluid Output 288, // Duration material.vVoltageMultiplier // Eu Tick diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 58db8a473f..84188a44aa 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -137,7 +137,7 @@ public class RecipeGen_Recycling implements Runnable { //Fluid Extractor if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { + if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+"."); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index fa6f2ad790..d43adb2be3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -989,6 +989,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } + @Override + public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) { + return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu); + } + @Override public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu) { return MaterialGenerator.addFluidExtractionRecipe(input, input2, output, aTime, aEu); @@ -1157,6 +1162,49 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } + @Override + public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) { + + Recipe_GT aSpecialRecipe = new Recipe_GT( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aInputFluids, + aFluidOutputs, + time, + (int) eu, + aTier); + + int aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size(); + int aSize2 = aSize; + Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.add(aSpecialRecipe); + aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size(); + return aSize > aSize2; + } + + @Override + public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat) { + Recipe_GT aSpecialRecipe = new Recipe_GT( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aInputFluids, + aFluidOutputs, + time, + (int) eu, + aHeat); + + int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size(); + int aSize2 = aSize; + GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe); + aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size(); + return aSize > aSize2; + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java new file mode 100644 index 0000000000..bd0edd9002 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor; + +public class GregtechFluidReactor { + + public static void run() { + + GregtechItemList.FluidReactor_LV + .set(new GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", "Chemical Plant I", 1) + .getStackForm(1L)); + GregtechItemList.FluidReactor_HV + .set(new GregtechMetaTileEntity_ChemicalReactor(31022, "chemicalplant.01.tier.02", "Chemical Plant II", 3) + .getStackForm(1L)); + GregtechItemList.FluidReactor_IV + .set(new GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", "Chemical Plant III", 5) + .getStackForm(1L)); + GregtechItemList.FluidReactor_ZPM + .set(new GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", "Chemical Plant IV", 7) + .getStackForm(1L)); + + } +} diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java index 6933987593..686910b9aa 100644 --- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java +++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java @@ -221,10 +221,10 @@ public class FishTrapHandler { private static void addGregtechFluidRecipe(final ItemStack input){ if (LoadedMods.Gregtech){ if (CORE.GTNH) { - CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 50), 16, 4); + CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 50), 16, 4); } else { - CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4 + CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4 } } } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java index 56e577fb7d..3de15ce6be 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -34,7 +34,7 @@ public class TF_Gregtech_Recipes { //Gelid Cryotheum Logger.INFO("Adding Recipes for Gelid Cryotheum"); - CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 200, 240); + CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, getFluidStack("cryotheum", 250), 200, 240); GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 144), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30); //Blizz Powder @@ -48,10 +48,10 @@ public class TF_Gregtech_Recipes { //Blazing Pyrotheum Logger.INFO("Adding Recipes for Blazing Pyrotheum"); - CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 200, 240); + CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, getFluidStack("pyrotheum", 250), 200, 240); //Ender Fluid - CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), GT_Values.NI, getFluidStack("ender", 250), 100, 30); + CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), getFluidStack("ender", 250), 100, 30); ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1); diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png new file mode 100644 index 0000000000..e92b9c9ff8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png new file mode 100644 index 0000000000..8a47157d2b Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..1367b80758 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [0, 0, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 0] + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png new file mode 100644 index 0000000000..b926eb1ef2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png new file mode 100644 index 0000000000..ae63da7746 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..8447c98f9a --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0] + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png new file mode 100644 index 0000000000..e9b20bd486 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png new file mode 100644 index 0000000000..25ea33ce3a Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/gui/FluidReactor.png b/src/resources/assets/miscutils/textures/gui/FluidReactor.png new file mode 100644 index 0000000000..b8e88bd461 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/FluidReactor.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png b/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png new file mode 100644 index 0000000000..c2736be76c Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png index c16e0a1278..c8c6299d7b 100644 Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png differ -- cgit From 9ba6d563d1b69bc8aa88d48754c273dae77aa713 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 24 Oct 2019 05:07:27 +0100 Subject: % Tried to adjust the name of IC2 Hot Water. $ Fixed OreDicting ore Sodium Hydroxide if GT dusts are detected. $ Fixed bad oredict look-up for RP1 cell. $ Rewrote how GT++ Materials look for existing fluids and cells during generation, hopefully this didn't break any existing cells or fluids. (Please investigate log after loading a world) --- .../core/item/base/BaseItemComponent.java | 2 +- .../core/item/chemistry/AgriculturalChem.java | 31 +- .../core/item/chemistry/RocketFuels.java | 6 +- src/Java/gtPlusPlus/core/material/Material.java | 129 +++---- .../gtPlusPlus/core/slots/SlotNoInputLogging.java | 13 +- .../util/minecraft/gregtech/PollutionUtils.java | 13 +- .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 68 +++- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 2 + .../gui/fluidreactor/Container_FluidReactor.java | 2 + .../xmod/gregtech/common/Meta_GT_Proxy.java | 379 ++++++++++++--------- .../GregtechMetaTileEntity_ChemicalReactor.java | 3 - src/resources/assets/miscutils/lang/en_US.lang | 11 +- 12 files changed, 382 insertions(+), 277 deletions(-) (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index c8b6253753..9b732e38e1 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -169,7 +169,7 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial == null){ if (this.materialName != null){ - list.add(Utils.sanitizeStringKeepBrackets(materialName)); + //list.add(Utils.sanitizeStringKeepBrackets(materialName)); } } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index 324a3aa9ee..55f4dfa0be 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -219,12 +219,19 @@ public class AgriculturalChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium"); ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate"); - if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) { - ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); - } + ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + //Handle GT NaOH dusts + List NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false); + if (!NaOHSmall.isEmpty()) { + ItemUtils.addItemToOreDictionary(NaOHSmall.get(0), "dustSmallSodiumHydroxide"); + } + List NaOHTiny = OreDictionary.getOres("dustTinySodiumHydroxide_GT5U", false); + if (!NaOHTiny.isEmpty()) { + ItemUtils.addItemToOreDictionary(NaOHTiny.get(0), "dustTinySodiumHydroxide"); + } } @@ -300,19 +307,19 @@ public class AgriculturalChem extends ItemPackage { } - public final static AutoMap mMeats = new AutoMap(); - public final static AutoMap mFish = new AutoMap(); - public final static AutoMap mFruits = new AutoMap(); - public final static AutoMap mVege = new AutoMap(); - public final static AutoMap mNuts = new AutoMap(); - public final static AutoMap mSeeds = new AutoMap(); + private final static AutoMap mMeats = new AutoMap(); + private final static AutoMap mFish = new AutoMap(); + private final static AutoMap mFruits = new AutoMap(); + private final static AutoMap mVege = new AutoMap(); + private final static AutoMap mNuts = new AutoMap(); + private final static AutoMap mSeeds = new AutoMap(); private final static AutoMap mPeat = new AutoMap(); private final static AutoMap mBones = new AutoMap(); private final static AutoMap mBoneMeal = new AutoMap(); - public final static AutoMap mList_Master_Meats = new AutoMap(); - public final static AutoMap mList_Master_FruitVege = new AutoMap(); - public final static AutoMap mList_Master_Seeds = new AutoMap(); + private final static AutoMap mList_Master_Meats = new AutoMap(); + private final static AutoMap mList_Master_FruitVege = new AutoMap(); + private final static AutoMap mList_Master_Seeds = new AutoMap(); private final static AutoMap mList_Master_Bones = new AutoMap(); private static void processAllOreDict() { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index c02e767dcd..0bea7dfc31 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -292,7 +292,7 @@ public class RocketFuels extends ItemPackage { GT_Values.RA.addCentrifugeRecipe( CI.getNumberedCircuit(23), - ItemUtils.getItemStackOfAmountFromOreDict("cellRP1Fuel", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellRP1", 1), FluidUtils.getFluidStack(Liquid_Oxygen, 4000), FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 200), CI.emptyCells(1), @@ -679,7 +679,7 @@ public class RocketFuels extends ItemPackage { CoalTar.Coal_Oil = Kerosene; //RP! Focket Fuel - RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null); + RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1", 500, new short[]{210, 50, 50, 100}, null, null); //Create Nitrogen Tetroxide Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("NitrogenTetroxide", "Nitrogen Tetroxide", -11, new short[]{170, 170, 0, 100}, null, null); @@ -753,7 +753,7 @@ public class RocketFuels extends ItemPackage { Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null); Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null); - RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null); + RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Rocket Fuel", -250, new short[]{250, 50, 50, 100}, null, null); Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null); Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index d95b17e75c..b5922dde53 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -1094,96 +1094,41 @@ public class Material { if (this.materialState == MaterialState.ORE){ return null; } + + Fluid aGTBaseFluid = null; - final Materials isValid = Materials.get(this.getLocalizedName()); - //Logger.MATERIALS("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName); - if (isValid != Materials._NULL){ - for (Materials m : invalidMaterials.values()){ - if (isValid == m){ - Logger.MATERIALS("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName); - FluidStack a1 = m.getFluid(1); - FluidStack a2 = m.getGas(1); - FluidStack a3 = m.getMolten(1); - FluidStack a4 = m.getSolid(1); - FluidStack a5 = m.getPlasma(1); - if (a1 != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. Fluid."); - return a1.getFluid(); - } - if (a2 != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. Gas."); - return a2.getFluid(); - } - if (a3 != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. Molten."); - return a3.getFluid(); - } - if (a4 != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. Solid."); - return a4.getFluid(); - } - if (a5 != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. Plasma."); - return a5.getFluid(); - } - Logger.MATERIALS("Using null."); - return null; - } - } - } + // Clean up Internal Fluid Generation + final Materials n1 = MaterialUtils.getMaterial(this.getLocalizedName(), Utils.sanitizeString(this.getLocalizedName())); + final Materials n2 = MaterialUtils.getMaterial(this.getUnlocalizedName(), Utils.sanitizeString(this.getUnlocalizedName())); - if (this.materialState == MaterialState.SOLID){ - if (isValid.mFluid != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } - else if (isValid.mStandardMoltenFluid != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; - } - } - else if (this.materialState == MaterialState.GAS){ - if (isValid.mGas != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; - } - } - else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){ - if (isValid.mFluid != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } - else if (isValid.mGas != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; - } - else if (isValid.mStandardMoltenFluid != null){ - Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; - } - } - - FluidStack aTest1 = FluidUtils.getFluidStack("molten."+Utils.sanitizeString(this.getLocalizedName()), 1); - FluidStack aTest2 = FluidUtils.getFluidStack("fluid."+Utils.sanitizeString(this.getLocalizedName()), 1); - FluidStack aTest3 = FluidUtils.getFluidStack(Utils.sanitizeString(this.getLocalizedName()), 1); + FluidStack f1 = FluidUtils.getWildcardFluidStack(n1, 1); + FluidStack f2 = FluidUtils.getWildcardFluidStack(n2, 1); + FluidStack f3 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1); + FluidStack f4 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1); - if (aTest1 != null) { - Logger.MATERIALS("Found FluidRegistry entry for "+"molten."+Utils.sanitizeString(this.getLocalizedName())); - return aTest1.getFluid(); + if (f1 != null) { + aGTBaseFluid = f1.getFluid(); } - if (aTest2 != null) { - Logger.MATERIALS("Found FluidRegistry entry for "+"fluid."+Utils.sanitizeString(this.getLocalizedName())); - return aTest2.getFluid(); + else if (f2 != null) { + aGTBaseFluid = f2.getFluid(); } - if (aTest3 != null) { - Logger.MATERIALS("Found FluidRegistry entry for "+Utils.sanitizeString(this.getLocalizedName())); - return aTest3.getFluid(); + else if (f3 != null) { + aGTBaseFluid = f3.getFluid(); } + else if (f4 != null) { + aGTBaseFluid = f4.getFluid(); + } + ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1); + ItemStack aFullCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getLocalizedName(), 1); + ItemStack aFullCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1); + ItemStack aFullCell4 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1); + Logger.MATERIALS("Generating our own fluid."); - //Generate a Cell if we need to - if (aFullCell == null){ + //Generate a Cell if we need to, but first validate all four searches are invalid + + if (!ItemUtils.checkForInvalidItems(new ItemStack[] {aFullCell, aFullCell2, aFullCell3, aFullCell4})){ if (this.vGenerateCells){ Item g = new BaseItemCell(this); aFullCell = ItemUtils.getSimpleStack(g); @@ -1193,7 +1138,29 @@ public class Material { Logger.MATERIALS("Did not generate a cell for "+this.getUnlocalizedName()); } } + else { + // One cell we searched for was valid, let's register it. + if (aFullCell != null) { + this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell); + } + else if (aFullCell2 != null) { + this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell2); + } + else if (aFullCell3 != null) { + this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell3); + } + else if (aFullCell4 != null) { + this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell4); + } + } + // We found a GT fluid, let's use it. + // Good chance we registered the cell from this material too. + if (aGTBaseFluid != null) { + return aGTBaseFluid; + } + + // This fluid does not exist at all, time to generate it. if (this.materialState == MaterialState.SOLID){ return FluidUtils.addGTFluid( this.getUnlocalizedName(), diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java index 42bc7ce346..762714ac94 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java +++ b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.slots; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -12,13 +13,23 @@ public class SlotNoInputLogging extends SlotNoInput { public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) { super(inventory, index, x, y); aSlotIndex = index; + Logger.INFO("Slot "+index+" is doing logging"); } @Override public boolean isItemValid(final ItemStack itemstack) { if (ItemUtils.checkForInvalidItems(itemstack)) { Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex); - } + Block b = Block.getBlockFromItem(itemstack.getItem()); + Logger.INFO(""+itemstack.getUnlocalizedName()); + if (b != null) { + Logger.INFO(""+b.getLocalizedName()); + Logger.INFO(""+b.getUnlocalizedName()); + } + } + else { + Logger.INFO("Bad Itemstack"); + } return false; } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index a0a684d3c6..b3372e8bde 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -15,6 +15,7 @@ import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.common.GT_Proxy; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.MaterialGenerator; @@ -239,11 +240,16 @@ public class PollutionUtils { if (CD != null) { Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it."); PollutionUtils.mPollutionFluidStacks.put(CD); + MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(CD); ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); if (ItemUtils.checkForInvalidItems(cellCD)) { Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); } + else { + Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component."); + new BaseItemCell(MISC_MATERIALS.CARBON_DIOXIDE); + } } else { MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false); @@ -252,11 +258,16 @@ public class PollutionUtils { if (CM != null) { Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); PollutionUtils.mPollutionFluidStacks.put(CM); + MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(CM); ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1); if (ItemUtils.checkForInvalidItems(cellCD)) { - Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); + Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component."); MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); } + else { + Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component."); + new BaseItemCell(MISC_MATERIALS.CARBON_MONOXIDE); + } } else { MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false); diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index 9512651417..477bdb2ff5 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -5,10 +5,12 @@ import static gtPlusPlus.core.lib.CORE.GTNH; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.HashSet; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -487,10 +489,64 @@ public class BioRecipes { } - + + + + public final static HashSet mFruits = new HashSet(); + public final static HashSet mVege = new HashSet(); + public final static HashSet mNuts = new HashSet(); + public final static HashSet mSeeds = new HashSet(); + + public final static AutoMap mList_Master_FruitVege = new AutoMap(); + public final static AutoMap mList_Master_Seeds = new AutoMap(); + + private static void processFermentationOreDict() { + processOreDictEntry("listAllfruit", mFruits); + processOreDictEntry("listAllFruit", mFruits); + processOreDictEntry("listAllveggie", mVege); + processOreDictEntry("listAllVeggie", mVege); + processOreDictEntry("listAllnut", mNuts); + processOreDictEntry("listAllNut", mNuts); + processOreDictEntry("listAllseed", mSeeds); + processOreDictEntry("listAllSeed", mSeeds); + + if (!mFruits.isEmpty()) { + for (GT_ItemStack g : mFruits) { + mList_Master_FruitVege.put(g.toStack()); + } + } + if (!mVege.isEmpty()) { + for (GT_ItemStack g : mVege) { + mList_Master_FruitVege.put(g.toStack()); + } + } + if (!mNuts.isEmpty()) { + for (GT_ItemStack g : mNuts) { + mList_Master_FruitVege.put(g.toStack()); + } + } + if (!mSeeds.isEmpty()) { + for (GT_ItemStack g : mSeeds) { + mList_Master_Seeds.put(g.toStack()); + } + } + } + + // Make Fermentation + private static void processOreDictEntry(String aOreName, HashSet mfruits2) { + ArrayList aTemp = OreDictionary.getOres(aOreName); + if (!aTemp.isEmpty()) { + for (ItemStack stack : aTemp) { + mfruits2.add(new GT_ItemStack(stack)); + } + } + } + + private static void recipeFermentationBase() { - AutoMap aFruitVege = AgriculturalChem.mList_Master_FruitVege; - AutoMap aSeeds = AgriculturalChem.mList_Master_Seeds; + processFermentationOreDict(); + AutoMap aFruitVege = mList_Master_FruitVege; + AutoMap aSeeds = mList_Master_Seeds; ArrayList aMap = OreDictionary.getOres("cropSugarbeet"); for (ItemStack a : aFruitVege) { if (aMap.contains(a)) { @@ -780,7 +836,7 @@ public class BioRecipes { private static void recipeAluminiumPellet() { GT_Values.RA.addAutoclaveRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 3), - null, + FluidUtils.getFluidStack(BioRecipes.mAir, 1000), ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4), 10000, 120 * 20, @@ -856,7 +912,7 @@ public class BioRecipes { private static void recipeAlginicAcid() { - // Turn into Cellulose Pulp + /*// Turn into Cellulose Pulp CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getBioChip(7), ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20), @@ -865,7 +921,7 @@ public class BioRecipes { GT_Values.NF, ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20), 90 * 20, - 16); + 16);*/ } private static void recipeSulfuricAcid() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index f85d432b0c..42354e49e1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -36,6 +36,7 @@ import gtPlusPlus.everglades.gen.gt.WorldGen_GT; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; @@ -134,6 +135,7 @@ public class HANDLER_GT { } RecipesToRemove.go(); convertPyroToCokeOven(); + Meta_GT_Proxy.fixIC2FluidNames(); } private static void convertPyroToCokeOven() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java index 0c64644166..cdca065e60 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java @@ -11,6 +11,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.slots.SlotChemicalPlantInput; import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.slots.SlotNoInputLogging; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor; import net.minecraft.entity.player.EntityPlayer; @@ -93,6 +94,7 @@ public class Container_FluidReactor extends GT_Container_BasicMachine { } } } + //Logger.INFO("Clicked slot "+aSlotIndex); return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 2d7151bf45..d507b3c814 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -13,10 +13,12 @@ import java.util.Timer; import java.util.TimerTask; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; @@ -33,11 +35,15 @@ import gtPlusPlus.core.handler.AchievementHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity; import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.BaseCustomPower_MTE; import gtPlusPlus.xmod.gregtech.common.covers.CoverManager; +import ic2.core.init.BlocksItems; +import ic2.core.init.InternalName; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -45,6 +51,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class Meta_GT_Proxy { @@ -52,74 +60,111 @@ public class Meta_GT_Proxy { static { Logger.INFO("GT_PROXY - initialized."); } - + public static List GT_BlockIconload = new ArrayList<>(); public static List GT_ItemIconload = new ArrayList<>(); - + public static AutoMap GT_ValidHeatingCoilMetas = new AutoMap(); private static Class sBaseMetaTileEntityClass; private static Class sBaseMetaTileEntityClass2; - + public static AchievementHandler mAssemblyAchievements; - + public static final Map mCustomGregtechMetaTooltips = new LinkedHashMap(); - + @SideOnly(Side.CLIENT) public static IIconRegister sBlockIcons, sItemIcons; public Meta_GT_Proxy() { - + } - + public static Block sBlockMachines; - + public static void preInit() { - + //New GT++ Block, yay! (Progress) //sBlockMachines = new GTPP_Block_Machines(); - - GT_Log.out.println("GT++ Mod: Register TileEntities."); - BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity(); - BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower(); - - GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity."); - if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) { - GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); - throw new RuntimeException(""); - } - - //Gotta set it here so that we don't try call gregtech too early. - //Must set on the correct side - - if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) { - StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe"); - } - else { - StaticFields59.mGT6StylePipes = false; - } - - GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity."); - GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP"); - GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2"); - CoverManager.generateCustomCovers(); + fixIC2FluidNames(); + + GT_Log.out.println("GT++ Mod: Register TileEntities."); + BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity(); + BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower(); + + GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity."); + if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) { + GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + throw new RuntimeException(""); + } + + //Gotta set it here so that we don't try call gregtech too early. + //Must set on the correct side + + if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) { + StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe"); + } + else { + StaticFields59.mGT6StylePipes = false; + } + + GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity."); + GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP"); + GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2"); + CoverManager.generateCustomCovers(); } - + public static void init() { scheduleCoverMapCleaner(); setValidHeatingCoilMetas(); + PollutionUtils.setPollutionFluids(); + fixIC2FluidNames(); } - + public static void postInit() { - mAssemblyAchievements = new AchievementHandler(); + mAssemblyAchievements = new AchievementHandler(); + fixIC2FluidNames(); } - + + @SuppressWarnings("deprecation") + public static void fixIC2FluidNames() { + //Fix IC2 Hot Water name + try { + String aNewHeatedWaterName = "Heated Water"; + Logger.INFO("Renaming [IC2 Hotspring Water] --> ["+aNewHeatedWaterName+"].");LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water"); + LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName); + LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName); + GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName); + GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName); + + Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater); + if (b != null) { + LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName); + LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName); + GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName); + } + Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater); + if (f != null) { + LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName); + GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName); + int aDam = FluidRegistry.getFluidID(f); + ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam); + if (s != null) { + LanguageRegistry.addName(s, aNewHeatedWaterName); + } + } + } + catch (Throwable t) { + + } + } + public static boolean generatePlasmaRecipesForAdvVacFreezer() { - + AutoMap aFreezerMapRebaked = new AutoMap(); AutoMap aRemovedRecipes = new AutoMap(); - + //Find recipes containing Plasma and map them for (Recipe_GT y : Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList) { if (y.mFluidInputs.length > 0) { @@ -132,20 +177,20 @@ public class Meta_GT_Proxy { aFreezerMapRebaked.put(y); } } - + AutoMap aNewRecipes = new AutoMap(); int aAtomicMass = 0; int aAtomicTier = 0; - + final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1); - + for (String s : ELEMENT.NAMES) { - + aAtomicMass++; aAtomicTier = (aAtomicMass/30)+1; FluidStack aMoltenFluid = null; FluidStack aPlasma = null; - + //Try Get Material via Gregtech Materials aGregMaterial = MaterialUtils.getMaterial(s); if (aGregMaterial != null) { @@ -161,7 +206,7 @@ public class Meta_GT_Proxy { } aPlasma = aGregMaterial.getPlasma(100); } - + //Just wildcard values if (aMoltenFluid == null || aPlasma == null) { if (aMoltenFluid == null) { @@ -171,7 +216,7 @@ public class Meta_GT_Proxy { aPlasma = FluidUtils.getFluidStack("plasma."+s.toLowerCase(), 1); } } - + //Skip this material if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) { Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling "+s+" plasma. Molten Form Exists? "+(aMoltenFluid != null)+" | Plasma Exists? "+(aPlasma != null)); @@ -186,49 +231,49 @@ public class Meta_GT_Proxy { null, new int[] {10000}, new FluidStack[] { - aPlasma, - FluidUtils.getFluidStack("cryotheum", aTotalTickTime) - }, + aPlasma, + FluidUtils.getFluidStack("cryotheum", aTotalTickTime) + }, new FluidStack[] { - aMoltenFluid - }, + aMoltenFluid + }, aTotalTickTime, (int) GT_Values.V[4+aAtomicTier], aAtomicMass); - + //Add it to the map if it's valid if (aTempRecipe != null) { aNewRecipes.put(aTempRecipe); } } - + } - + //Add the new recipes to the map we will rebake over the original for (Recipe_GT w : aNewRecipes) { aFreezerMapRebaked.put(w); } - + //Best not touch the original map if we don't have a valid map to override it with. if (aFreezerMapRebaked.size() > 0) { - + int aOriginalCount = Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size(); - + //Empty the original map Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear(); - + //Rebake the real map for (Recipe_GT w : aFreezerMapRebaked) { Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w); } - + return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount; } - + return false; } - + public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) { if (aMeta == 12) { return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower(); @@ -237,7 +282,7 @@ public class Meta_GT_Proxy { return Meta_GT_Proxy.constructBaseMetaTileEntity(); } } - + public static BaseCustomTileEntity constructBaseMetaTileEntity() { if (sBaseMetaTileEntityClass == null) { try { @@ -264,7 +309,7 @@ public class Meta_GT_Proxy { } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { GT_Log.err - .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); throw new RuntimeException(e); } @@ -299,20 +344,20 @@ public class Meta_GT_Proxy { } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) { GT_Log.err - .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); throw new RuntimeException(e); } } } - - - - - - - - + + + + + + + + public static void setValidHeatingCoilMetas() { for (int i = 0; i <= 6; i++ ) { GT_ValidHeatingCoilMetas.put(i); @@ -336,20 +381,20 @@ public class Meta_GT_Proxy { return false; } } - + public static void scheduleCoverMapCleaner(){ - TimerTask repeatedTask = new TimerTask() { - public void run() { - cleanupOverFlowCoverCache(); - } - }; - Timer timer = new Timer("CoverCleanupManager"); - long delay = 120000L; - long period = 300000L; - timer.scheduleAtFixedRate(repeatedTask, delay, period); + TimerTask repeatedTask = new TimerTask() { + public void run() { + cleanupOverFlowCoverCache(); + } + }; + Timer timer = new Timer("CoverCleanupManager"); + long delay = 120000L; + long period = 300000L; + timer.scheduleAtFixedRate(repeatedTask, delay, period); } - + public static int cleanupOverFlowCoverCache() { ObjMap cache = mOverflowCache; int aRemoved = 0; @@ -376,8 +421,8 @@ public class Meta_GT_Proxy { } return aRemoved; } - - + + static GT_Proxy[] mProxies = new GT_Proxy[2]; /** @@ -386,47 +431,47 @@ public class Meta_GT_Proxy { public static Object getFieldFromGregtechProxy(boolean client, String fieldName) { return StaticFields59.getFieldFromGregtechProxy(fieldName); } - + public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) { mCustomGregtechMetaTooltips.put(aNbtTagName, aData); } - - public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { - try { - int tDamage = aStack.getItemDamage(); - if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { - return; - } - - if (GregTech_API.METATILEENTITIES[tDamage] != null) { - IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); - if (tTileEntity.getDescription() != null) { - int i = 0; - for (String tDescription : tTileEntity.getDescription()) { - if (GT_Utility.isStringValid(tDescription)) { - if(tDescription.contains("%%%")){ - String[] tString = tDescription.split("%%%"); - if(tString.length>=2){ - StringBuffer tBuffer = new StringBuffer(); - Object tRep[] = new String[tString.length / 2]; - for (int j = 0; j < tString.length; j++) - if (j % 2 == 0) tBuffer.append(tString[j]); - else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];} - aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep)); - } - }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); - aList.add(tTranslated.equals("") ? tDescription : tTranslated);} - }else i++; - } - } - + + public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { + try { + int tDamage = aStack.getItemDamage(); + if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { + return; + } + + if (GregTech_API.METATILEENTITIES[tDamage] != null) { + IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); + if (tTileEntity.getDescription() != null) { + int i = 0; + for (String tDescription : tTileEntity.getDescription()) { + if (GT_Utility.isStringValid(tDescription)) { + if(tDescription.contains("%%%")){ + String[] tString = tDescription.split("%%%"); + if(tString.length>=2){ + StringBuffer tBuffer = new StringBuffer(); + Object tRep[] = new String[tString.length / 2]; + for (int j = 0; j < tString.length; j++) + if (j % 2 == 0) tBuffer.append(tString[j]); + else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];} + aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep)); + } + }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); + aList.add(tTranslated.equals("") ? tDescription : tTranslated);} + }else i++; + } + } + if (tTileEntity.getEUCapacity() > 0L) { final long tVoltage = tTileEntity.getInputVoltage(); byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage))); - + //Custom handling if (tDamage < 30500 && tDamage >= 30400) { int aOffset = tDamage - 30400; @@ -439,13 +484,13 @@ public class Meta_GT_Proxy { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - - + + if (tTileEntity.getInputVoltage() > 0L) { String inA = "0"; if (tTileEntity.getInputAmperage() >= 1L) { @@ -473,20 +518,20 @@ public class Meta_GT_Proxy { + EnumChatFormatting.GRAY + outA; aList.add(a1); } - + if (tTileEntity.getOutputVoltage() > 0L) { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+""+(tDamage < 30500 && tDamage >= 30400 ? 0 : 1), !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - + if (tTileEntity.getEUCapacity() > 0) { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU"); } } - - /*if (tTileEntity.getEUCapacity() > 0L) { + + /*if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); } @@ -498,42 +543,42 @@ public class Meta_GT_Proxy { } aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); }*/ - - } - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - if (aNBT.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished )); - } - if (aNBT.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished )); - } - int tAmount = 0; - if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { - aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished )); - } - - FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); - if (afluid != null) { - int tFluidAmount = afluid.amount; - if (tFluidAmount > 0) { - aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished )); - } - } - - } - - //Add Custom Here - - //Add Custom Tooltips - for (String s : mCustomGregtechMetaTooltips.keySet()) { - if (aNBT.hasKey(s)) { - String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s)); - aList.add(aTip); - } - } - - //Add GT++ Stuff + + } + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + if (aNBT.getBoolean("mMuffler")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished )); + } + if (aNBT.getBoolean("mSteamConverter")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished )); + } + int tAmount = 0; + if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { + aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished )); + } + + FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + if (afluid != null) { + int tFluidAmount = afluid.amount; + if (tFluidAmount > 0) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished )); + } + } + + } + + //Add Custom Here + + //Add Custom Tooltips + for (String s : mCustomGregtechMetaTooltips.keySet()) { + if (aNBT.hasKey(s)) { + String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s)); + aList.add(aTip); + } + } + + //Add GT++ Stuff if (tDamage >= 30400 && tDamage < 30500) { aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine"); @@ -541,11 +586,11 @@ public class Meta_GT_Proxy { if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) { aList.add(CORE.GT_Tooltip); } - - - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } - } + + + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java index 288b48ebb5..ed312b704d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -18,7 +18,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotChemicalPlantInput; import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor; @@ -30,7 +29,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; @@ -257,7 +255,6 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - // Re-implement basic machine logic from the ground up. if (aBaseMetaTileEntity.isServerSide()) { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index cbba0cc3d8..394680edd8 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3045,7 +3045,6 @@ item.ureamix.name=Cell of Urea Mix item.liquidresin.name=Cell of Liquid Resin item.propionicacid.name=Propionic Acid Cell item.aceticacid.name=Acetic Acid Cell - item.BasicAgrichemItem.0.name=Algae Biomass item.BasicAgrichemItem.1.name=Green Algae Biomass item.BasicAgrichemItem.2.name=Brown Algae Biomass @@ -3067,4 +3066,12 @@ item.BasicAgrichemItem.17.name=Aluminium Pellet item.BasicAgrichemItem.18.name=Sodium Aluminate item.BasicAgrichemItem.19.name=Sodium Hydroxide item.BasicAgrichemItem.20.name=Sodium Carbonate -item.BasicAgrichemItem.21.name=Lithium Chloride \ No newline at end of file +item.BasicAgrichemItem.21.name=Lithium Chloride + +//Added 24/10/19 +item.butanol.name=Butanol Cell + +//Try Fix IC2 Garbage vv +fluidHotWater=Heated Water +fluidHotWater.name=Heated Water +//Try Fix IC2 Garbage ^^ \ No newline at end of file -- cgit From 10d4c7d4b4fd651d64f17936a916785b36a43f92 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 8 Dec 2019 02:00:35 +0000 Subject: + Added an assembly recipe for tier 1 Round Robinators. + Added localization for Rotor Housing achievement. + Added the Algae Farm (WIP). - Removed Durability bar on Iridium Rotors. - Reverted 2A hatch fix on Multiblocks. % Adjusted all Robinator recipes, removing the fluid requirements. $ Fixed Robinators Crashing on Servers. $ Implemented new backend for all future non-GT tile entities. --- .../api/objects/minecraft/CubicObject.java | 62 +++++ .../api/objects/minecraft/SafeTexture.java | 64 +++++ .../core/block/base/BasicTileBlockWithTooltip.java | 309 +++++++++++++++++++++ .../core/block/machine/CircuitProgrammer.java | 111 ++++---- .../core/block/machine/Machine_RoundRobinator.java | 138 ++++----- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + .../item/base/itemblock/ItemBlockBasicTile.java | 33 ++- .../item/base/itemblock/ItemBlockBasicTooltip.java | 34 --- .../base/itemblock/ItemBlockRoundRobinator.java | 6 +- src/Java/gtPlusPlus/core/lib/CORE.java | 23 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 6 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 13 +- .../core/util/minecraft/ClientUtils.java | 18 ++ .../xmod/gregtech/api/enums/GregtechItemList.java | 3 + .../base/GregtechMeta_MultiBlockBase.java | 51 ++-- .../algae/GregtechMTE_AlgaePondBase.java | 128 +++++++++ .../gregtech/GregtechAlgaeContent.java | 24 ++ .../xmod/ic2/item/CustomKineticRotor.java | 274 ++++++++++++++++++ src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java | 68 ++--- .../gtPlusPlus/xmod/ic2/item/RotorIridium.java | 5 + src/resources/assets/gregtech/lang/en_US.lang | 4 +- .../RoundRobinator/RoundRobinator_Side_0.png | Bin 1448 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_1.png | Bin 1444 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_2.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_3.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_4.png | Bin 1443 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_0.png | Bin 1405 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_1.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_2.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_3.png | Bin 1402 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_4.png | Bin 1400 -> 0 bytes .../blocks/TileEntities/RoundRobinator/Side_0.png | Bin 0 -> 1448 bytes .../blocks/TileEntities/RoundRobinator/Side_1.png | Bin 0 -> 1444 bytes .../blocks/TileEntities/RoundRobinator/Side_2.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_3.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_4.png | Bin 0 -> 1443 bytes .../blocks/TileEntities/RoundRobinator/Top_0.png | Bin 0 -> 1405 bytes .../blocks/TileEntities/RoundRobinator/Top_1.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_2.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_3.png | Bin 0 -> 1402 bytes .../blocks/TileEntities/RoundRobinator/Top_4.png | Bin 0 -> 1400 bytes 41 files changed, 1096 insertions(+), 279 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java create mode 100644 src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java delete mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java create mode 100644 src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java create mode 100644 src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java new file mode 100644 index 0000000000..8c76513d09 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java @@ -0,0 +1,62 @@ +package gtPlusPlus.api.objects.minecraft; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.common.util.ForgeDirection; + +public class CubicObject { + + public final T NORTH; + public final T SOUTH; + + public final T WEST; + public final T EAST; + + public final T UP; + public final T DOWN; + + public CubicObject(AutoMap aDataSet) { + this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5)); + } + + public CubicObject(T[] aDataSet) { + this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]); + } + + public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) { + DOWN = aDOWN; + UP = aUP; + NORTH = aNORTH; + SOUTH = aSOUTH; + WEST = aWEST; + EAST = aEAST; + } + + public T get(int aSide) { + return get(ForgeDirection.getOrientation(aSide)); + } + + public T get(ForgeDirection aSide) { + if (aSide == ForgeDirection.DOWN) { + return DOWN; + } + else if (aSide == ForgeDirection.UP) { + return UP; + } + else if (aSide == ForgeDirection.NORTH) { + return NORTH; + } + else if (aSide == ForgeDirection.SOUTH) { + return SOUTH; + } + else if (aSide == ForgeDirection.WEST) { + return WEST; + } + else if (aSide == ForgeDirection.EAST) { + return EAST; + } + else { + return null; + } + } + +} diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java new file mode 100644 index 0000000000..7c418b5a77 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java @@ -0,0 +1,64 @@ +package gtPlusPlus.api.objects.minecraft; + +import java.util.HashMap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gtPlusPlus.core.util.Utils; +import net.minecraft.util.IIcon; + +/** + * A Server Side safe object that can hold {@link IIcon}s. + * @author Alkalus + * + */ +public class SafeTexture implements Runnable { + + @SideOnly(Side.CLIENT) + private static final HashMap mHashToIconCache = new HashMap(); + + @SideOnly(Side.CLIENT) + private static final HashMap mPathToHashCash = new HashMap(); + + private static final HashMap mTextureObjectCache = new HashMap(); + + private final int mHash; + + private final String mTextureName; + + private final static String getKey(String aTexPath) { + String aNameKey = Utils.sanitizeString(aTexPath); + aNameKey = aNameKey.replace('/', ' '); + aNameKey = aNameKey.toLowerCase(); + return aNameKey; + } + + public static SafeTexture register(String aTexturePath) { + String aNameKey = getKey(aTexturePath); + SafeTexture g = mTextureObjectCache.get(aNameKey); + if (g == null) { + g = new SafeTexture(aTexturePath); + mTextureObjectCache.put(aNameKey, g); + mPathToHashCash.put(aTexturePath, aTexturePath.hashCode()); + } + return g; + } + + private SafeTexture(String aTexturePath) { + mTextureName = aTexturePath; + mHash = getKey(aTexturePath).hashCode(); + GregTech_API.sGTBlockIconload.add(this); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return mHashToIconCache.get(mHash); + } + + @Override + public void run() { + mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName)); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java new file mode 100644 index 0000000000..098b670509 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -0,0 +1,309 @@ +package gtPlusPlus.core.block.base; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.api.objects.minecraft.SafeTexture; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip { + + /** + * Each mapped object holds the data for the six sides. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTextureArray = new AutoMap>(); + + /** + * Holds the data for the six sides, each side holds an array of data for each respective meta. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTexturePathArray = new AutoMap>(); + + /** + * Does this block have any meta at all? + * @return + */ + public final boolean hasMeta() { + return getMetaCount() > 0; + } + + /** + * The amount of meta this block has. + * @return + */ + public abstract int getMetaCount(); + + /** + * Does this {@link Block} require special {@link ItemBlock} handling? + * @return The {@link Class} that will be used for this {@link Block}. + */ + public Class getItemBlockClass() { + return ItemBlock.class; + } + + /** + * A lazy way to declare the unlocal name for the block, makes boilerplating easy. + * @return The internal name for this block. + */ + public abstract String getUnlocalBlockName(); + + /** + * Does this Block have {@link ITileTooltip} support? + * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not. + */ + public final boolean hasTooltip() { + return getTooltipID() >= -1; + } + + /** + * Lazy Boilerplating. + * @return Block Hardness. + */ + protected abstract float initBlockHardness(); + + /** + * Lazy Boilerplating. + * @return Block Resistance. + */ + protected abstract float initBlockResistance(); + + /** + * Lazy Boilerplating. + * @return The {@link CreativeTab} this Block is shown on. + */ + protected abstract CreativeTabs initCreativeTab(); + + /** + * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}(). + * @return + */ + @Override + public abstract int getTooltipID(); + + public BasicTileBlockWithTooltip(Material aBlockMat){ + super(aBlockMat); + //Use Abstract method values + this.setHardness(initBlockHardness()); + this.setResistance(initBlockResistance()); + this.setBlockName(getUnlocalBlockName()); + this.setCreativeTab(initCreativeTab()); + // Register the block last. + GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName()); + Logger.INFO("Registered "+getTileEntityName()+"."); + if (Utils.isClient()) { + // Handle Textures + handleTextures(); + } + } + + /** + * The name of the Tile Entity. + * @return + */ + protected abstract String getTileEntityName(); + + /** + * The String used for texture pathing. + * @return Sanitized {@link String}, containing no spaces or illegal characters. + */ + private final String getTileEntityNameForTexturePathing() { + return Utils.sanitizeString(getTileEntityName().replace(" ", "")); + } + + /** + * An array of CubicObjects, one for each meta, else just a single cell array. + * Expected to be null regularly, as the default texture handling should suffice. + * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used, + * inclusive of the MODID and a colon. + * @return + */ + public CubicObject[] getCustomTextureDirectoryObject(){ + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public final IIcon getIcon(final int aSide, final int aMeta) { + return mSidedTextureArray.get(aMeta).get(aSide).getIcon(); + } + + @Override + public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + return super.getIcon(aWorld, aX, aY, aZ, aSide); + } + + @SideOnly(Side.CLIENT) + private final void handleTextures() { + + Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+"."); + //Store them in forge order + //DOWN, UP, NORTH, SOUTH, WEST, EAST + + // Default Path Name, this will make us look inside 'miscutils\textures\blocks' + final String aPrefixTexPath = CORE.MODID + ":"; + // Default Path Name, this will make us look in the sub-directory for this Tile Entity. + final String aTexPathMid = "TileEntities"+CORE.SEPERATOR+getTileEntityNameForTexturePathing()+CORE.SEPERATOR; + // Construct a full path + String aTexPathBuilt = aPrefixTexPath + aTexPathMid; + // File Name Suffixes, without meta tags + String aStringBot; + String aStringTop; + String aStringBack; + String aStringFront; + String aStringLeft; + String aStringRight; + // Do we provide a matrix of custom data to be used for texture processing instead? + if (getCustomTextureDirectoryObject() != null) { + // Get custom provided texture data. + CubicObject[] aDataMap = getCustomTextureDirectoryObject(); + Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: "+aDataMap.length); + // Map each meta string data to the main map. + for (int i=0;i aMetaBlob = new CubicObject(aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight); + mSidedTexturePathArray.put(aMetaBlob); + Logger.INFO("[TeTexture] Added Texture Path data to map for meta "+i); + } + } + Logger.INFO("[TeTexture] Map size for pathing: "+mSidedTexturePathArray.size()); + + // Iteration Index + int aIndex = 0; + + // Iterate each CubicObject, holding the six texture paths for each meta. + for (CubicObject aMetaBlob : mSidedTexturePathArray) { + // Make a Safe Texture for each side + SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN); + SafeTexture aTop = SafeTexture.register(aMetaBlob.UP); + SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH); + SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH); + SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST); + SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST); + // Store them in an Array + SafeTexture[] aInjectBlob = new SafeTexture[] { + aBottom, + aTop, + aBack, + aFont, + aWest, + aEast + }; + // Convenience Blob + CubicObject aMetaBlob2 = new CubicObject(aInjectBlob); + // Store this Blob into + mSidedTextureArray.put(aMetaBlob2); + Logger.INFO("[TeTexture] Added SafeTexture data to map for meta "+(aIndex++)); + } + Logger.INFO("[TeTexture] Map size for registration: "+mSidedTextureArray.size()); + + + } + + @Override + @SideOnly(Side.CLIENT) + public final void registerBlockIcons(final IIconRegister aRegisterer){ + this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net"); + } + + @Override + public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); + + /** + * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call. + */ + public void onBlockBreak() { + + } + + @Override + public final void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { + onBlockBreak(); + InventoryUtils.dropInventoryItems(world, x, y, z, block); + super.breakBlock(world, x, y, z, block, number); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + if (hasMeta()) { + for (int i=0;i[] getCustomTextureDirectoryObject() { + String[] aTexData = new String[] { + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G", + CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I" + }; + CubicObject[] aTextureData = new CubicObject[] {new CubicObject(aTexData)}; + return aTextureData; + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index cd480dcffe..dc87b885b9 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -1,85 +1,27 @@ package gtPlusPlus.core.block.machine; -import java.util.List; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.util.minecraft.InventoryUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip -{ - @SideOnly(Side.CLIENT) - private IIcon[] textureTop = new IIcon[5]; - @SideOnly(Side.CLIENT) - private IIcon[] textureFront = new IIcon[5]; +public class Machine_RoundRobinator extends BasicTileBlockWithTooltip { + - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 7; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - @SuppressWarnings("deprecation") public Machine_RoundRobinator(){ super(Material.iron); - this.setHardness(1f); - this.setResistance(1f); - this.setBlockName("blockRoundRobinator"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockRoundRobinator.class, "blockRoundRobinator"); - //LanguageRegistry.addName(this, "Round-Robinator"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int aSide, final int aMeta) { - if (aSide < 2) { - return this.textureTop[aMeta]; - } - else { - return this.textureFront[aMeta]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_){ - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "RoundRobinator_Side"); - for (int i=0;i<5;i++) { - this.textureTop[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Top_"+i); - this.textureFront[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Side_"+i); - } } /** @@ -97,13 +39,11 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt // Check For Screwdriver try { final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); - final Item mHandItem = mHandStack.getItem(); - if (((mHandItem instanceof GT_MetaGenerated_Tool_01) - && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { + if (ItemUtils.isToolScrewdriver(mHandStack)) { final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z); if (tile != null) { mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z); - } + } } } catch (final Throwable t) {} @@ -122,52 +62,70 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt } @Override - public int getRenderBlockPass() { - return 0; + public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { + return new TileEntityRoundRobinator(); } @Override - public boolean isOpaqueCube() { - return false; + public int getMetaCount() { + return 5; } @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityRoundRobinator(); + public String getUnlocalBlockName() { + return "blockRoundRobinator"; } @Override - public void onBlockAdded(final World world, final int x, final int y, final int z) { - super.onBlockAdded(world, x, y, z); + protected float initBlockHardness() { + return 1; } @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { - InventoryUtils.dropInventoryItems(world, x, y, z, block); - super.breakBlock(world, x, y, z, block, number); + protected float initBlockResistance() { + return 1; } @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + protected CreativeTabs initCreativeTab() { + return AddToCreativeTab.tabMachines; } @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { - return false; + public int getTooltipID() { + return -1; } @Override - public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { - //super.getSubBlocks(aItem, p_149666_2_, aList); - for (int i=0;i<5;i++) { - aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); - } + protected String getTileEntityName() { + return "Round Robinator"; + } + + @Override + public Class getItemBlockClass() { + return ItemBlockRoundRobinator.class; } @Override - public IIcon getIcon(IBlockAccess aBlockAccess, int x, int y, int z, int aSide) { - return super.getIcon(aBlockAccess, x, y, z, aSide); + public CubicObject[] getCustomTextureDirectoryObject() { + AutoMap aTemp = new AutoMap(); + for (int i=0;i<5;i++) { + String[] aTexData = new String[] { + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + }; + aTemp.put(aTexData); + } + AutoMap> aTemp2 = new AutoMap>(); + for (String[] y : aTemp) { + aTemp2.put(new CubicObject(y)); + } + CubicObject[] aTextureData = new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)}; + return aTextureData; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 0b1078366a..ca62a524c1 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -136,6 +136,7 @@ public class COMPAT_HANDLER { GregtechLargeTurbinesAndHeatExchanger.run(); GregtechPowerBreakers.run(); GregtechFluidReactor.run(); + GregtechAlgaeContent.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index 42890ddfa6..251230932c 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -26,28 +26,43 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Can also be placed beside upto 4 other fish traps"); list.add("Requires at least two faces touching water"); list.add("1/1000 chance to produce triple loot."); - } else if (this.mID == 1) { // Modularity + } + else if (this.mID == 1) { // Modularity list.add("Used to construct modular armour & bauble upgrades.."); - } else if (this.mID == 2) { // Trade + } + else if (this.mID == 2) { // Trade list.add("Allows for SMP trade-o-mat type trading."); - } else if (this.mID == 3) { // Project + } + else if (this.mID == 3) { // Project list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter.."); - } else if (this.mID == 4) { // Circuit Table + } + else if (this.mID == 4) { // Circuit Table list.add("Easy Circuit Configuration"); list.add("Change default setting with a Screwdriver"); list.add("Default is used to select slot for auto-insertion"); - } else if (this.mID == 5) { // Decayables Chest + } + else if (this.mID == 5) { // Decayables Chest list.add("Chest which holds radioactive materials"); list.add("Items which decay will tick while inside"); list.add("Place with right click"); - } else if (this.mID == 6) { // Butterfly Killer + } + else if (this.mID == 6) { // Butterfly Killer list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { - } else { - list.add("Bad Tooltip ID - " + mID); + } + else if (this.mID == 7) { + } + else if (this.mID == 8){ + + } + else if (this.mID == 9){ + + } + + else { + list.add("Bad Tooltip ID - " + mID); } super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java deleted file mode 100644 index 9badd384d8..0000000000 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java +++ /dev/null @@ -1,34 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.api.interfaces.ITileTooltip; - -public class ItemBlockBasicTooltip extends ItemBlock{ - - protected final int mID; - - public ItemBlockBasicTooltip(final Block block) { - super(block); - this.mID = ((ITileTooltip) block).getTooltipID(); - } - - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - if (this.mID == 0){ //blockDarkWorldPortalFrame - list.add("Assembled in the same shape as the Nether Portal."); - } - else if (this.mID == 1){ //Modularity - list.add("Used to construct modular armour & bauble upgrades.."); - } - } - - -} diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java index f586695eb7..2d0fd00dd9 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -16,8 +16,6 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata public ItemBlockRoundRobinator(final Block aBlock){ super(aBlock, aBlock); this.mBlock = aBlock; - this.setMaxDamage(4); - this.setHasSubtypes(true); } @@ -40,7 +38,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata else if (stack.getItemDamage() == 4) { list.add("1 Item per enabled side every tick"); } - list.add("Top and bottom do not pull, so you must push item in"); + list.add("Top and bottom do not pull, so you must push items in"); list.add("Sides can also be disabled with a screwdriver"); list.add("Shift+RMB with empty hand to view inventory contents"); super.addInformation(stack, aPlayer, list, bool); @@ -62,7 +60,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata @Override public int getMetadata(final int p_77647_1_) { - return super.getMetadata(p_77647_1_); + return p_77647_1_; } @Override diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 04f1861cfe..3330ad8c3f 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -5,10 +5,13 @@ import java.util.concurrent.ConcurrentHashMap; import com.mojang.authlib.GameProfile; +import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.core.util.sys.GeoUtils; import gtPlusPlus.core.util.sys.NetworkUtils; import gtPlusPlus.preloader.CORE_Preloader; @@ -52,7 +55,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.7.03.01"; + public static final String VERSION = "1.7.03.45"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); @@ -76,7 +79,7 @@ public class CORE { public static int turbineCutoffBase = 75000; //GT++ Fake Player Profile - public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); + public static final GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); public static final WeakHashMap fakePlayerCache = new WeakHashMap(); //Tooltips; public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; @@ -88,6 +91,7 @@ public class CORE { //Because I want to be lazy. Beyond Reality Classic Var. public static boolean BRC = false; + public static final String SEPERATOR = "/"; /** @@ -286,7 +290,20 @@ public class CORE { } public static final void crash() { - System.exit(0); + Logger.ERROR("=========================================================="); + Logger.ERROR("[GT++ CRASH]"); + Logger.ERROR("=========================================================="); + Logger.ERROR("Oooops..."); + Logger.ERROR("This should only happy in a development environment or when something really bad happens."); + Logger.ERROR("=========================================================="); + Logger.ERROR("Called from: "+ReflectionUtils.getMethodName(0)); + Logger.ERROR(ReflectionUtils.getMethodName(1)); + Logger.ERROR(ReflectionUtils.getMethodName(2)); + Logger.ERROR(ReflectionUtils.getMethodName(3)); + Logger.ERROR(ReflectionUtils.getMethodName(4)); + Logger.ERROR(ReflectionUtils.getMethodName(5)); + Logger.ERROR(ReflectionUtils.getMethodName(6)); + FMLCommonHandler.instance().exitJava(0, true); } public static final void gc() { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index ea7f5e4ef7..cac54cec4e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1584,10 +1584,10 @@ public class RECIPES_GREGTECH { // Supreme Pizza Gloves CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { - ItemUtils.getGregtechCircuit(17), - ItemUtils.getSimpleStack(ModItems.itemRope, 16), + ItemUtils.getGregtechCircuit(19), + ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4), - ItemUtils.getItemStackOfAmountFromOreDict("wireFineTin", GTNH ? 32 : 16), + ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1) }, FluidUtils.getFluidStack("molten.rubber", 2000), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index c0a4a998e8..f5bd390aee 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -2331,6 +2331,17 @@ public class RECIPES_Machines { for (int i = 0; i < 5; i++) { if (i == 0) { + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedCircuit(17), + CI.getTieredMachineCasing(0), + ItemUtils.getSimpleStack(Blocks.hopper, 4), + CI.getTieredComponent(OrePrefixes.circuit, 0, 2) + }, + GT_Values.NF, //Input Fluid + aRobinators[i], + 45 * 10 * 1, + 8); continue; } int aTier = i+1; @@ -2345,7 +2356,7 @@ public class RECIPES_Machines { CORE.RA.addSixSlotAssemblingRecipe( aInputs, - CI.getAlternativeTieredFluid(aTier, (144 * 2 * i)), //Input Fluid + GT_Values.NF, //Input Fluid aRobinators[i], 45 * 10 * 1 * (i+1), MaterialUtils.getVoltageForTier(i)); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java new file mode 100644 index 0000000000..806f83d830 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java @@ -0,0 +1,18 @@ +package gtPlusPlus.core.util.minecraft; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; + +public class ClientUtils { + + static { + if (FMLCommonHandler.instance().getSide() == Side.SERVER) { + Logger.ERROR("Something tried to access the ClientUtils class from the Server Side."); + Logger.ERROR("Soft crashing to prevent data corruption."); + CORE.crash(); + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 3ea2851a85..3fc6d9d667 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -228,6 +228,9 @@ public enum GregtechItemList implements GregtechItemContainer { //Fish Pond Industrial_FishingPond, Casing_FishPond, + + //Algae + AlgaeFarm_Controller, //GT4 autoCrafter diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index e5d7f58dc6..ece8dfaa87 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -474,7 +474,7 @@ GT_MetaTileEntity_MultiBlockBase { public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) { Logger.INFO("Determining if we have space to buffer outputs."); - + // Null recipe or a recipe with lots of outputs? // E.G. Gendustry custom comb with a billion centrifuge outputs? // Do it anyway. @@ -736,7 +736,7 @@ GT_MetaTileEntity_MultiBlockBase { // Check next fluid continue aFluidMatch; } - + } else { continue aFluidMatch; @@ -744,14 +744,14 @@ GT_MetaTileEntity_MultiBlockBase { } } } - + for (Triplet aFreeHatchCheck : aOutputHatches) { // Free Hatch if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { aEmptyFluidHatches++; } } - + // We have Fluid Stacks we did not merge. Do we have space? if (aOutputFluids.size() > 0) { // Not enough space to add fluids. @@ -760,7 +760,7 @@ GT_MetaTileEntity_MultiBlockBase { return false; } } - + /* * End Fluid Management */ @@ -978,41 +978,22 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - // Based on the Processing Array. A bit overkill, but very flexible. - - + // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new FluidStack[]{}; - - - - // Get input Voltage + long tVoltage = getMaxInputVoltage(); - - // Get total Amps available to this multiblock - long tAmpsIn = 0; - for (GT_MetaTileEntity_Hatch_Energy aHatch : this.mEnergyHatches) { - tAmpsIn += aHatch.maxAmperesIn(); - } - - // How much voltage can actually go in - long tEffectiveVoltage = tVoltage * tAmpsIn; - - byte tTierInputVoltage = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tEffectiveVoltage)); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); - log("Amps: "+tAmpsIn); - log("Input Voltage: "+tVoltage+", Tier: "+tTierInputVoltage); - log("Effective Voltage: "+tEffectiveVoltage+", Effective Tier: "+tTier); GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, - gregtech.api.enums.GT_Values.V[tTierInputVoltage], aFluidInputs, aItemInputs); + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); // Remember last recipe - an optimization for findRecipe() @@ -1024,8 +1005,7 @@ GT_MetaTileEntity_MultiBlockBase { } if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - log("BAD RETURN - 2"); // TODO - Logger.INFO("No Output Space."); + log("BAD RETURN - 2"); return false; } @@ -1041,12 +1021,12 @@ GT_MetaTileEntity_MultiBlockBase { log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEffectiveVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+". Can use "+tEffectiveVoltage); + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; } @@ -1058,6 +1038,7 @@ GT_MetaTileEntity_MultiBlockBase { // -- Try not to fail after this point - inputs have already been consumed! -- + // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); @@ -1071,10 +1052,10 @@ GT_MetaTileEntity_MultiBlockBase { // Overclock if (this.mEUt <= 16) { - this.mEUt = (this.mEUt * (1 << tTierInputVoltage - 1) * (1 << tTierInputVoltage - 1)); - this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTierInputVoltage - 1)); + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTierInputVoltage - 1)]) { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java new file mode 100644 index 0000000000..332c46dc3e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -0,0 +1,128 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { + + private int mLevel = 0; + + public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMTE_AlgaePondBase(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMTE_AlgaePondBase(this.mName); + } + + @Override + public String getMachineType() { + return "Algae Pond"; + } + + @Override + public String[] getTooltip() { + return new String[]{ + "Grows Algae!", + "Controller Block for the Algae Farm", + "Size: 3x3x3 (Hollow)", + "Controller (front middle)", + "1x Input Hatch", + "1x Output Hatch", + "1x Input Bus", + "1x Output Bus" + }; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(207)); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public boolean isFacingValid(final byte aFacing) { + return aFacing > 1; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); + } + + @Override + public int getMaxParallelRecipes() { + return this.mLevel * 10; + } + + @Override + public int getEuDiscountForParallelism() { + return 0; + } + + @Override + public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + this.mLevel = 0; + return true; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java new file mode 100644 index 0000000000..57a726f7e8 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae.GregtechMTE_AlgaePondBase; + +public class GregtechAlgaeContent { + + public static void run() { + if (LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Algae Content."); + run1(); + } + } + + private static void run1() { + // Industrial Centrifuge Multiblock + GregtechItemList.AlgaeFarm_Controller.set( + new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L)); + + } + +} diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java new file mode 100644 index 0000000000..e433396a1b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java @@ -0,0 +1,274 @@ +package gtPlusPlus.xmod.ic2.item; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.lib.LoadedMods; +import ic2.api.item.IKineticRotor; +import ic2.core.IC2; +import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class CustomKineticRotor extends Item implements IKineticRotor { + + private final int mTier; + + @SideOnly(Side.CLIENT) + private final IIcon[] mTextures = new IIcon[6]; + + private static final String[] mRegistrationNames = new String[] { + "itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor" + }; + + private static final String[] mUnlocalNames = new String[] { + "itemEnergeticRotor", + "itemTungstenSteelRotor", + "itemVibrantRotor", + "itemIridiumRotor", + "itemMagnaliumRotor", + "itemUltimetRotor", + }; + private static final int[] mMaxDurability = new int[] { + 512000, 809600, 1600000, 3200000 + }; + private static final int[] mRadius = new int[] { + 9, 11, 13, 15 + }; + private static final float[] mEfficiency = new float[] { + 0.9f, 1.0f, 1.2f, 1.5f + }; + private static final int[] mMinWindStrength = new int[] { + 12, 14, 16, 18 + }; + private static final int[] mMaxWindStrength = new int[] { + 80, 120, 160, 320 + }; + + private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] { + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"), + }; + + private final int maxWindStrength; + private final int minWindStrength; + private final int radius; + private final float efficiency; + private final ResourceLocation renderTexture; + + public CustomKineticRotor(int aTier) { + mTier = aTier; + this.setMaxStackSize(1); + // Handle Differences if EIO is not loaded + if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) { + this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)]; + this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]); + } + else { + this.renderTexture = mResourceLocations[aTier]; + this.setUnlocalizedName(mUnlocalNames[aTier]); + } + this.setMaxDamage(mMaxDurability[aTier]); + this.radius = mRadius[aTier]; + this.efficiency = mEfficiency[aTier]; + this.minWindStrength = mMinWindStrength[aTier]; + this.maxWindStrength = mMaxWindStrength[aTier]; + this.setNoRepair(); + this.setCreativeTab(IC2.tabIC2); + GameRegistry.registerItem(this, mRegistrationNames[aTier]); + } + + @Override + public void setDamage(final ItemStack stack, final int damage) { + if (mTier < 3) { + super.setDamage(stack, damage); + } + } + + @Override + public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) { + + info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[]{this.minWindStrength, this.maxWindStrength})); + + GearboxType type = null; + if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { + type = GearboxType.WATER; + } + else if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { + type = GearboxType.WIND; + } + + if (type != null) { + info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))); + } + + } + + @Override + public int getDiameter(final ItemStack stack) + { + return this.radius; + } + + @Override + public ResourceLocation getRotorRenderTexture(final ItemStack stack) + { + return this.renderTexture; + } + + @Override + public float getEfficiency(final ItemStack stack) + { + return this.efficiency; + } + + @Override + public int getMinWindStrength(final ItemStack stack) + { + return this.minWindStrength; + } + + @Override + public int getMaxWindStrength(final ItemStack stack) + { + return this.maxWindStrength; + } + + @Override + public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type){ + return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER); + } + + public String getUnlocalizedName() { + return "ic2." + super.getUnlocalizedName().substring(5); + } + + public String getUnlocalizedName(ItemStack itemStack) { + return this.getUnlocalizedName(); + } + + public String getItemStackDisplayName(ItemStack itemStack) { + return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack)); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return mTier < 3; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconIndex(ItemStack aIndex) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + protected String getIconString() { + return super.getIconString(); + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return super.getDisplayDamage(stack); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return super.getDurabilityForDisplay(stack); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + int aIndex = 0; + for (String y : mUnlocalNames) { + mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y); + } + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java index 64aa7f99bf..862ba38748 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java @@ -1,13 +1,9 @@ package gtPlusPlus.xmod.ic2.item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.LoadedMods; -import ic2.core.IC2; -import ic2.core.init.InternalName; +import net.minecraft.item.ItemStack; public class IC2_Items { @@ -29,45 +25,33 @@ public class IC2_Items { public static ItemStack blockRTG; public static ItemStack blockKineticGenerator; - public static void register(){ + private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"}; + private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"}; + private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"}; + private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"}; + - if(LoadedMods.EnderIO){ - //Tier 1 - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemEnergeticRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemVibrantRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); + public static void register(){ - } - else { - //Tier 1 - Magnalium - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemMagnaliumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - Ultimet - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemUltimetRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); - } + int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1); + + // Rotor Blades + rotor_Blade_Material_1 = new ItemStack (new CoreItem(mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_3 = new ItemStack (new CoreItem(mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotor Shafts + shaft_Material_1 = new ItemStack (new CoreItem(mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_3 = new ItemStack (new CoreItem(mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotors + rotor_Material_1 = new ItemStack (new CustomKineticRotor(0)); + rotor_Material_2 = new ItemStack (new CustomKineticRotor(1)); + rotor_Material_3 = new ItemStack (new CustomKineticRotor(2)); + rotor_Material_4 = new ItemStack (new CustomKineticRotor(3)); } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java index aca1c6a310..b9dffbd371 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java @@ -118,5 +118,10 @@ public class RotorIridium extends RotorBase{ this.setCustomDamage(stack, this.getCustomDamage(stack) + damage); return true; } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } } diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index 9989bffcf0..e2120fdf7b 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -212,7 +212,9 @@ achievement.decay.technetium99.desc=Cyclotron Product - +//24/11/19 +achievement.gt.blockmachines.hatch.turbine.input.tier.00=Turbine Housing +achievement.gt.blockmachines.hatch.turbine.input.tier.00.desc=[AL] Pickup this item to see the recipe in NEI diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png deleted file mode 100644 index cbf604f2b3..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png deleted file mode 100644 index 3b7ac3d50e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png deleted file mode 100644 index a5a5e2c559..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png deleted file mode 100644 index b68c900ddd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png deleted file mode 100644 index df182aeaa5..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png deleted file mode 100644 index 85bc3f16cd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png deleted file mode 100644 index f82185ebdb..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png deleted file mode 100644 index 345476e03c..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png deleted file mode 100644 index 971164eb3e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png deleted file mode 100644 index 5b5bac3ad2..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png new file mode 100644 index 0000000000..cbf604f2b3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png new file mode 100644 index 0000000000..3b7ac3d50e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png new file mode 100644 index 0000000000..a5a5e2c559 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png new file mode 100644 index 0000000000..b68c900ddd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png new file mode 100644 index 0000000000..df182aeaa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png new file mode 100644 index 0000000000..85bc3f16cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png new file mode 100644 index 0000000000..f82185ebdb Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png new file mode 100644 index 0000000000..345476e03c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png new file mode 100644 index 0000000000..971164eb3e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png new file mode 100644 index 0000000000..5b5bac3ad2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png differ -- cgit From 2525ff075586759657e89b9f01969f0596bca2df Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 10 Dec 2019 11:01:32 +0000 Subject: % Changed name of custom GT++ Programmed Circuit to Programmed Bio Circuit. $ Fixed getNumberedBioCircuit() in CI. $ Fixed an issue where stripped fields were referenced in server side bytecode. $ Fixed Tooltips not working as intended for items giving custom GT++ Multi behaviour. $ Fixed 'No Bonus Output Chance' item not registering correctly. --- src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java | 5 ++++- .../objects/minecraft/multi/NoOutputBonusMultiBehaviour.java | 3 +-- .../core/block/base/BasicTileBlockWithTooltip.java | 12 +++++++++--- src/Java/gtPlusPlus/core/recipe/common/CI.java | 3 ++- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 5 +++++ .../implementations/base/GregtechMeta_MultiBlockBase.java | 7 +------ .../gregtech/api/util/SpecialBehaviourTooltipHandler.java | 12 +++++++++--- .../multi/production/algae/GregtechMTE_AlgaePondBase.java | 9 +++++++-- src/resources/assets/miscutils/lang/en_US.lang | 2 +- 9 files changed, 39 insertions(+), 19 deletions(-) (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java index 9816d45bbf..3acca269d7 100644 --- a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java +++ b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java @@ -2,6 +2,7 @@ package gtPlusPlus.api.helpers; import java.util.HashMap; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.WeightedCollection; import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -26,10 +27,12 @@ public class GregtechPlusPlus_API { */ public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) { if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) { + Logger.INFO("Failed to attach custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem())); return false; } mSpecialBehaviourItemMap.put("UniqueKey_"+aBehaviour.hashCode(), aBehaviour); - SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip()); + SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip()); + Logger.INFO("Attached custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem())); return true; } diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java index 871b42b901..0769d0a473 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java @@ -1,13 +1,12 @@ package gtPlusPlus.api.objects.minecraft.multi; -import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.core.recipe.common.CI; import net.minecraft.item.ItemStack; public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour { public NoOutputBonusMultiBehaviour() { - Multiblock_API.registerSpecialMultiBehaviour(this); + } @Override diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java index 098b670509..6166835f31 100644 --- a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java +++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -33,13 +33,13 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement * Each mapped object holds the data for the six sides. */ @SideOnly(Side.CLIENT) - private AutoMap> mSidedTextureArray = new AutoMap>(); + private AutoMap> mSidedTextureArray; /** * Holds the data for the six sides, each side holds an array of data for each respective meta. */ @SideOnly(Side.CLIENT) - private AutoMap> mSidedTexturePathArray = new AutoMap>(); + private AutoMap> mSidedTexturePathArray; /** * Does this block have any meta at all? @@ -157,7 +157,13 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement @SideOnly(Side.CLIENT) private final void handleTextures() { - Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+"."); + Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+"."); + + // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode. + mSidedTextureArray = new AutoMap>(); + mSidedTexturePathArray = new AutoMap>(); + + //Store them in forge order //DOWN, UP, NORTH, SOUTH, WEST, EAST diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index ce5587ef33..be1089a72a 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -6,6 +6,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; @@ -1240,7 +1241,7 @@ public class CI { } public static ItemStack getNumberedBioCircuit(int i) { - return GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(i, 0L); + return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 42354e49e1..fd4659c543 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -19,9 +19,11 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.api.objects.minecraft.multi.NoOutputBonusMultiBehaviour; import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia; import gtPlusPlus.core.handler.COMPAT_HANDLER; import gtPlusPlus.core.handler.OldCircuitHandler; @@ -123,6 +125,9 @@ public class HANDLER_GT { } + // Register the No-Bonus Special Behaviour. + Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour()); + //Register some custom recipe maps for any enabled multiblocks. //MultiblockRecipeMapHandler.run(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 89c1112726..55378113d9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -100,12 +100,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult try { calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class); - } catch (NoSuchMethodException | SecurityException e) {} - - - // Register the No-Bonus Special Behaviour. - new NoOutputBonusMultiBehaviour(); - + } catch (NoSuchMethodException | SecurityException e) {} } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java index f345a67db6..74655fb744 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java @@ -3,7 +3,9 @@ package gtPlusPlus.xmod.gregtech.api.util; import java.util.HashMap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; public class SpecialBehaviourTooltipHandler { @@ -18,9 +20,13 @@ public class SpecialBehaviourTooltipHandler { public void onItemTooltip(ItemTooltipEvent event){ if (event != null) { if (event.itemStack != null) { - String s = mTooltipCache.get(event.itemStack); - if (s != null && s.length() > 0) { - event.toolTip.add(s); + for (ItemStack aKey : mTooltipCache.keySet()) { + if (GT_Utility.areStacksEqual(aKey, event.itemStack, false)) { + String s = mTooltipCache.get(aKey); + if (s != null && s.length() > 0) { + event.toolTip.add(EnumChatFormatting.RED+s); + } + } } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 38c80ce8c4..81afe2b147 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -564,10 +564,15 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { return tRecipe; } - private static WeightedCollection generateWeightedCollection(){ + private static ItemStack[] getOutputForTier(int aTier){ + ItemStack[] aOutputs = new ItemStack[16]; + + + + WeightedCollection aCollection = new WeightedCollection(); - return aCollection; + return aOutputs; } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 394680edd8..ad10be2d8b 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3039,7 +3039,7 @@ tile.blockRoundRobinator.4.name=Round Robinator V //Added 16/10/19 -item.BioRecipeSelector.name=Programmed Circuit +item.BioRecipeSelector.name=Programmed Bio Circuit item.FermentationBase.name=Cell of Fermentation Base item.ureamix.name=Cell of Urea Mix item.liquidresin.name=Cell of Liquid Resin -- cgit From b8069dc5a8c0c8c2cfd5e4ec2401f28d6a84e626 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 12 Dec 2019 02:26:10 +0000 Subject: + Added Pellet Mold. + Added Clean Aluminium Mix. $ 5.08 Compliance. And looooots of it. $ Fixed most, if not all Fluid Canning & Extraction recipes that I broke previously. % Adjusted Textures for Particles. New textures thanks to Discord User Никита#8621. % Adjusted Aluminium Processing Chain. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gtPlusPlus/api/helpers/MaterialHelper.java | 17 ++ .../gtPlusPlus/australia/GTplusplus_Australia.java | 8 +- src/Java/gtPlusPlus/core/common/CommonProxy.java | 8 +- .../core/handler/AchievementHandler.java | 5 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 95 +++++- .../core/item/chemistry/AgriculturalChem.java | 11 +- .../core/item/chemistry/RocketFuels.java | 31 +- .../core/item/chemistry/StandardBaseParticles.java | 2 +- .../core/item/general/ItemGenericToken.java | 15 +- .../core/material/MaterialGenerator.java | 12 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 12 +- .../gtPlusPlus/core/recipe/RECIPES_General.java | 22 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 3 +- .../gtPlusPlus/core/util/minecraft/LangUtils.java | 5 + .../util/minecraft/gregtech/PollutionUtils.java | 4 + .../core/util/reflect/ReflectionUtils.java | 113 ++++++- .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 334 ++++++++++++++------- .../agrichem/item/algae/ItemAgrichemBase.java | 43 ++- .../xmod/bop/blocks/BOP_Block_Registrator.java | 48 ++- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 28 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 3 + .../interfaces/internal/IGregtech_RecipeAdder.java | 6 + .../api/metatileentity/BaseCustomTileEntity.java | 65 +++- .../custom/power/GTPP_MTE_BasicMachine.java | 2 +- .../GT_MetaTileEntity_Hatch_TurbineProvider.java | 4 +- .../xmod/gregtech/common/Meta_GT_Proxy.java | 2 +- .../xmod/gregtech/common/StaticFields59.java | 20 +- .../common/blocks/GTPP_Block_Machines.java | 2 +- .../common/covers/GTPP_Cover_ToggleVisual.java | 5 +- .../gregtech/common/helpers/GT_MethodHelper.java | 80 +++++ .../common/render/GTPP_Render_MachineBlock.java | 18 +- .../GregtechMetaTileEntity_ChemicalReactor.java | 19 +- .../GregtechMetaTileEntityGeneratorArray.java | 5 - .../algae/GregtechMTE_AlgaePondBase.java | 3 +- .../gregtech/loaders/RecipeGen_FluidCanning.java | 104 +++++-- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 65 +++- .../gregtech/GregtechCustomHatches.java | 16 +- .../gregtech/GregtechPollutionDevices.java | 7 +- .../gregtech/GregtechRocketFuelGenerator.java | 6 +- .../reliquary/util/ReliquaryRecipeHandler.java | 3 +- .../recipe/TF_Gregtech_Recipes.java | 35 +-- src/Java/speiger/src/crops/api/ICropCardInfo.java | 12 + src/resources/assets/miscutils/lang/en_US.lang | 20 +- .../textures/items/bioscience/MetaItem1/22.png | Bin 0 -> 437 bytes .../textures/items/bioscience/MetaItem1/23.png | Bin 0 -> 701 bytes .../miscutils/textures/items/particle/new/0.png | Bin 0 -> 1217 bytes .../miscutils/textures/items/particle/new/1.png | Bin 0 -> 1493 bytes .../miscutils/textures/items/particle/new/10.png | Bin 0 -> 1616 bytes .../miscutils/textures/items/particle/new/11.png | Bin 0 -> 1450 bytes .../miscutils/textures/items/particle/new/12.png | Bin 0 -> 1635 bytes .../miscutils/textures/items/particle/new/13.png | Bin 0 -> 1601 bytes .../miscutils/textures/items/particle/new/14.png | Bin 0 -> 1522 bytes .../miscutils/textures/items/particle/new/15.png | Bin 0 -> 1710 bytes .../miscutils/textures/items/particle/new/16.png | Bin 0 -> 1647 bytes .../miscutils/textures/items/particle/new/17.png | Bin 0 -> 1569 bytes .../miscutils/textures/items/particle/new/18.png | Bin 0 -> 1451 bytes .../miscutils/textures/items/particle/new/19.png | Bin 0 -> 1404 bytes .../miscutils/textures/items/particle/new/2.png | Bin 0 -> 1561 bytes .../miscutils/textures/items/particle/new/20.png | Bin 0 -> 1517 bytes .../miscutils/textures/items/particle/new/21.png | Bin 0 -> 1498 bytes .../miscutils/textures/items/particle/new/22.png | Bin 0 -> 1554 bytes .../miscutils/textures/items/particle/new/23.png | Bin 0 -> 1196 bytes .../miscutils/textures/items/particle/new/24.png | Bin 0 -> 1323 bytes .../miscutils/textures/items/particle/new/3.png | Bin 0 -> 1465 bytes .../miscutils/textures/items/particle/new/4.png | Bin 0 -> 1501 bytes .../miscutils/textures/items/particle/new/5.png | Bin 0 -> 1487 bytes .../miscutils/textures/items/particle/new/6.png | Bin 0 -> 1512 bytes .../miscutils/textures/items/particle/new/7.png | Bin 0 -> 1485 bytes .../miscutils/textures/items/particle/new/8.png | Bin 0 -> 1595 bytes .../miscutils/textures/items/particle/new/9.png | Bin 0 -> 1567 bytes 70 files changed, 1018 insertions(+), 300 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java create mode 100644 src/Java/speiger/src/crops/api/ICropCardInfo.java create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/23.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/0.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/1.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/10.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/11.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/12.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/13.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/14.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/15.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/16.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/17.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/18.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/19.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/2.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/20.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/21.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/22.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/23.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/24.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/3.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/4.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/5.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/6.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/7.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/8.png create mode 100644 src/resources/assets/miscutils/textures/items/particle/new/9.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java index 43f8ddeb19..9d2e894d99 100644 --- a/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java +++ b/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java @@ -10,6 +10,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -56,4 +57,20 @@ public class MaterialHelper { } return false; } + + public static ItemStack getCells(Materials aMaterial, int i) { + return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i); + } + public static ItemStack getDust(Materials aMaterial, int i) { + return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i); + } + public static ItemStack getDustSmall(Materials aMaterial, int i) { + return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i); + } + public static ItemStack getDustTiny(Materials aMaterial, int i) { + return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i); + } + public static ItemStack getGems(Materials aMaterial, int i) { + return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i); + } } diff --git a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java index 562f6acd15..77562f5691 100644 --- a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java +++ b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java @@ -6,13 +6,13 @@ import java.io.File; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; - import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.australia.biome.type.Biome_AustralianDesert; -import gtPlusPlus.australia.biome.type.Biome_AustralianDesert2; import gtPlusPlus.australia.biome.type.Biome_AustralianDesert_Ex; import gtPlusPlus.australia.biome.type.Biome_AustralianForest; import gtPlusPlus.australia.biome.type.Biome_AustralianOcean; diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index f0d89b3016..1ce16bf4de 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -197,14 +197,18 @@ public class CommonProxy { COMPAT_HANDLER.RemoveRecipesFromOtherMods(); Logger.INFO("Initialising Handler, Then Adding Recipes"); COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); - Logger.INFO("Loading Gregtech API recipes."); - COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); Logger.INFO("Loading Intermod staging."); COMPAT_IntermodStaging.postInit(e); Logger.INFO("Loading queued recipes."); COMPAT_HANDLER.runQueuedRecipes(); Logger.INFO("Registering custom mob drops."); registerCustomMobDrops(); + + // Moved last in postInit(). + // 12/12/19 - Alkalus + // Moved last, to prevent recipes being generated post initialisation. + Logger.INFO("Loading Gregtech API recipes."); + COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); } public void serverStarting(final FMLServerStartingEvent e) { diff --git a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java index 9053875058..fa10f4def3 100644 --- a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java +++ b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java @@ -17,6 +17,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; @@ -74,7 +75,9 @@ public class AchievementHandler { this.registerAchievement("semifluid", -14, -10, GregtechItemList.Generator_SemiFluid_HV.get(1), aBaseAchievementName, false); this.registerAchievement("earlywasher", -13, -10, GregtechItemList.SimpleDustWasher_ULV.get(1), aBaseAchievementName, false); this.registerAchievement("advancedsteam", -12, -10, GregtechItemList.Boiler_Advanced_MV.get(1), aBaseAchievementName, false); - this.registerAchievement("pollutionremoval", -11, -10, GregtechItemList.Pollution_Cleaner_IV.get(1), aBaseAchievementName, false); + if (PollutionUtils.isPollutionEnabled()) { + this.registerAchievement("pollutionremoval", -11, -10, GregtechItemList.Pollution_Cleaner_IV.get(1), aBaseAchievementName, false); + } this.registerAchievement("hiampxform", -10, -10, GregtechItemList.Transformer_HA_HV_MV.get(1), aBaseAchievementName, false); diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index ca62a524c1..be02e352c7 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -2,7 +2,9 @@ package gtPlusPlus.core.handler; import static gtPlusPlus.core.lib.LoadedMods.Gregtech; -import java.util.*; +import java.util.LinkedList; +import java.util.Queue; +import java.util.Set; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import gregtech.api.enums.GT_Values; @@ -11,22 +13,99 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; -import gtPlusPlus.core.common.compat.*; +import gtPlusPlus.core.common.compat.COMPAT_BigReactors; +import gtPlusPlus.core.common.compat.COMPAT_CompactWindmills; +import gtPlusPlus.core.common.compat.COMPAT_EnderIO; +import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils; +import gtPlusPlus.core.common.compat.COMPAT_HarvestCraft; +import gtPlusPlus.core.common.compat.COMPAT_IC2; +import gtPlusPlus.core.common.compat.COMPAT_MorePlanets; +import gtPlusPlus.core.common.compat.COMPAT_OpenBlocks; +import gtPlusPlus.core.common.compat.COMPAT_PneumaticCraft; +import gtPlusPlus.core.common.compat.COMPAT_RFTools; +import gtPlusPlus.core.common.compat.COMPAT_Railcraft; +import gtPlusPlus.core.common.compat.COMPAT_SimplyJetpacks; +import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft; +import gtPlusPlus.core.common.compat.COMPAT_Witchery; import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; -import gtPlusPlus.core.recipe.*; +import gtPlusPlus.core.recipe.RECIPES_Extruder; +import gtPlusPlus.core.recipe.RECIPES_GREGTECH; +import gtPlusPlus.core.recipe.RECIPES_LaserEngraver; +import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionCreator; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; -import gtPlusPlus.xmod.gregtech.registration.gregtech.*; +import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedBoilers; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedMixer; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAlgaeContent; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAmazonWarehouse; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBedrockPlatforms; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBufferDynamos; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechComponentAssembler; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCustomHatches; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCyclotron; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFactoryGradeReplacementMultis; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFluidReactor; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeneratorsULV; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechHiAmpTransformer; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialArcFurnace; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialBlastSmelter; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCentrifuge; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCokeOven; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCuttingFactory; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialElectrolyzer; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialExtruder; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFishPond; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFuelRefinery; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialGeneratorArray; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMassFabricator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMixer; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiMachine; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiTank; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialPlatePress; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialSifter; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialThermalCentrifuge; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialTreeFarm; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWashPlant; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWiremill; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIronBlastFurnace; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLFTR; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLargeTurbinesAndHeatExchanger; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechMiniRaFusion; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNaqReactor; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPollutionDevices; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerBreakers; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarTower; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperChests; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTeslaTower; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThaumcraftDevices; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThreadedBuffers; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredChunkloaders; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTreeFarmerTE; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWirelessChargers; +import gtPlusPlus.xmod.gregtech.registration.gregtech.NewHorizonsAccelerator; import net.minecraft.item.ItemStack; public class COMPAT_HANDLER { @@ -213,6 +292,7 @@ public class COMPAT_HANDLER { for (RunnableWithInfo r : m) { try { r.run(); + Logger.INFO("[FIND] "+r.getInfoData().getLocalizedName()+" recipes generated."); } catch (Throwable t) { t.printStackTrace(); @@ -222,6 +302,9 @@ public class COMPAT_HANDLER { } RecipeGen_Recycling.executeGenerators(); runQueuedMisc(); + + // Do Fluid Canning Last, because they're not executed on demand, but rather queued. + RecipeGen_FluidCanning.init(); } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index 55f4dfa0be..6f36b359ad 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -6,6 +6,7 @@ import java.util.List; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gtPlusPlus.api.helpers.MaterialHelper; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; @@ -105,6 +106,8 @@ public class AgriculturalChem extends ItemPackage { * 19 - Sodium Hydroxide // Exists in Newer GT * 20 - Sodium Carbonate * 21 - Lithium Chloride + * 22 - Pellet Mold + * 23 - Clean Aluminium Mix */ public static ItemStack mAlgaeBiosmass; @@ -129,6 +132,8 @@ public class AgriculturalChem extends ItemPackage { public static ItemStack mSodiumHydroxide; public static ItemStack mSodiumCarbonate; public static ItemStack mLithiumChloride; + public static ItemStack mPelletMold; + public static ItemStack mCleanAluminiumMix; @Override @@ -196,6 +201,8 @@ public class AgriculturalChem extends ItemPackage { } mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1); mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); + mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1); + mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1); ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); @@ -533,8 +540,8 @@ public class AgriculturalChem extends ItemPackage { GT_Values.RA.addCentrifugeRecipe(CI.getNumberedCircuit(20), ItemUtils.getSimpleStack(aManureByprod, 4), FluidUtils.getFluidStack("sulfuricacid", 250), // In Fluid FluidUtils.getFluidStack("sulfuricapatite", 50), // Out Fluid - Materials.Phosphorus.getDustSmall(2), Materials.Calcium.getDustSmall(2), - Materials.Copper.getDustTiny(1), Materials.Carbon.getDust(1), ItemUtils.getSimpleStack(dustDirt, 1), + MaterialHelper.getDustSmall(Materials.Phosphorus, 2), MaterialHelper.getDustSmall(Materials.Calcium, 2), + MaterialHelper.getDustTiny(Materials.Copper, 1), MaterialHelper.getDust(Materials.Carbon, 1), ItemUtils.getSimpleStack(dustDirt, 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAmmoniumNitrate", 1), new int[] { 2500, 2500, 750, 1000, 5000, 250 }, // Chances 20 * 20, // Time diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 0bea7dfc31..2d063c45d4 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -9,6 +9,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.helpers.MaterialHelper; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.lib.CORE; @@ -478,15 +479,17 @@ public class RocketFuels extends ItemPackage { } + MaterialHelper.getCells(aMaterial_Water, 1); + ItemStack aCellEmpty = CI.emptyCells(1); - ItemStack aCellWater = aMaterial_Water.getCells(1); - ItemStack aCellOxygen = aMaterial_Oxygen.getCells(1); - ItemStack aCellChloramine = aMaterial_Chloramine.getCells(1); - ItemStack aCellDimethylamine = aMaterial_Dimethylamine.getCells(1); - ItemStack aCellDilutedHydrochloricAcid = aMaterial_DilutedHydrochloricAcid.getCells(1); - ItemStack aCellNitrogenDioxide = aMaterial_NitrogenDioxide.getCells(1); - ItemStack aCellDinitrogenTetroxide = aMaterial_DinitrogenTetroxide.getCells(1); - ItemStack aCellDimethylhydrazine = aMaterial_Dimethylhydrazine.getCells(1); + ItemStack aCellWater = MaterialHelper.getCells(aMaterial_Water, 1); + ItemStack aCellOxygen = MaterialHelper.getCells(aMaterial_Oxygen, 1); + ItemStack aCellChloramine = MaterialHelper.getCells(aMaterial_Chloramine, 1); + ItemStack aCellDimethylamine = MaterialHelper.getCells(aMaterial_Dimethylamine, 1); + ItemStack aCellDilutedHydrochloricAcid = MaterialHelper.getCells(aMaterial_DilutedHydrochloricAcid, 1); + ItemStack aCellNitrogenDioxide = MaterialHelper.getCells(aMaterial_NitrogenDioxide, 1); + ItemStack aCellDinitrogenTetroxide = MaterialHelper.getCells(aMaterial_DinitrogenTetroxide, 1); + ItemStack aCellDimethylhydrazine = MaterialHelper.getCells(aMaterial_Dimethylhydrazine, 1); @@ -671,7 +674,17 @@ public class RocketFuels extends ItemPackage { //Register default fluids Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid(); - Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid(); + + // 5.08 Compat + if (!FluidUtils.doesFluidExist("OilHeavy")){ + Oil_Heavy = FluidUtils.generateFluidNoPrefix("OilHeavy", "Heavy Oil", 200, new short[]{10, 10, 10, 100}); + } + else { + Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid(); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellOilHeavy", 1) == null){ + new BaseItemComponent("OilHeavy", "Heavy Oil", new short[] {10, 10, 10}); + } + } //Create Kerosene diff --git a/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java index 1e833a7b00..10eaaf0da9 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java @@ -149,7 +149,7 @@ public class StandardBaseParticles extends BaseItemParticle { @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i < this.icons.length; i++) { - this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/"+i); + this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/new/"+i); } } diff --git a/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java b/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java index c076bf5c95..21d2c6e120 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java @@ -148,8 +148,19 @@ public class ItemGenericToken extends CoreItem { } @Override - public int getItemStackLimit(ItemStack stack) { - return mMaxStackSizes.get(stack.getItemDamage()); + public int getItemStackLimit(ItemStack aStack) { + if (aStack == null) { + return getItemStackLimit(); + } + else { + Integer aSize = mMaxStackSizes.get(aStack.getItemDamage()); + if (aSize != null) { + return aSize; + } + else { + return getItemStackLimit(); + } + } } @Override diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 797a033dcc..20fdfd3c8c 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -70,20 +70,12 @@ public class MaterialGenerator { * @return */ public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, Integer aDuration, Integer aEU) { - /*GT_Recipe r = new Recipe_GT( - true, - new ItemStack[] {aEmpty, aRemains != null ? aRemains : null}, - new ItemStack[] {}, - null, - new int[] {}, - new FluidStack[] {}, - new FluidStack[] {c}, - a2, a3, a1);*/ - //new RecipeGen_FluidCanning(r, true); RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU); if (g != null && g.valid()) { + //Logger.INFO("[FIND] Adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid)); return true; } + Logger.INFO("[ERROR] FAILED adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid)); return false; } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index cac54cec4e..81e3216917 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -833,7 +833,17 @@ public class RECIPES_GREGTECH { //Add an empty recipe, but only if we didn't for the standard GT HF. Prevents Fluid transformation exploits. if (!addedGtExtraction) { CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 125)); - } + } + + //Gelid Cryotheum + CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1), FluidUtils.getFluidStack("cryotheum", 250), 200, 240); + + //Ender Fluid + CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), FluidUtils.getFluidStack("ender", 250), 100, 30); + + //Blazing Pyrotheum + CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), FluidUtils.getFluidStack("pyrotheum", 250), 200, 240); + } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 02b282b1b3..5048c5f2a5 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -21,6 +21,7 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; @@ -156,13 +157,13 @@ public class RECIPES_General { //Shaped Crafting for ULV Material Dusts - + //Potin if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {"dustLead", "dustBronze", "dustTin", "dustLead", "dustBronze"}, ALLOY.POTIN.getDust(5))){ Logger.INFO("Added shapeless recipe for Potin Dust."); } - + //Tumbaga if (RecipeUtils.addShapelessGregtechRecipe(new Object[] { "dustGold", "dustGold", "dustCopper"}, ItemUtils.getSimpleStack(ModItems.dustTumbagaMix))){ @@ -173,7 +174,7 @@ public class RECIPES_General { ItemUtils.getSimpleStack(ModItems.dustTumbagaMix), ItemUtils.getSimpleStack(ModItems.dustTumbagaMix), "dustGold" - }, + }, ALLOY.TUMBAGA.getDust(10))){ Logger.INFO("Added shapeless recipe for Tumbaga Dust."); } @@ -293,7 +294,7 @@ public class RECIPES_General { CI.getElectricPump(2, 1), CI.getPlate(2, GTNH ? 4 : 2), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(0), GTNH ? 2 : 1), - }, + }, FluidUtils.getHotWater(500), // Fluid ItemUtils.getSimpleStack(ModBlocks.blockPestKiller), // Output 20 * 60, // Dur @@ -394,12 +395,11 @@ public class RECIPES_General { generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier); } - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) - RecipeUtils.addShapedGregtechRecipe( - CI.component_Plate[4], "rotorGtStainlessSteel", CI.component_Plate[4], - CI.getTieredCircuitOreDictName(3), CI.machineHull_HV, CI.getTieredCircuitOreDictName(3), - CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4], - GregtechItemList.Hatch_Air_Intake.get(1L, new Object[0])); + RecipeUtils.addShapedGregtechRecipe( + CI.component_Plate[4], "rotorGtStainlessSteel", CI.component_Plate[4], + CI.getTieredCircuitOreDictName(3), CI.machineHull_HV, CI.getTieredCircuitOreDictName(3), + CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4], + GregtechItemList.Hatch_Air_Intake.get(1L, new Object[0])); RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6], CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_AdvancedVacuum.get(1), @@ -417,7 +417,7 @@ public class RECIPES_General { CI.component_Plate[8], GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0])); - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + if (PollutionUtils.isPollutionEnabled()) { GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_LV.get(1L, new Object[0]), bitsd, new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LV.get(1), Character.valueOf('P'), GregtechItemList.Pollution_Cleaner_LV.get(1) }); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index f5bd390aee..254d83ecf4 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -16,6 +16,7 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -940,7 +941,7 @@ public class RECIPES_Machines { } - if (CORE.ConfigSwitches.enableMachine_Pollution && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + if (CORE.ConfigSwitches.enableMachine_Pollution && PollutionUtils.isPollutionEnabled()){ RecipeUtils.addShapedGregtechRecipe( "plateCarbon", "plateCarbon", "plateCarbon", diff --git a/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java index 1de4209bf9..ea161e4adb 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.Properties; import cpw.mods.fml.common.registry.LanguageRegistry; +import gregtech.api.util.GT_LanguageManager; import gtPlusPlus.core.util.reflect.ReflectionUtils; public class LangUtils { @@ -47,5 +48,9 @@ public class LangUtils { } return false; } + + public static String trans(String aNr, String aEnglish) { + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aNr, aEnglish, false); + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index b3372e8bde..2ae2a9f1de 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -45,6 +45,10 @@ public class PollutionUtils { mIsPollutionEnabled = false; } } + + public static boolean isPollutionEnabled() { + return mIsPollutionEnabled; + } public static boolean mPollution() { try { diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 7ef9ef6632..135f98dd17 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -28,7 +28,22 @@ public class ReflectionUtils { public static Map> mCachedClasses = new LinkedHashMap>(); public static Map mCachedMethods = new LinkedHashMap(); public static Map mCachedFields = new LinkedHashMap(); + public static Map mCachedConstructors = new LinkedHashMap(); + private static class CachedConstructor { + + private final Constructor METHOD; + + public CachedConstructor(Constructor aCons) { + METHOD = aCons; + } + + public Constructor get() { + return METHOD; + } + + } + private static class CachedMethod { private final boolean STATIC; @@ -107,6 +122,49 @@ public class ReflectionUtils { return false; } + private static boolean cacheConstructor(Class aClass, Constructor aConstructor) { + if (aConstructor == null) { + return false; + } + CachedConstructor y = mCachedConstructors.get(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes())); + if (y == null) { + mCachedConstructors.put(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes()), new CachedConstructor(aConstructor)); + return true; + } + return false; + } + + + /** + * Returns a cached {@link Constructor} object. + * @param aClass - Class containing the Constructor. + * @param aTypes - Varags Class Types for objects constructor. + * @return - Valid, non-final, {@link Method} object, or {@link null}. + */ + public static Constructor getConstructor(Class aClass, Class... aTypes) { + if (aClass == null || aTypes == null) { + return null; + } + + String aMethodKey = ArrayUtils.toString(aTypes); + //Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey)); + CachedConstructor y = mCachedConstructors.get(aClass.getName() + "." + aMethodKey); + if (y == null) { + Constructor u = getConstructor_Internal(aClass, aTypes); + if (u != null) { + Logger.REFLECTION("Caching Constructor: "+aClass.getName() + "." + aMethodKey); + cacheConstructor(aClass, u); + return u; + } else { + return null; + } + } else { + return y.get(); + } + } + + + /** * Returns a cached {@link Class} object. @@ -716,6 +774,55 @@ public class ReflectionUtils { } return m; } + + private static Constructor getConstructor_Internal(Class aClass, Class... aTypes) { + Constructor c = null; + try { + Logger.REFLECTION("Constructor: Internal Lookup: "+aClass.getName()); + c = aClass.getDeclaredConstructor(aTypes); + if (c != null) { + c.setAccessible(true); + int modifiers = c.getModifiers(); + Field modifierField = c.getClass().getDeclaredField("modifiers"); + modifiers = modifiers & ~Modifier.FINAL; + modifierField.setAccessible(true); + modifierField.setInt(c, modifiers); + } + } + catch (Throwable t) { + Logger.REFLECTION("Constructor: Internal Lookup Failed: "+aClass.getName()); + try { + c = getConstructorRecursively(aClass, aTypes); + } catch (Exception e) { + Logger.REFLECTION("Unable to find method '"+aClass.getName()+"'"); + e.printStackTrace(); + dumpClassInfo(aClass); + } + } + return c; + } + + private static Constructor getConstructorRecursively(Class aClass, Class... aTypes) throws Exception { + try { + Logger.REFLECTION("Constructor: Recursion Lookup: "+aClass.getName()); + Constructor c = aClass.getConstructor(aTypes); + if (c != null) { + c.setAccessible(true); + int modifiers = c.getModifiers(); + Field modifierField = c.getClass().getDeclaredField("modifiers"); + modifiers = modifiers & ~Modifier.FINAL; + modifierField.setAccessible(true); + modifierField.setInt(c, modifiers); + } + return c; + } catch (final NoSuchMethodException | IllegalArgumentException | IllegalAccessException e) { + final Class superClass = aClass.getSuperclass(); + if (superClass == null || superClass == Object.class) { + throw e; + } + return getConstructor_Internal(superClass, aTypes); + } + } private static Method getMethodRecursively(final Class clazz, final String aMethodName) throws NoSuchMethodException { try { @@ -795,7 +902,7 @@ public class ReflectionUtils { } private static Class getClass_Internal(String string) { - Class aClass = null; + Class aClass = null; if (ReflectionUtils.doesClassExist(string)) { try { aClass = Class.forName(string); @@ -815,7 +922,7 @@ public class ReflectionUtils { Logger.REFLECTION("Building: "+aClassName); } Logger.REFLECTION("Trying to search '"+aClassName+"' for inner classes."); - Class clazz = ReflectionUtils.getClass(aClassName); + Class clazz = ReflectionUtils.getClass(aClassName); Class[] y = clazz.getDeclaredClasses(); if (y == null || y.length <= 0) { @@ -824,7 +931,7 @@ public class ReflectionUtils { } else { boolean found = false; - for (Class h : y) { + for (Class h : y) { Logger.REFLECTION("Found hidden inner class: "+h.getCanonicalName()); if (h.getSimpleName().toLowerCase().equals(aData[aData.length-1].toLowerCase())) { Logger.REFLECTION("Found correct class. ["+aData[aData.length-1]+"] Caching at correct location: "+string); diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index 477bdb2ff5..051f73b962 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -5,6 +5,7 @@ import static gtPlusPlus.core.lib.CORE.GTNH; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import gregtech.api.enums.GT_Values; @@ -15,13 +16,16 @@ import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.OreDictUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -104,9 +108,27 @@ public class BioRecipes { mFert = AgriculturalChem.dustOrganicFertilizer; mDustDirt = AgriculturalChem.dustDirt; + // 5.08 Salt Water Solution ;) + if (!FluidUtils.doesFluidExist("saltwater")){ + mSalineWater = FluidUtils.generateFluidNoPrefix("saltwater", "Salt Water", 200, new short[]{10, 30, 220, 100}); + } + else { + Materials aSaltWater = MaterialUtils.getMaterial("saltwater"); + if (aSaltWater != null) { + FluidStack aWaterStack = aSaltWater.getFluid(1); + if (aWaterStack != null) { + mSalineWater = aSaltWater.getFluid(1).getFluid(); + } + } + if (mSalineWater == null) { + mSalineWater = FluidUtils.getWildcardFluidStack("saltwater", 1).getFluid(); + } + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellSaltWater", 1) == null){ + new BaseItemComponent("saltwater", "Salt Water", new short[] {10, 30, 220}); + } + } mDistilledWater = FluidUtils.getDistilledWater(1).getFluid(); - mSalineWater = FluidUtils.getFluidStack("saltwater", 1).getFluid(); mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid(); mAir = FluidUtils.getFluidStack("air", 1).getFluid(); mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid(); @@ -157,7 +179,8 @@ public class BioRecipes { recipeGoldenBrownCelluloseFiber(); recipeRedCelluloseFiber(); recipeSodiumHydroxide(); - recipeSodiumCarbonate(); + recipeSodiumCarbonate(); + recipePelletMold(); recipeAluminiumPellet(); recipeAlumina(); recipeAluminium(); @@ -176,17 +199,17 @@ public class BioRecipes { } private static void registerFuels() { - + // Burnables ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), 800); ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1), 4800); - + // Gas Fuels //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1); - + //Combustion Fuels GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 250, 0); - + } private static void recipeGreenAlgae() { // Compost @@ -214,7 +237,7 @@ public class BioRecipes { ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); // Alginic acid - GT_Values.RA.addExtractorRecipe( + CORE.RA.addExtractorRecipe( ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10), ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 1), 20 * 15, @@ -314,7 +337,7 @@ public class BioRecipes { GT_ModHandler.addPulverisationRecipe( ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5), ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1)); - + // Plastic CORE.RA.addFluidReactorRecipe( new ItemStack[] { @@ -326,7 +349,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 500), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144)), @@ -351,6 +374,14 @@ public class BioRecipes { ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1) }, ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2)); + // Extruder Recipe + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12), + ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0), + ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 3), + 20 * 2, + 30); + // Assembly Recipe CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { getBioChip(2), @@ -476,7 +507,7 @@ public class BioRecipes { 120 * 20, 60, 1); - + CORE.RA.addDehydratorRecipe( CI.emptyCells(1), FluidUtils.getFluidStack(mFermentationBase, 4000), @@ -489,14 +520,14 @@ public class BioRecipes { } - - + + public final static HashSet mFruits = new HashSet(); public final static HashSet mVege = new HashSet(); public final static HashSet mNuts = new HashSet(); public final static HashSet mSeeds = new HashSet(); - + public final static AutoMap mList_Master_FruitVege = new AutoMap(); public final static AutoMap mList_Master_Seeds = new AutoMap(); @@ -509,7 +540,7 @@ public class BioRecipes { processOreDictEntry("listAllNut", mNuts); processOreDictEntry("listAllseed", mSeeds); processOreDictEntry("listAllSeed", mSeeds); - + if (!mFruits.isEmpty()) { for (GT_ItemStack g : mFruits) { mList_Master_FruitVege.put(g.toStack()); @@ -531,7 +562,7 @@ public class BioRecipes { } } } - + // Make Fermentation private static void processOreDictEntry(String aOreName, HashSet mfruits2) { ArrayList aTemp = OreDictionary.getOres(aOreName); @@ -541,8 +572,8 @@ public class BioRecipes { } } } - - + + private static void recipeFermentationBase() { processFermentationOreDict(); AutoMap aFruitVege = mList_Master_FruitVege; @@ -551,43 +582,48 @@ public class BioRecipes { for (ItemStack a : aFruitVege) { if (aMap.contains(a)) { continue; - } - CORE.RA.addFluidReactorRecipe( - new ItemStack[] { - getBioChip(2), - ItemUtils.getSimpleStack(a, 10) - }, - new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), - }, - new ItemStack[] { - - }, - new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200), - }, - 60 * 20, - 30, - 1); + } + if (ItemUtils.checkForInvalidItems(a)) { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(2), + ItemUtils.getSimpleStack(a, 10) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200), + }, + 60 * 20, + 30, + 1); + } + } for (ItemStack a : aSeeds) { - CORE.RA.addFluidReactorRecipe( - new ItemStack[] { - getBioChip(3), - ItemUtils.getSimpleStack(a, 20) - }, - new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), - }, - new ItemStack[] { - - }, - new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50), - }, - 60 * 20, - 30, - 1); + if (ItemUtils.checkForInvalidItems(a)) { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getBioChip(3), + ItemUtils.getSimpleStack(a, 20) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50), + }, + 60 * 20, + 30, + 1); + } } // Sugar Cane @@ -600,7 +636,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75), @@ -608,7 +644,7 @@ public class BioRecipes { 90 * 20, 30, 1); - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(5), @@ -619,7 +655,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 150), @@ -627,10 +663,10 @@ public class BioRecipes { 120 * 20, 30, 1); - + // Sugar Beet if (OreDictUtils.containsValidEntries("cropSugarbeet")) { - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(4), @@ -640,7 +676,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75), @@ -648,7 +684,7 @@ public class BioRecipes { 60 * 20, 30, 1); - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(5), @@ -659,7 +695,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 150), @@ -668,7 +704,7 @@ public class BioRecipes { 30, 1); } - + // Produce Acetone, Butanol and Ethanol CORE.RA.addFluidReactorRecipe( new ItemStack[] { @@ -678,7 +714,7 @@ public class BioRecipes { ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16), }, new FluidStack[] { - + }, new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 6), @@ -687,10 +723,10 @@ public class BioRecipes { CI.emptyCells(38) }, new FluidStack[] { - + }, 900 * 20, - 240, + 32, 2); @@ -719,7 +755,7 @@ public class BioRecipes { private static void recipeEthanol() { - GT_Values.RA.addDistilleryRecipe( + CORE.RA.addDistilleryRecipe( BioRecipes.getBioChip(2), FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000), FluidUtils.getFluidStack(BioRecipes.mEthanol, 100), @@ -727,7 +763,7 @@ public class BioRecipes { 20 * 20, 60, false); - + } private static void recipeGoldenBrownCelluloseFiber() { @@ -739,7 +775,7 @@ public class BioRecipes { } private static void recipeRedCelluloseFiber() { - GT_Values.RA.addExtractorRecipe( + CORE.RA.addExtractorRecipe( ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 20), ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5), 20 * 30, @@ -763,8 +799,8 @@ public class BioRecipes { }, 300 * 20, 120, - 2); - + 1); + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(5), @@ -781,7 +817,7 @@ public class BioRecipes { }, 60 * 20, 60, - 2); + 1); } private static void recipeSodiumCarbonate() { @@ -806,8 +842,8 @@ public class BioRecipes { }, 120 * 20, 120, - 900); - + 1); + } CORE.RA.addFluidReactorRecipe( @@ -829,18 +865,108 @@ public class BioRecipes { }, 180 * 20, 120, - 900); - + 1); + + } + + private static void recipePelletMold() { + GregtechItemList.Pellet_Mold.set(ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 1)); + GT_Values.RA.addLatheRecipe( + ALLOY.TUMBAGA.getBlock(1), + GregtechItemList.Pellet_Mold.get(1), + null, + 20 * 30 * 15, + 90); } private static void recipeAluminiumPellet() { - GT_Values.RA.addAutoclaveRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 3), - FluidUtils.getFluidStack(BioRecipes.mAir, 1000), + + // Ore Names, no prefix + AutoMap aOreNames = new AutoMap(); + + aOreNames.put("Lazurite"); + aOreNames.put("Bauxite"); + aOreNames.put("Grossular"); + aOreNames.put("Pyrope"); + aOreNames.put("Sodalite"); + aOreNames.put("Spodumene"); + aOreNames.put("Ruby"); + aOreNames.put("Sapphire"); + aOreNames.put("GreenSapphire"); + + // Voltage + HashMap aOreData1 = new HashMap(); + // Input Count + HashMap aOreData2 = new HashMap(); + // Output Count + HashMap aOreData3 = new HashMap(); + + aOreData1.put("Lazurite", 120); + aOreData1.put("Bauxite", 90); + aOreData1.put("Grossular", 90); + aOreData1.put("Pyrope", 90); + aOreData1.put("Sodalite", 90); + aOreData1.put("Spodumene", 90); + aOreData1.put("Ruby", 60); + aOreData1.put("Sapphire", 30); + aOreData1.put("GreenSapphire", 30); + aOreData2.put("Lazurite", 14); + aOreData2.put("Bauxite", 39); + aOreData2.put("Grossular", 20); + aOreData2.put("Pyrope", 20); + aOreData2.put("Sodalite", 11); + aOreData2.put("Spodumene", 10); + aOreData2.put("Ruby", 6); + aOreData2.put("Sapphire", 5); + aOreData2.put("GreenSapphire", 5); + aOreData3.put("Lazurite", 3); + aOreData3.put("Bauxite", 16); + aOreData3.put("Grossular", 2); + aOreData3.put("Pyrope", 2); + aOreData3.put("Sodalite", 3); + aOreData3.put("Spodumene", 1); + aOreData3.put("Ruby", 2); + aOreData3.put("Sapphire", 2); + aOreData3.put("GreenSapphire", 2); + + // Assemble all valid crushed ore types for making pellet mix + HashMap aOreCache = new HashMap(); + for (String aOreName : aOreNames) { + String aTemp = aOreName; + aOreName = "crushedPurified" + aOreName; + if (ItemUtils.doesOreDictHaveEntryFor(aOreName)) { + aOreCache.put(aTemp, ItemUtils.getItemStackOfAmountFromOreDict(aOreName, 1)); + } + } + + for (String aOreName : aOreNames) { + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(14), + ItemUtils.getSimpleStack(aOreCache.get(aOreName), aOreData2.get(aOreName)) + }, + new FluidStack[] { + FluidUtils.getSteam(4000) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, (int) (Math.ceil(aOreData3.get(aOreName) * 1.4))) + }, + new FluidStack[] { + FluidUtils.getFluidStack("fluid.sludge", 2500) + }, + 20 * 60, + aOreData1.get(aOreName), + 1); + } + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, 3), + ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0), ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4), - 10000, - 120 * 20, - 16); + 20 * 30, + 64); + + } private static void recipeAlumina() { @@ -907,7 +1033,7 @@ public class BioRecipes { 45 * 30, 90); } - + } private static void recipeAlginicAcid() { @@ -937,15 +1063,15 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 50), }, 60 * 20, 60, - 2); - + 1); + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(7), @@ -956,7 +1082,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 250), @@ -964,7 +1090,7 @@ public class BioRecipes { 60 * 20, 120, 2); - + } private static void recipeUrea() { @@ -979,7 +1105,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 400), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mUrea, 400), @@ -988,7 +1114,7 @@ public class BioRecipes { 120 * 20, 30, 1); - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(9), @@ -998,7 +1124,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200) @@ -1023,7 +1149,7 @@ public class BioRecipes { ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1), }, new FluidStack[] { - + }, 60 * 20, 30, @@ -1041,7 +1167,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mEthanol, 200), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 50), @@ -1049,7 +1175,7 @@ public class BioRecipes { 60 * 20, 30, 1); - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(3), @@ -1062,13 +1188,13 @@ public class BioRecipes { ItemUtils.getSimpleStack(Ic2Items.resin, 1) }, new FluidStack[] { - + }, 120 * 20, 30, 1); - - + + } private static void recipeCompost() { @@ -1088,7 +1214,7 @@ public class BioRecipes { aFert }, new FluidStack[] { - + }, 120 * 20, 60, @@ -1109,16 +1235,16 @@ public class BioRecipes { aFert }, new FluidStack[] { - + }, 120 * 20, 60, 2); - + } private static void recipeMethane() { - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(12), @@ -1128,15 +1254,15 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mMethane, 10), }, 20 * 20, - 30, + 16, 1); - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(13), @@ -1148,7 +1274,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mMethane, 2000), }, new ItemStack[] { - + }, new FluidStack[] { FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144/4)), @@ -1180,7 +1306,7 @@ public class BioRecipes { } private static void recipeStyrene() { - + CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(20), diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java index 671c765270..71971308f1 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java @@ -1,12 +1,18 @@ package gtPlusPlus.plugin.agrichem.item.algae; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.OreDictUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureClock; +import net.minecraft.client.renderer.texture.TextureCompass; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -19,7 +25,7 @@ import net.minecraftforge.oredict.OreDictionary; public class ItemAgrichemBase extends Item { - protected IIcon base[] = new IIcon[22]; + final protected IIcon base[]; /* * 0 - Algae Biomass @@ -44,13 +50,16 @@ public class ItemAgrichemBase extends Item { * 19 - Sodium Hydroxide // Exists in Newer GT * 20 - Sodium Carbonate * 21 - Lithium Chloride + * 22 - Pellet Mold + * 23 - Clean Aluminium Mix */ public ItemAgrichemBase() { this.setHasSubtypes(true); this.setNoRepair(); this.setMaxStackSize(64); - this.setMaxDamage(0); + this.setMaxDamage(0); + base = new IIcon[24]; this.setUnlocalizedName("BasicAgrichemItem"); GameRegistry.registerItem(this, this.getUnlocalizedName()); } @@ -179,10 +188,38 @@ public class ItemAgrichemBase extends Item { @Override public void registerIcons(final IIconRegister u) { for (int i=0;i 0 && this.isValidSlot(i)) { @@ -95,6 +124,38 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } } + + + public void dropItems(ItemStack tItem) { + if (tItem != null) { + Random tRandom = new Random(); + EntityItem tItemEntity = new EntityItem(this.worldObj, + (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F), + (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F), + (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F), + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + if (tItem.hasTagCompound()) { + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); + } + + tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; + tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D; + tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D; + tItemEntity.hurtResistantTime = 999999; + tItemEntity.lifespan = 60000; + + try { + if (ENTITY_ITEM_HEALTH_FIELD_2 != null) { + ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999); + } + } catch (Exception var5) { + ; + } + + this.worldObj.spawnEntityInWorld(tItemEntity); + tItem.stackSize = 0; + } + } public ArrayList getDrops() { ArrayList aDrops = new ArrayList(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java index 19ba932a02..2eb1d36791 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java @@ -11,11 +11,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.random.XSTR; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java index d9e2692b09..752321506d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -31,11 +31,11 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H } public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + super(aName, aTier, aDescription[0], aTextures); } public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescription, this.mTextures); } public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index aad05f1730..430ae44d64 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -482,7 +482,7 @@ public class Meta_GT_Proxy { * @deprecated Use {@link StaticFields59#getFieldFromGregtechProxy(boolean,String)} instead */ public static Object getFieldFromGregtechProxy(boolean client, String fieldName) { - return StaticFields59.getFieldFromGregtechProxy(fieldName); + return StaticFields59.getFieldFromGregtechProxy(client, fieldName); } public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java index 9c552db3ad..814ed589f0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -18,6 +18,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.common.GT_Proxy; import gtPlusPlus.api.objects.Logger; @@ -37,6 +38,7 @@ public class StaticFields59 { public static final Field mPreventableComponents; public static final Field mDisabledItems; public static final Field mMultiblockChemicalRecipes; + public static final Field mPyrolyseRecipes; public static final Field mDescriptionArray; public static final Field mCasingTexturePages; public static final Field mAssLineVisualMapNEI; @@ -79,8 +81,16 @@ public class StaticFields59 { } sAssemblylineVisualRecipes = aTemp; + mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes"); - Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes"); + Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes"); + if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) { + mPyrolyseRecipes = getField(GT_Recipe_Map.class, "sPyrolyseRecipes"); + Logger.INFO("[SH] Got Field: sPyrolyseRecipes"); + } + else { + mPyrolyseRecipes = null; + } mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class); @@ -148,6 +158,14 @@ public class StaticFields59 { } } + public static synchronized final GT_Recipe_Map getPyrolyseRecipeMap() { + try { + return mPyrolyseRecipes != null ? (GT_Recipe_Map) mPyrolyseRecipes.get(null) : null; + } catch (IllegalArgumentException | IllegalAccessException e) { + return null; + } + } + public static Materials getMaterial(String aMaterialName) { Materials m = mMaterialCache.get(aMaterialName); if (m != null) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java index c62d47e904..01f655c355 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java @@ -15,13 +15,13 @@ import gregtech.api.items.GT_Generic_Block; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Item_Machines; import gregtech.common.blocks.GT_Material_Machines; import gregtech.common.render.GT_Renderer_Block; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; import net.minecraft.block.Block; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index 561da54ceb..65b59ce151 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -9,6 +9,7 @@ import gregtech.api.util.GT_CoverBehavior; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +38,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - PlayerUtils.messagePlayer(aPlayer, this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); + PlayerUtils.messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } @@ -71,7 +72,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable); + return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable); } public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java new file mode 100644 index 0000000000..d51107bbf0 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java @@ -0,0 +1,80 @@ +package gtPlusPlus.xmod.gregtech.common.helpers; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; + +public class GT_MethodHelper { + + private static final Method mGetTexture; + private static final Class mITexturedTileEntity; + + static { + Class clazz = null; + Method aMeth = null; + if (ReflectionUtils.doesClassExist("gregtech.api.interfaces.tileentity.ITexturedTileEntity")) { + clazz = ReflectionUtils.getClass("gregtech.api.interfaces.tileentity.ITexturedTileEntity"); + aMeth = ReflectionUtils.getMethod(clazz, "getTexture", Block.class, byte.class); + } + mITexturedTileEntity = clazz; + mGetTexture = aMeth; + } + + + public static ITexture[] getTexture(TileEntity tTileEntity, Block aBlock, byte aSide) { + + if (mITexturedTileEntity.isInstance(tTileEntity)) { + + if (mGetTexture != null) { + try { + mGetTexture.invoke(tTileEntity, aBlock, aSide); + } + catch (IllegalAccessException | IllegalArgumentException + | InvocationTargetException e) { + e.printStackTrace(); + } + } + else { + if (tTileEntity instanceof BaseMetaTileEntity) { + try { + BaseMetaTileEntity aTile = (BaseMetaTileEntity) tTileEntity; + ITexture rIcon = aTile.getCoverTexture(aSide); + Field aFacing = ReflectionUtils.getField(BaseMetaTileEntity.class, "mFacing"); + Field aColor = ReflectionUtils.getField(BaseMetaTileEntity.class, "mColor"); + Field aActive = ReflectionUtils.getField(BaseMetaTileEntity.class, "mActive"); + Field aMetaTile = ReflectionUtils.getField(BaseMetaTileEntity.class, "mMetaTileEntity"); + Method aHasValidTile = ReflectionUtils.getMethod(BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {}); + + boolean hasValidTileObj = (boolean) aHasValidTile.invoke(aTile, new Object[] {}); + boolean aActiveObj = aActive.getBoolean(aTile); + byte aFacingObj = aFacing.getByte(aTile); + byte aColorObj = aColor.getByte(aTile);; + MetaTileEntity aMetaTileObj = (MetaTileEntity) aMetaTile.get(aTile); + + if (rIcon != null) { + return new ITexture[]{rIcon}; + } else { + return hasValidTileObj + ? aMetaTileObj.getTexture(aTile, aSide, aFacingObj, (byte) (aColorObj - 1), aActiveObj, + aTile.getOutputRedstoneSignal(aSide) > 0) + : BlockIcons.ERROR_RENDERING; + } + } + catch (Throwable t) { + t.printStackTrace(); + } + } + } + } + return BlockIcons.ERROR_RENDERING; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java index c884114b79..35d78008c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java @@ -10,10 +10,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.common.blocks.GT_Block_Machines; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; import gregtech.common.render.GT_Renderer_Block; import gtPlusPlus.xmod.gregtech.common.blocks.GTPP_Block_Machines; +import gtPlusPlus.xmod.gregtech.common.helpers.GT_MethodHelper; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -134,14 +133,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof ITexturedTileEntity ? renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, - new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 0), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 1), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 2), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 3), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 4), - ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 5)}) + new ITexture[][]{GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5)}) : false; } @@ -190,7 +190,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { ITexture[][] tCovers = new ITexture[6][]; for (byte i = 0; i < 6; ++i) { - tCovers[i] = aTileEntity.getTexture(aBlock, i); + tCovers[i] = GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, i); arg15[i] = aTileEntity.getTextureUncovered(i); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java index 7717bf6379..b7e4618e07 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -13,12 +13,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotChemicalPlantInput; import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor; @@ -311,13 +311,6 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba if (this.mProgresstime > 5) { this.mStuttering = false; } - - XSTR aXSTR = new XSTR(); - if (GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000) == 0) { - GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), - (String) GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); - } } } else { aBaseMetaTileEntity.setActive(false); @@ -509,11 +502,6 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba return super.checkRecipe(); } - @Override - public int checkRecipe(boolean skipOC) { - return super.checkRecipe(skipOC); - } - @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); @@ -615,11 +603,6 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba return super.drain(maxDrain, doDrain); } - @Override - protected void onEmptyingContainerWhenEmpty() { - super.onEmptyingContainerWhenEmpty(); - } - @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index 23ca94e54d..6f9080673f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -17,16 +17,11 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; -import gregtech.common.GT_Pollution; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 18cf892698..fda79876f6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -65,9 +65,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { "X X", "X X", "XXXXXXXXX", - "Can process (Tier * 10) recipes", "Machine Hulls (all bottom layer)", - "Sterile Farm Casings (all non-hatches)", + "Sterile Farm Casings (rest)", "Controller (front centered)", "All hatches must be on the bottom layer", "All hulls must be the same tier, this dictates machine speed", diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index fbf61598d3..40994040bd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -1,29 +1,55 @@ package gtPlusPlus.xmod.gregtech.loaders; import java.util.HashSet; -import java.util.Set; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class RecipeGen_FluidCanning extends RecipeGen_Base { - - public final static Set> mRecipeGenMap = new HashSet>(); - static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); +public class RecipeGen_FluidCanning implements Runnable { + + public static void init() { + FluidCanningRunnableHandler x = new FluidCanningRunnableHandler(); + x.run(); } + private static class FluidCanningRunnableHandler implements RunnableWithInfo { + + @Override + public void run() { + mHasRun = true; + for (RecipeGen_FluidCanning aRecipe : mCache) { + aRecipe.run(); + } + } + + @Override + public String getInfoData() { + return "Fluid Canning Recipes"; + } + } + + private static boolean mHasRun = false; + + private static HashSet mCache = new HashSet(); + + private static void addRunnableToRecipeCache(RecipeGen_FluidCanning r) { + if (mHasRun) { + CORE.crash(); + } + mCache.add(r); + } + + protected boolean disableOptional; + private final GT_Recipe recipe; private final boolean isValid; @@ -95,13 +121,18 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { // Check Valid boolean aTempValidityCheck = false; + //Logger.INFO("Validity Check."); if (aExtracting) { + Logger.INFO("Extracting."); if (aInput != null && aFluidOutput != null) { + //Logger.INFO("Pass."); aTempValidityCheck = true; } } else { + //Logger.INFO("Canning."); if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) { + //Logger.INFO("Pass."); aTempValidityCheck = true; } } @@ -110,11 +141,14 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { if (aTempValidityCheck) { // Valid Recipe recipe = aRecipe; - mRecipeGenMap.add(this); disableOptional = aExtracting; - isValid = true; + isValid = true; + //Logger.INFO("Passed Validity Check. Hash: "+recipe.hashCode()); + //Logger.INFO("Mapped as: "+(disableOptional ? "Extracting" : "Canning")); + addRunnableToRecipeCache(this); } else { + //Logger.INFO("Failed Validity Check."); isValid = false; disableOptional = aExtracting; aRecipe.mEnabled = false; @@ -125,40 +159,54 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base { @Override public void run() { + Logger.INFO("Processing Recipe with Hash: "+recipe.hashCode()); generateRecipes(); } private void generateRecipes() { if (isValid && recipe != null) { + //Logger.INFO("Processing "+(disableOptional ? "Extracting" : "Canning")+" Recipe."); if (this.disableOptional) { addFluidExtractionRecipe(recipe); } else { addFluidCannerRecipe(recipe); } - } + } } private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) { - if (aRecipe != null) { - int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); - int aCount2 = aCount1; - GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); - aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); - return aCount1 > aCount2; + boolean result = false; + int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); + aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); + result = aCount1 > aCount2; + if (result) { + //Logger.INFO("[FIND] Added Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + } + else { + Logger.INFO("[ERROR] Failed adding Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + //dumpStack(); } - return false; + return result; } - private final boolean addFluidCannerRecipe(GT_Recipe recipe2) { - if (recipe2 != null) { - int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); - int aCount2 = aCount1; - GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2); - aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); - return aCount1 > aCount2; + private final boolean addFluidCannerRecipe(GT_Recipe aRecipe) { + boolean result = false; + int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + int aCount2 = aCount1; + GT_Recipe_Map.sFluidCannerRecipes.addRecipe(aRecipe); + aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size(); + result = aCount1 > aCount2; + if (result) { + //Logger.INFO("[FIND] Added Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + } + else { + Logger.INFO("[ERROR] Failed adding Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + //dumpStack(); } - return false; + return result; } private void dumpStack() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index cd853dfb0d..305c7fc0d0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -8,6 +8,7 @@ import java.util.List; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.CustomRecipeMap; @@ -15,6 +16,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gregtech.api.util.SemiFluidFuelHandler; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; @@ -680,6 +682,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { private static final Method mScannerTT; private static final Method[] mChemicalRecipe = new Method[3]; private static final Method mLargeChemReactor; + private static final Method mPyroOven; static { @@ -729,6 +732,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { mLargeChemReactor = ReflectionUtils.getMethod(clazz, "addMultiblockChemicalRecipe", ItemStack[].class, FluidStack[].class, FluidStack[].class, ItemStack[].class, int.class, int.class); + mPyroOven = ReflectionUtils.getMethod(clazz, "addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class); + } @@ -737,6 +742,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { mAssemblyLine = null; mLargeChemReactor = null; mScannerTT = null; + mPyroOven = null; } @@ -1006,18 +1012,18 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu) { - return MaterialGenerator.addFluidExtractionRecipe(input, input2, output, aTime, aEu); + public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) { + return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU); } @Override - public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn) { - return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, null); + public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn) { + return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, null); } @Override - public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn, FluidStack rFluidOut) { - return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut); + public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut) { + return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, rFluidOut); } @@ -1217,6 +1223,53 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } + @Override + public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) { + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mPyroOven == null) { + return false; + } + try { + return (boolean) mPyroOven.invoke(GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + return false; + } + } + + @Override + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { + if (aInput != null && aOutput != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(), + aDuration)) <= 0) { + return false; + } else { + GT_Recipe tRecipe = GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit}, + new ItemStack[] {aSolidOutput}, (Object) null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, + aDuration, aEUt, 0); + if (aHidden && tRecipe != null) { + tRecipe.mHidden = true; + } + return true; + } + } else { + return false; + } + } + + @Override + public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if (aInput != null && aOutput != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) { + return false; + } else { + GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, + (Object) null, (FluidStack[]) null, (FluidStack[]) null, aDuration, aEUt, 0); + return true; + } + } else { + return false; + } + } + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 9f67363302..54e4fbf024 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -8,6 +8,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; @@ -68,7 +69,13 @@ public class GregtechCustomHatches { "hatch.turbine.input.tier.00", // unlocal name "Turbine Housing", // Local name 8 - ).getStackForm(1L)); + ).getStackForm(1L)); + + // Multiblock Control Core Bus + GregtechItemList.Hatch_Control_Core.set((new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1)).getStackForm(1L)); + + // Multiblock Air Intake Hatch + GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L)); @@ -105,12 +112,7 @@ public class GregtechCustomHatches { .getStackForm(1L)); GregtechItemList.Hatch_Muffler_Adv_MAX .set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30009, "hatch.muffler.adv.tier.09", "Advanced Muffler Hatch (MAX)", 9)) - .getStackForm(1L)); - - //GT++ multiblock Control Core Bus - GregtechItemList.Hatch_Control_Core - .set((new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1)) - .getStackForm(1L)); + .getStackForm(1L)); } private static void run3() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java index bbe2d10273..c470243822 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java @@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaAtmosphericReconditioner; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionCreator; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionDetector; @@ -12,8 +12,8 @@ public class GregtechPollutionDevices { public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices."); - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + if (PollutionUtils.isPollutionEnabled()) { + Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices."); run1(); } } @@ -50,7 +50,6 @@ public class GregtechPollutionDevices { "pollutioncleaner.10.tier.single", "Biosphere Cleanser", 9).getStackForm(1L)); } - GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L)); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java index b8dd8e4767..2d548a57b7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java @@ -12,6 +12,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityRocketFuelGenerator; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_LargeRocketEngine; @@ -32,12 +33,15 @@ public class GregtechRocketFuelGenerator { GregtechItemList.Controller_RocketEngine.set( new GregtechMetaTileEntity_LargeRocketEngine(996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L)); + + ItemList aDieselEngine = Utils.getValueOfItemList("Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel); + GT_ModHandler.addCraftingRecipe( GregtechItemList.Controller_RocketEngine.get(1L), CI.bitsd, new Object[]{ "PCP", "EME", "GWG", - 'M', ItemList.Machine_Multi_DieselEngine, + 'M', aDieselEngine, 'P', ItemList.Electric_Piston_IV, 'E', ItemList.Field_Generator_EV, 'C', OrePrefixes.circuit.get(Materials.Master), diff --git a/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java b/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java index b79a4f45a5..1133e67fe6 100644 --- a/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java +++ b/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java @@ -2,7 +2,6 @@ package gtPlusPlus.xmod.reliquary.util; import static gtPlusPlus.core.lib.CORE.GTNH; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; @@ -45,7 +44,7 @@ public class ReliquaryRecipeHandler { Logger.INFO("Finished removing original recipes."); // Add new recipes - if (GT_Values.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) { + if (CORE.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) { Logger.INFO("Added new recipe for Glowing Water."); } if (CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32), CI.getFieldGenerator(5, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8), CI.getEmitter(3, 20)}, FluidUtils.getUUM(50), ReliquaryItems.emptyVoidTear(), 20 * 2000, 2000)){ diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java index 3de15ce6be..85485b5565 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -12,6 +12,7 @@ import gregtech.api.util.GT_OreDictUnificator; import cofh.lib.util.helpers.ItemHelper; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.thermalfoundation.item.TF_Items; import net.minecraftforge.fluids.FluidRegistry; @@ -25,34 +26,23 @@ public class TF_Gregtech_Recipes { private static void start(){ //Get Items to work with - final ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy(); - final ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy(); - final ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy(); - final ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3); - final ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy(); + final ItemStack dust_Cryotheum = ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1); + final ItemStack dust_Pyrotheum = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Pyrotheum, 1L); + final ItemStack dust_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1); + final ItemStack dust_Blizz3 = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 3); + final ItemStack rod_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1); + final FluidStack moltenBlaze = getFluidStack("molten.blaze", 1440); //Gelid Cryotheum - Logger.INFO("Adding Recipes for Gelid Cryotheum"); - CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, getFluidStack("cryotheum", 250), 200, 240); GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 144), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30); //Blizz Powder - Logger.INFO("Adding Recipes for Blizz Powder"); GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenBlaze, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240); //Blizz Rod - Logger.INFO("Adding Recipes for Blizz Rod"); GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L)); - GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false); - - //Blazing Pyrotheum - Logger.INFO("Adding Recipes for Blazing Pyrotheum"); - CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, getFluidStack("pyrotheum", 250), 200, 240); - - //Ender Fluid - CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), getFluidStack("ender", 250), 100, 30); - + GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false); ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1); ItemStack dustSulfur = ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1); @@ -105,14 +95,7 @@ public class TF_Gregtech_Recipes { } private static FluidStack getFluidStack(final String fluidName, final int amount){ - Logger.WARNING("Trying to get a fluid stack of "+fluidName); - try { - return FluidRegistry.getFluidStack(fluidName, amount); - } - catch (final Throwable e){ - return null; - } - + return FluidUtils.getFluidStack(fluidName, amount); } } diff --git a/src/Java/speiger/src/crops/api/ICropCardInfo.java b/src/Java/speiger/src/crops/api/ICropCardInfo.java new file mode 100644 index 0000000000..ff67eb06b1 --- /dev/null +++ b/src/Java/speiger/src/crops/api/ICropCardInfo.java @@ -0,0 +1,12 @@ +package speiger.src.crops.api; + +import java.util.List; +import net.minecraft.item.ItemStack; + +public interface ICropCardInfo { + + List getCropInformation(); + + ItemStack getDisplayItem(); + +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index ad10be2d8b..f08c7b324c 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3038,7 +3038,6 @@ tile.blockRoundRobinator.4.name=Round Robinator V //Added 16/10/19 - item.BioRecipeSelector.name=Programmed Bio Circuit item.FermentationBase.name=Cell of Fermentation Base item.ureamix.name=Cell of Urea Mix @@ -3074,4 +3073,21 @@ item.butanol.name=Butanol Cell //Try Fix IC2 Garbage vv fluidHotWater=Heated Water fluidHotWater.name=Heated Water -//Try Fix IC2 Garbage ^^ \ No newline at end of file +//Try Fix IC2 Garbage ^^ + + +//Added 11/12/19 +item.itemHotIngotTitanium.name=Hot Titanium Ingot +item.OilHeavy.name=Heavy Oil Cell +item.UnsymmetricalDimethylhydrazine.name=Unsymmetrical Dimethylhydrazine Cell +item.benzene.name=Benzene Cell +item.Benzene.name=Benzene Cell +item.phenol.name=Phenol Cell +item.CarbonDioxide.name=Carbon Dioxide Cell +item.itemCellCarbonDioxide.name=Carbon Dioxide Cell +item.CarbonMonoxide.name=Carbon Monoxide Cell +item.itemCellCarbonMonoxide.name=Carbon Monoxide Cell +item.acetone.name=Acetone Cell +item.saltwater.name=Salt Water Cell +item.BasicAgrichemItem.22.name=Mold (Pellet) +item.BasicAgrichemItem.23.name=Clean Aluminium Mix diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png new file mode 100644 index 0000000000..77be3ef6a8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/22.png differ diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/23.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/23.png new file mode 100644 index 0000000000..110cd7f8e8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/23.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/0.png b/src/resources/assets/miscutils/textures/items/particle/new/0.png new file mode 100644 index 0000000000..3fe49c3a57 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/0.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/1.png b/src/resources/assets/miscutils/textures/items/particle/new/1.png new file mode 100644 index 0000000000..39ffa85711 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/1.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/10.png b/src/resources/assets/miscutils/textures/items/particle/new/10.png new file mode 100644 index 0000000000..18ded814cf Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/10.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/11.png b/src/resources/assets/miscutils/textures/items/particle/new/11.png new file mode 100644 index 0000000000..b7e191c79f Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/11.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/12.png b/src/resources/assets/miscutils/textures/items/particle/new/12.png new file mode 100644 index 0000000000..49feb199e0 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/12.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/13.png b/src/resources/assets/miscutils/textures/items/particle/new/13.png new file mode 100644 index 0000000000..b70178d315 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/13.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/14.png b/src/resources/assets/miscutils/textures/items/particle/new/14.png new file mode 100644 index 0000000000..77741644ed Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/14.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/15.png b/src/resources/assets/miscutils/textures/items/particle/new/15.png new file mode 100644 index 0000000000..d48096c85c Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/15.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/16.png b/src/resources/assets/miscutils/textures/items/particle/new/16.png new file mode 100644 index 0000000000..cef33d17fd Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/16.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/17.png b/src/resources/assets/miscutils/textures/items/particle/new/17.png new file mode 100644 index 0000000000..4b752e7a9a Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/17.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/18.png b/src/resources/assets/miscutils/textures/items/particle/new/18.png new file mode 100644 index 0000000000..23fdb190c7 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/18.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/19.png b/src/resources/assets/miscutils/textures/items/particle/new/19.png new file mode 100644 index 0000000000..94e2a856c9 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/19.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/2.png b/src/resources/assets/miscutils/textures/items/particle/new/2.png new file mode 100644 index 0000000000..d86b5b357d Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/2.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/20.png b/src/resources/assets/miscutils/textures/items/particle/new/20.png new file mode 100644 index 0000000000..d7cbdb8f45 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/20.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/21.png b/src/resources/assets/miscutils/textures/items/particle/new/21.png new file mode 100644 index 0000000000..2531eaff52 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/21.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/22.png b/src/resources/assets/miscutils/textures/items/particle/new/22.png new file mode 100644 index 0000000000..d594dc4be8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/22.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/23.png b/src/resources/assets/miscutils/textures/items/particle/new/23.png new file mode 100644 index 0000000000..d96dd2b000 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/23.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/24.png b/src/resources/assets/miscutils/textures/items/particle/new/24.png new file mode 100644 index 0000000000..56067466ad Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/24.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/3.png b/src/resources/assets/miscutils/textures/items/particle/new/3.png new file mode 100644 index 0000000000..43438c4ce5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/3.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/4.png b/src/resources/assets/miscutils/textures/items/particle/new/4.png new file mode 100644 index 0000000000..8f0db073cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/4.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/5.png b/src/resources/assets/miscutils/textures/items/particle/new/5.png new file mode 100644 index 0000000000..40ec84db70 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/5.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/6.png b/src/resources/assets/miscutils/textures/items/particle/new/6.png new file mode 100644 index 0000000000..c63ad0ba19 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/6.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/7.png b/src/resources/assets/miscutils/textures/items/particle/new/7.png new file mode 100644 index 0000000000..aad8c7ca62 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/7.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/8.png b/src/resources/assets/miscutils/textures/items/particle/new/8.png new file mode 100644 index 0000000000..c9b908ec61 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/8.png differ diff --git a/src/resources/assets/miscutils/textures/items/particle/new/9.png b/src/resources/assets/miscutils/textures/items/particle/new/9.png new file mode 100644 index 0000000000..b8e02c82ea Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/particle/new/9.png differ -- cgit From ca5cfe8c7832ae0bcc6a498b3d89cb007ff7a74e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:45:53 +0000 Subject: + Added several new catalysts. + Added Recipe for Nitrobenzene. + Added Recipe for Aniline. + Added Recipe for Cadaverine & Putrescine. + Added Recipe for Cyclohexane. + Added Recipe for Cyclohexanone. + Added several other recipes, which I forget. --- .../gtPlusPlus/core/item/chemistry/CoalTar.java | 121 +----- .../core/item/chemistry/GenericChem.java | 469 ++++++++++++++++++++- .../gtPlusPlus/core/item/chemistry/OilChem.java | 163 +------ .../chemistry/general/ItemGenericChemBase.java | 162 +++++++ .../agrichem/item/algae/ItemAgrichemBase.java | 2 - .../textures/items/science/general/MetaItem1/0.png | Bin 0 -> 441 bytes .../textures/items/science/general/MetaItem1/1.png | Bin 0 -> 440 bytes .../textures/items/science/general/MetaItem1/2.png | Bin 0 -> 447 bytes .../textures/items/science/general/MetaItem1/3.png | Bin 0 -> 448 bytes .../textures/items/science/general/MetaItem1/4.png | Bin 0 -> 434 bytes .../textures/items/science/general/MetaItem1/5.png | Bin 0 -> 440 bytes 11 files changed, 637 insertions(+), 280 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/0.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/1.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/2.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/3.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/4.png create mode 100644 src/resources/assets/miscutils/textures/items/science/general/MetaItem1/5.png (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index f5ddfa4dd9..8eba9668ad 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.item.chemistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.ModItems; @@ -24,7 +23,6 @@ public class CoalTar extends ItemPackage { public static Fluid Coal_Gas; public static Fluid Coal_Oil; public static Fluid Ethylene; - public static Fluid Benzene; public static Fluid Ethylbenzene; public static Fluid Anthracene; public static Fluid Toluene; @@ -33,10 +31,6 @@ public class CoalTar extends ItemPackage { public static Fluid Sulfuric_Coal_Tar_Oil; public static Fluid Naphthalene; public static Fluid Phthalic_Acid; - public static Fluid Ethylanthraquinone2; - public static Fluid Ethylanthrahydroquinone2; - public static Fluid Hydrogen_Peroxide; - public static Fluid Lithium_Peroxide; private static void recipeEthylBenzineFuelsIntoHeavyFuel() { CORE.RA.addChemicalRecipe( @@ -262,77 +256,6 @@ public class CoalTar extends ItemPackage { } - private static void recipe2Ethylanthraquinone() { - GT_Values.RA.addChemicalRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4), - ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2), - null, - FluidUtils.getFluidStack("fluid.2ethylanthraquinone", 2000+(144*4)), - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - 20*16); - - } - - private static void recipe2Ethylanthrahydroquinone() { - GT_Values.RA.addChemicalRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("platePalladium", 0), - ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthraquinone", 1), - FluidUtils.getFluidStack("hydrogen", 500), - FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 1200), - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), - 20*40); - - } - - private static void recipeHydrogenPeroxide() { - - CORE.RA.addChemicalRecipe( - GT_ModHandler.getAirCell(15), - ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5), - 20, - FluidUtils.getFluidStack("fluid.anthracene", 50), - FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2), - CI.emptyCells(18), - 20*30, - 240); - - } - - - private static void recipeLithiumHydroperoxide() { - - CORE.RA.addChemicalRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), - 20, - FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50), - null, - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14), - CI.emptyCells(1), - 20*30, - 240); - } - - - private static void recipeLithiumPeroxide() { - CORE.RA.addDehydratorRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 2), - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 3) - }, - null, - null, - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 2) - }, - new int[]{10000, 10000, 10000}, - 20*100, - 240); - } - @Override public String errorMessage() { return "Bad Coal Science!"; @@ -349,11 +272,6 @@ public class CoalTar extends ItemPackage { recipeCoalTarOilToSulfuricOilToNaphthalene(); recipeNaphthaleneToPhthalicAcid(); recipePhthalicAcidToPhthalicAnhydride(); - recipe2Ethylanthraquinone(); - recipe2Ethylanthrahydroquinone(); - recipeHydrogenPeroxide(); - recipeLithiumHydroperoxide(); - recipeLithiumPeroxide(); recipeEthylBenzineFuelsIntoHeavyFuel(); @@ -398,19 +316,11 @@ public class CoalTar extends ItemPackage { //Create Ethylene - if (!FluidUtils.doesFluidExist("Ethylene")){ - Ethylene = FluidUtils.generateFluidNonMolten("Ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null); + if (!FluidUtils.doesFluidExist("ethylene")){ + Ethylene = FluidUtils.generateFluidNonMolten("ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null); } else { - Ethylene = FluidUtils.getWildcardFluidStack("Ethylene", 1).getFluid(); - } - - //Create Benzene - (Toluene + Hydrogen | 95% Benzene / 5% methane) - if (!FluidUtils.doesFluidExist("NitrousOxide")){ - Benzene = FluidUtils.generateFluidNonMolten("Benzene", "Benzene", 81, new short[]{150, 75, 0, 100}, null, null); - } - else { - Benzene = FluidUtils.getWildcardFluidStack("Benzene", 1).getFluid(); + Ethylene = FluidUtils.getWildcardFluidStack("ethylene", 1).getFluid(); } //Create Ethylbenzene - Ethylbenzene is produced in on a large scale by combining benzene and ethylene in an acid-catalyzed chemical reaction @@ -419,12 +329,12 @@ public class CoalTar extends ItemPackage { //Create Anthracene Anthracene = FluidUtils.generateFluidNonMolten("Anthracene", "Anthracene", 340, new short[]{255, 255, 255, 100}, null, null); //Toluene - if (!FluidUtils.doesFluidExist("Toluene")){ - Toluene = FluidUtils.generateFluidNonMolten("Toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null); + if (!FluidUtils.doesFluidExist("liquid_toluene")){ + Toluene = FluidUtils.generateFluidNonMolten("liquid_toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null); } else { - Toluene = FluidUtils.getWildcardFluidStack("Toluene", 1).getFluid(); - Item itemCellToluene = new BaseItemComponent("Toluene", "Toluene", new short[]{140, 70, 20, 100}); + Toluene = FluidUtils.getWildcardFluidStack("liquid_toluene", 1).getFluid(); + Item itemCellToluene = new BaseItemComponent("liquid_toluene", "Toluene", new short[]{140, 70, 20, 100}); CORE.RA.addFluidCannerRecipe(ItemUtils.getEmptyCell(), ItemUtils.getSimpleStack(itemCellToluene), FluidUtils.getFluidStack(Toluene, 1000), null); } @@ -448,23 +358,6 @@ public class CoalTar extends ItemPackage { - //Create 2-Ethylanthraquinone - //2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene - Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[]{227, 255, 159, 100}, null, null); - //Create 2-Ethylanthrahydroquinone - //Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone - Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthrahydroquinone", "2-Ethylanthrahydroquinone", 415, new short[]{207, 225, 129, 100}, null, null); - //Create Hydrogen Peroxide - //Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide - Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten("HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[]{210, 255, 255, 100}, null, null); - - - - //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O - //ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125)); - // v - Dehydrate - //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O - Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null); } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index c64ad07d2a..83f49cf9b7 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -1,19 +1,29 @@ package gtPlusPlus.core.item.chemistry; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.TextureSet; +import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.minecraft.ItemPackage; +import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.NONMATERIAL; import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase; +import net.minecraft.block.Block; +import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; public class GenericChem extends ItemPackage { @@ -66,12 +76,18 @@ public class GenericChem extends ItemPackage { public Fluid Putrescine; //https://en.wikipedia.org/wiki/Putrescine + public static Fluid Ethylanthraquinone2; + public static Fluid Ethylanthrahydroquinone2; + public static Fluid Hydrogen_Peroxide; + public static Fluid Lithium_Peroxide; + /** * Items */ // Phenol Byproducts public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin + public ItemGenericChemBase mGenericChemItem1; @@ -80,7 +96,46 @@ public class GenericChem extends ItemPackage { PhenolicResins = ItemUtils.generateSpecialUseDusts("phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0]; MaterialGenerator.generate(BAKELITE, false); MaterialGenerator.generate(NYLON, false); - MaterialGenerator.generate(TEFLON, false); + MaterialGenerator.generate(TEFLON, false); + + mGenericChemItem1 = new ItemGenericChemBase(); + + registerItemStacks(); + registerOreDict(); + } + + private ItemStack mCatalystCarrier; + + public ItemStack mRedCatalyst; + public ItemStack mYellowCatalyst; + public ItemStack mBlueCatalyst; + public ItemStack mOrangeCatalyst; + public ItemStack mPurpleCatalyst; + public ItemStack mBrownCatalyst; + + + public void registerItemStacks() { + + mCatalystCarrier = ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, 1); + + mRedCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 0, 1); + mYellowCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 1, 1); + mBlueCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 2, 1); + mOrangeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 3, 1); + mPurpleCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 4, 1); + mBrownCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 5, 1); + + } + + public void registerOreDict() { + + ItemUtils.addItemToOreDictionary(mRedCatalyst, "catalystIronCopper"); + ItemUtils.addItemToOreDictionary(mYellowCatalyst, "catalystTungstenNickel"); + ItemUtils.addItemToOreDictionary(mBlueCatalyst, "catalystCobaltTitanium"); + ItemUtils.addItemToOreDictionary(mOrangeCatalyst, "catalystVanadiumPalladium"); + ItemUtils.addItemToOreDictionary(mPurpleCatalyst, "catalystIridiumRuthenium"); + ItemUtils.addItemToOreDictionary(mBrownCatalyst, "catalystNickelAluminium"); + } @Override @@ -115,18 +170,422 @@ public class GenericChem extends ItemPackage { Cadaverine = FluidUtils.generateFluidNoPrefix("cadaverine", "Cadaverine", 32 + 175, new short[] { 100, 70, 30, 100 }, true); Putrescine = FluidUtils.generateFluidNoPrefix("putrescine", "Putrescine", 32 + 175, new short[] { 100, 70, 30, 100 }, true); + //Create 2-Ethylanthraquinone + //2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene + Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[]{227, 255, 159, 100}, null, null); + //Create 2-Ethylanthrahydroquinone + //Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone + Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthrahydroquinone", "2-Ethylanthrahydroquinone", 415, new short[]{207, 225, 129, 100}, null, null); + //Create Hydrogen Peroxide + //Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide + Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten("HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[]{210, 255, 255, 100}, null, null); + + + + //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O + //ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125)); + // v - Dehydrate + //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O + Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null); + + + } @Override public String errorMessage() { - // TODO Auto-generated method stub - return "Failed to generate recipes for AgroChem."; + return "Failed to generate recipes for GenericChem."; } @Override - public boolean generateRecipes() { - + public boolean generateRecipes() { + + recipeCatalystRed(); + recipeCatalystYellow(); + recipeCatalystBlue(); + recipeCatalystOrange(); + recipeCatalystPurple(); + recipeCatalystBrown(); + + recipeNitroBenzene(); + recipeAniline(); + recipeCadaverineAndPutrescine(); + recipeCyclohexane(); + recipeCyclohexanone(); + + recipe2Ethylanthraquinone(); + recipe2Ethylanthrahydroquinone(); + recipeHydrogenPeroxide(); + recipeLithiumHydroperoxide(); + recipeLithiumPeroxide(); return true; } + + private void recipeCyclohexane() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierTwoChip(), + ItemUtils.getSimpleStack(mBrownCatalyst, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(Benzene, 2000), + FluidUtils.getFluidStack("hydrogen", 10000) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mCatalystCarrier, 1) + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cyclohexane, 1000), + }, + 20 * 120, + 120, + 2); + + } + + private void recipeCyclohexanone() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierTwoChip(), + ItemUtils.getSimpleStack(mBlueCatalyst, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cyclohexane, 2000), + FluidUtils.getFluidStack("air", 10000) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mCatalystCarrier, 1) + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cyclohexanone, 2000), + }, + 20 * 120, + 120, + 2); + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierTwoChip(), + }, + new FluidStack[] { + FluidUtils.getFluidStack(Phenol, 2000), + FluidUtils.getFluidStack("oxygen", 5000) + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cyclohexanone, 2000), + }, + 20 * 120, + 120, + 2); + + + + + } + + private void recipeCatalystRed() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierOneChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().IRON.getDust(2), + ELEMENT.getInstance().COPPER.getDust(2), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mRedCatalyst, 10), + 600 * 20, + 30); + + } + + private void recipeCatalystYellow() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierThreeChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().TUNGSTEN.getDust(4), + ELEMENT.getInstance().NICKEL.getDust(4), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mYellowCatalyst, 10), + 600 * 20, + 2000); + + } + + private void recipeCatalystBlue() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierTwoChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().COBALT.getDust(3), + ELEMENT.getInstance().TITANIUM.getDust(3), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mBlueCatalyst, 10), + 600 * 20, + 500); + + } + + private void recipeCatalystOrange() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierTwoChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().VANADIUM.getDust(5), + ELEMENT.getInstance().PALLADIUM.getDust(5), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mOrangeCatalyst, 10), + 600 * 20, + 500); + + } + + private void recipeCatalystPurple() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierFourChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().IRIDIUM.getDust(6), + ELEMENT.getInstance().RUTHENIUM.getDust(6), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mPurpleCatalyst, 10), + 600 * 20, + 8000); + + } + + private void recipeCatalystBrown() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierOneChip(), + ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), + ELEMENT.getInstance().NICKEL.getDust(4), + ELEMENT.getInstance().ALUMINIUM.getDust(4), + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mBrownCatalyst, 10), + 600 * 20, + 30); + + } + + private void recipeCadaverineAndPutrescine() { + + // Basic Recipe + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierOneChip(), + ItemUtils.getSimpleStack(Items.rotten_flesh, 64) + }, + new FluidStack[] { + FluidUtils.getHotWater(2000) + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cadaverine, 250), + FluidUtils.getFluidStack(Putrescine, 250), + }, + 20 * 120, + 120, + 1); + + // Advanced Recipe + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierTwoChip(), + ItemUtils.getSimpleStack(Items.rotten_flesh, 128), + ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 8, 32) + }, + new FluidStack[] { + FluidUtils.getHotWater(3000) + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Cadaverine, 750), + FluidUtils.getFluidStack(Putrescine, 750), + }, + 20 * 120, + 240, + 2); + + } + + private void recipeAniline() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierThreeChip(), + ItemUtils.getSimpleStack(mBlueCatalyst, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(NitroBenzene, 2000), + FluidUtils.getFluidStack("hydrogen", 10000) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mCatalystCarrier, 1) + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Aniline, 2000), + }, + 20 * 30, + 500, + 3); + + } + + private void recipeNitroBenzene() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + getTierThreeChip(), + }, + new FluidStack[] { + FluidUtils.getFluidStack(Benzene, 5000), + FluidUtils.getFluidStack("sulfuricacid", 3000), + FluidUtils.getFluidStack("nitricacid", 3000), + FluidUtils.getDistilledWater(10000) + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack("dilutedsulfuricacid", 3000), + FluidUtils.getFluidStack(NitroBenzene, 3000), + }, + 20 * 30, + 1000, + 3); + + } + + static void recipe2Ethylanthraquinone() { + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4), + ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2), + null, + FluidUtils.getFluidStack("fluid.2ethylanthraquinone", 2000+(144*4)), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), + 20*16); + + } + + static void recipe2Ethylanthrahydroquinone() { + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("platePalladium", 0), + ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthraquinone", 1), + FluidUtils.getFluidStack("hydrogen", 500), + FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 1200), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), + 20*40); + + } + + static void recipeLithiumPeroxide() { + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 2), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 3) + }, + null, + null, + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 2) + }, + new int[]{10000, 10000, 10000}, + 20*100, + 240); + } + + static void recipeLithiumHydroperoxide() { + + CORE.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), + 20, + FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50), + null, + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14), + CI.emptyCells(1), + 20*30, + 240); + } + + static void recipeHydrogenPeroxide() { + + CORE.RA.addChemicalRecipe( + GT_ModHandler.getAirCell(15), + ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5), + 20, + FluidUtils.getFluidStack("fluid.anthracene", 50), + FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2), + CI.emptyCells(18), + 20*30, + 240); + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + private static final ItemStack getTierOneChip() { + return CI.getNumberedBioCircuit(4); + } + private static final ItemStack getTierTwoChip() { + return CI.getNumberedBioCircuit(8); + } + private static final ItemStack getTierThreeChip() { + return CI.getNumberedBioCircuit(12); + } + private static final ItemStack getTierFourChip() { + return CI.getNumberedBioCircuit(16); + } + + + } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java b/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java index 4fe9347324..4406995d27 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java @@ -1,16 +1,6 @@ package gtPlusPlus.core.item.chemistry; -import java.util.ArrayList; - -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.oredict.OreDictionary; public class OilChem extends ItemPackage { @@ -18,54 +8,16 @@ public class OilChem extends ItemPackage { * Fluids */ - // Poop Juice - public static Fluid PoopJuice; - // Manure Slurry - public static Fluid ManureSlurry; - // Fertile Manure Slurry - public static Fluid FertileManureSlurry; /** * Items */ - // Manure Byproducts - public static Item dustManureByproducts; - // Organic Fertilizer - public static Item dustOrganicFertilizer; - // Dirt - public static Item dustDirt; - - // Poop Juice - // vv - Centrifuge - // Manure Slurry && Manure Byproducts -> (Elements) Centrifuge to several tiny - // piles - // vv - Chem Reactor - Add Peat, Meat - // Organic Fertilizer - // vv - Dehydrate - // Fertilizer - - // Poop Juice - // vv - Mixer - Add Blood, Bone, Meat (1000L Poo, 200L Blood, x2 Bone, x3 Meat) - // Fertile Manure Slurry - // vv - Chem Reactor - Add Peat x1.5 - // Organic Fertilizer x3 - // vv - Dehydrate - // Fertilizer @Override public void items() { - // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon - dustManureByproducts = ItemUtils.generateSpecialUseDusts("ManureByproducts", "Manure Byproduct", - "(N2H4O3)N2P2Ca3CuC8", Utils.rgbtoHexValue(110, 75, 25))[0]; - - // Basically Guano - dustOrganicFertilizer = ItemUtils.generateSpecialUseDusts("OrganicFertilizer", "Organic Fertilizer", - "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0]; - - // Dirt Dust :) - dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0]; + } @Override @@ -75,126 +27,19 @@ public class OilChem extends ItemPackage { @Override public void fluids() { - // Sewage - PoopJuice = FluidUtils.generateFluidNonMolten("raw.waste", "Raw Animal Waste", 32 + 175, - new short[] { 100, 70, 30, 100 }, null, null, 0, true); - - // Sewage - ManureSlurry = FluidUtils.generateFluidNonMolten("manure.slurry", "Manure Slurry", 39 + 175, - new short[] { 75, 45, 15, 100 }, null, null, 0, true); - - // Sewage - FertileManureSlurry = FluidUtils.generateFluidNonMolten("fertile.manure.slurry", "Fertile Manure Slurry", - 45 + 175, new short[] { 65, 50, 15, 100 }, null, null, 0, true); - } - - private static AutoMap mMeats = new AutoMap(); - private static AutoMap mFish = new AutoMap(); - private static AutoMap mFruits = new AutoMap(); - private static AutoMap mVege = new AutoMap(); - private static AutoMap mNuts = new AutoMap(); - private static AutoMap mSeeds = new AutoMap(); - private static AutoMap mPeat = new AutoMap(); - private static AutoMap mBones = new AutoMap(); - private static AutoMap mBoneMeal = new AutoMap(); - - private static AutoMap mList_Master_Meats = new AutoMap(); - private static AutoMap mList_Master_FruitVege = new AutoMap(); - private static AutoMap mList_Master_Bones = new AutoMap(); - private static AutoMap mList_Master_Seeds = new AutoMap(); - - private static void processAllOreDict() { - processOreDict("listAllmeatraw", mMeats); - processOreDict("listAllfishraw", mFish); - processOreDict("listAllfruit", mFruits); - processOreDict("listAllVeggie", mVege); - processOreDict("listAllnut", mNuts); - processOreDict("listAllSeed", mSeeds); - processOreDict("brickPeat", mPeat); - processOreDict("bone", mBones); - processOreDict("dustBone", mBoneMeal); - // Just make a mega list, makes life easier. - if (!mMeats.isEmpty()) { - for (ItemStack g : mMeats) { - mList_Master_Meats.put(g); - } - } - if (!mFish.isEmpty()) { - for (ItemStack g : mFish) { - mList_Master_Meats.put(g); - } - } - if (!mFruits.isEmpty()) { - for (ItemStack g : mFruits) { - mList_Master_FruitVege.put(g); - } - } - if (!mVege.isEmpty()) { - for (ItemStack g : mVege) { - mList_Master_FruitVege.put(g); - } - } - if (!mNuts.isEmpty()) { - for (ItemStack g : mNuts) { - mList_Master_FruitVege.put(g); - } - } - if (!mSeeds.isEmpty()) { - for (ItemStack g : mSeeds) { - mList_Master_Seeds.put(g); - } - } - if (!mBoneMeal.isEmpty()) { - for (ItemStack g : mBoneMeal) { - mList_Master_Bones.put(g); - } - } - if (!mBones.isEmpty()) { - for (ItemStack g : mBones) { - mList_Master_Bones.put(g); - } - } - } - - private static void processOreDict(String aOreName, AutoMap aMap) { - ArrayList aTemp = OreDictionary.getOres(aOreName); - if (!aTemp.isEmpty()) { - for (ItemStack stack : aTemp) { - aMap.put(stack); - } - } + } - private static void addBasicSlurryRecipes() {} - - private static void addAdvancedSlurryRecipes() {} - - private static void addBasicOrganiseFertRecipes() {} - - private static void addAdvancedOrganiseFertRecipes() {} - - private static void addMiscRecipes() {} + @Override public String errorMessage() { - return "Failed to generate recipes for AgroChem."; + return "Failed to generate recipes for OilChem."; } @Override public boolean generateRecipes() { - // Organise OreDict - processAllOreDict(); - - // Slurry Production - addBasicSlurryRecipes(); - addAdvancedSlurryRecipes(); - - // Organic Fert. Production - addBasicOrganiseFertRecipes(); - addAdvancedOrganiseFertRecipes(); - - addMiscRecipes(); return true; } } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java new file mode 100644 index 0000000000..8a003ec7aa --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java @@ -0,0 +1,162 @@ +package gtPlusPlus.core.item.chemistry.general; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemGenericChemBase extends Item { + + final protected IIcon base[]; + + final private int aMetaSize = 6; + + /* + * 0 - Red Metal Catalyst //FeCu + * 1 - Yellow Metal Catalyst //WNi + * 2 - Blue Metal Catalyst //CoTi + * 3 - Orange Metal Catalyst //Vanadium Pd + * 4 - Purple Metal Catalyst //IrIdium Ruthenium + * 5 - Brown Metal Catalyst //NiAl + * + */ + + public ItemGenericChemBase() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + base = new IIcon[aMetaSize]; + this.setUnlocalizedName("BasicGenericChemItem"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + try { + + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public boolean requiresMultipleRenderPasses() { + return false; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + for (int i=0;i Date: Thu, 12 Dec 2019 19:15:04 +0000 Subject: % Moved Several recipes to the Chemical Plant. Fixes #547. % Adjusted Some Bio recipes, based on feedback from Discord. (Butanol now has 4.5x better fuel value) % Added a hard crash into the Chemical Plant recipe handler, to prevent it being handled incorrectly. $ Fixed Toluene Cell generating under wrong circumstances. --- .../gtPlusPlus/core/item/chemistry/CoalTar.java | 4 - .../core/item/chemistry/GenericChem.java | 138 ++++++++++++++++----- src/Java/gtPlusPlus/core/lib/CORE.java | 26 ++-- .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 24 ++-- .../common/blocks/GregtechMetaCasingBlocks3.java | 1 + .../common/blocks/GregtechMetaCasingBlocks4.java | 2 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 12 +- src/resources/assets/miscutils/lang/en_US.lang | 19 +++ 8 files changed, 164 insertions(+), 62 deletions(-) (limited to 'src/resources') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index 8eba9668ad..8428328f37 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -6,14 +6,12 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.AddGregtechRecipe; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -334,8 +332,6 @@ public class CoalTar extends ItemPackage { } else { Toluene = FluidUtils.getWildcardFluidStack("liquid_toluene", 1).getFluid(); - Item itemCellToluene = new BaseItemComponent("liquid_toluene", "Toluene", new short[]{140, 70, 20, 100}); - CORE.RA.addFluidCannerRecipe(ItemUtils.getEmptyCell(), ItemUtils.getSimpleStack(itemCellToluene), FluidUtils.getFluidStack(Toluene, 1000), null); } //Create Coal Tar diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index 83f49cf9b7..35d2066793 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -301,7 +301,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mRedCatalyst, 10), - 600 * 20, + 20 * 20, 30); } @@ -316,7 +316,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mYellowCatalyst, 10), - 600 * 20, + 60 * 20, 2000); } @@ -331,7 +331,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mBlueCatalyst, 10), - 600 * 20, + 40 * 20, 500); } @@ -346,7 +346,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mOrangeCatalyst, 10), - 600 * 20, + 40 * 20, 500); } @@ -361,7 +361,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mPurpleCatalyst, 10), - 600 * 20, + 120 * 20, 8000); } @@ -376,7 +376,7 @@ public class GenericChem extends ItemPackage { }, GT_Values.NF, ItemUtils.getSimpleStack(mBrownCatalyst, 10), - 600 * 20, + 15 * 20, 30); } @@ -467,37 +467,76 @@ public class GenericChem extends ItemPackage { }, new FluidStack[] { FluidUtils.getFluidStack("dilutedsulfuricacid", 3000), - FluidUtils.getFluidStack(NitroBenzene, 3000), + FluidUtils.getFluidStack(NitroBenzene, 5000), }, 20 * 30, - 1000, + 500, 3); } - static void recipe2Ethylanthraquinone() { - GT_Values.RA.addChemicalRecipe( + private void recipe2Ethylanthraquinone() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + CI.getNumberedCircuit(4), + ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4), + }, + new FluidStack[] { + FluidUtils.getFluidStack(CoalTar.Ethylbenzene, 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Ethylanthraquinone2, 2000+(144*4)), + }, + 20 * 15, + 120, + 1); + + /*GT_Values.RA.addChemicalRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4), ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2), null, FluidUtils.getFluidStack("fluid.2ethylanthraquinone", 2000+(144*4)), ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - 20*16); + 20*16);*/ } - static void recipe2Ethylanthrahydroquinone() { - GT_Values.RA.addChemicalRecipe( + private void recipe2Ethylanthrahydroquinone() { + + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + CI.getNumberedCircuit(4), + ItemUtils.getSimpleStack(mOrangeCatalyst, 1), + }, + new FluidStack[] { + FluidUtils.getFluidStack(Ethylanthraquinone2, 4000), + FluidUtils.getFluidStack("hydrogen", 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000), + }, + 20 * 40, + 120, + 1); + + /*GT_Values.RA.addChemicalRecipe( ItemUtils.getItemStackOfAmountFromOreDict("platePalladium", 0), ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthraquinone", 1), FluidUtils.getFluidStack("hydrogen", 500), FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 1200), ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), - 20*40); + 20*40);*/ } - static void recipeLithiumPeroxide() { + private void recipeLithiumPeroxide() { CORE.RA.addDehydratorRecipe( new ItemStack[]{ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 2), @@ -512,12 +551,32 @@ public class GenericChem extends ItemPackage { }, new int[]{10000, 10000, 10000}, 20*100, - 240); + 120); } - static void recipeLithiumHydroperoxide() { + private void recipeLithiumHydroperoxide() { - CORE.RA.addChemicalRecipe( + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + CI.getNumberedCircuit(4), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7), + }, + new FluidStack[] { + FluidUtils.getFluidStack("fluid.hydrogenperoxide", 2000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14), + }, + new FluidStack[] { + + }, + 20 * 30, + 240, + 1); + + + + /*CORE.RA.addChemicalRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7), ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1), 20, @@ -526,21 +585,40 @@ public class GenericChem extends ItemPackage { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14), CI.emptyCells(1), 20*30, - 240); + 240); */ } - static void recipeHydrogenPeroxide() { + private void recipeHydrogenPeroxide() { - CORE.RA.addChemicalRecipe( - GT_ModHandler.getAirCell(15), - ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5), - 20, - FluidUtils.getFluidStack("fluid.anthracene", 50), - FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2), - CI.emptyCells(18), - 20*30, - 240); + CORE.RA.addFluidReactorRecipe( + new ItemStack[] { + CI.getNumberedCircuit(4), + }, + new FluidStack[] { + FluidUtils.getFluidStack("air", 15000), + FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000), + FluidUtils.getFluidStack("fluid.anthracene", 50), + }, + new ItemStack[] { + }, + new FluidStack[] { + FluidUtils.getFluidStack(Ethylanthraquinone2, 4000), + FluidUtils.getFluidStack("fluid.hydrogenperoxide", 2000), + }, + 20 * 30, + 240, + 1); + + /* CORE.RA.addChemicalRecipe( + GT_ModHandler.getAirCell(15), + ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5), + 20, + FluidUtils.getFluidStack("fluid.anthracene", 50), + FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2), + CI.emptyCells(18), + 20*30, + 240);*/ } diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 3330ad8c3f..2a267dc16d 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -290,19 +290,19 @@ public class CORE { } public static final void crash() { - Logger.ERROR("=========================================================="); - Logger.ERROR("[GT++ CRASH]"); - Logger.ERROR("=========================================================="); - Logger.ERROR("Oooops..."); - Logger.ERROR("This should only happy in a development environment or when something really bad happens."); - Logger.ERROR("=========================================================="); - Logger.ERROR("Called from: "+ReflectionUtils.getMethodName(0)); - Logger.ERROR(ReflectionUtils.getMethodName(1)); - Logger.ERROR(ReflectionUtils.getMethodName(2)); - Logger.ERROR(ReflectionUtils.getMethodName(3)); - Logger.ERROR(ReflectionUtils.getMethodName(4)); - Logger.ERROR(ReflectionUtils.getMethodName(5)); - Logger.ERROR(ReflectionUtils.getMethodName(6)); + Logger.INFO("=========================================================="); + Logger.INFO("[GT++ CRASH]"); + Logger.INFO("=========================================================="); + Logger.INFO("Oooops..."); + Logger.INFO("This should only happy in a development environment or when something really bad happens."); + Logger.INFO("=========================================================="); + Logger.INFO("Called from: "+ReflectionUtils.getMethodName(0)); + Logger.INFO(ReflectionUtils.getMethodName(1)); + Logger.INFO(ReflectionUtils.getMethodName(2)); + Logger.INFO(ReflectionUtils.getMethodName(3)); + Logger.INFO(ReflectionUtils.getMethodName(4)); + Logger.INFO(ReflectionUtils.getMethodName(5)); + Logger.INFO(ReflectionUtils.getMethodName(6)); FMLCommonHandler.instance().exitJava(0, true); } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index 9fc7d5b64e..1179e13a2f 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -208,7 +208,7 @@ public class BioRecipes { //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1); //Combustion Fuels - GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 250, 0); + GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 1125, 0); } private static void recipeGreenAlgae() { @@ -465,14 +465,14 @@ public class BioRecipes { private static void recipeAluminiumSilverCatalyst() { // Assembly Recipe CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { - getBioChip(20), + getBioChip(4), ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10), ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4), ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4) }, GT_Values.NF, ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10), - 600 * 20, + 20 * 20, 30); } @@ -599,7 +599,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200), }, 60 * 20, - 30, + 2, 1); } @@ -621,7 +621,7 @@ public class BioRecipes { FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50), }, 60 * 20, - 30, + 2, 1); } } @@ -1248,19 +1248,19 @@ public class BioRecipes { CORE.RA.addFluidReactorRecipe( new ItemStack[] { getBioChip(12), - ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 20) + ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 20) }, new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000), + FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 500), }, new ItemStack[] { }, new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mMethane, 10), + FluidUtils.getFluidStack(BioRecipes.mMethane, 20), }, 20 * 20, - 16, + 8, 1); CORE.RA.addFluidReactorRecipe( @@ -1277,10 +1277,10 @@ public class BioRecipes { }, new FluidStack[] { - FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144/4)), + FluidUtils.getFluidStack(BioRecipes.mEthylene, 1250), }, - 120 * 20, - 240, + 60 * 20, + 60, 2); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 4c534eb7bb..8e6a55c9c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -66,6 +66,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing"); GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 321ab43134..b624649789 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -138,7 +138,7 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); case 15: default: - return TexturesGtBlock.Overlay_UU_Matter.getIcon(); + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 305c7fc0d0..631796eb1f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -8,15 +8,14 @@ import java.util.List; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.CustomRecipeMap; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gregtech.api.util.SemiFluidFuelHandler; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; @@ -1182,6 +1181,15 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) { + if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) { + Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs)); + Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aInputFluids)); + Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs)); + Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs)); + CORE.crash(); + } + + Recipe_GT aSpecialRecipe = new Recipe_GT( false, aInputs, diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index f08c7b324c..d886ce1ed0 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3091,3 +3091,22 @@ item.acetone.name=Acetone Cell item.saltwater.name=Salt Water Cell item.BasicAgrichemItem.22.name=Mold (Pellet) item.BasicAgrichemItem.23.name=Clean Aluminium Mix + +//Added 12/12/19 + +item.BasicGenericChemItem.0.name=Red Metal Catalyst +item.BasicGenericChemItem.1.name=Yellow Metal Catalyst +item.BasicGenericChemItem.2.name=Blue Metal Catalyst +item.BasicGenericChemItem.3.name=Orange Metal Catalyst +item.BasicGenericChemItem.4.name=Purple Metal Catalyst +item.BasicGenericChemItem.5.name=Brown Metal Catalyst +item.MudRedSlurry.name=Cell of Red Mud Slurry +item.liquid_toluene.name=Toluene Cell + +item.BasicAlgaeItem.0.name=Algae Spore (I) +item.BasicAlgaeItem.1.name=Algae Spore (II) +item.BasicAlgaeItem.2.name=Algae Spore (III) +item.BasicAlgaeItem.3.name=Algae Spore (IV) +item.BasicAlgaeItem.4.name=Algae Spore (V) +item.BasicAlgaeItem.5.name=Algae Spore (VI) +item.BasicAlgaeItem.6.name=Algae Spore (VII) -- cgit