From 0669f5eb9d5029a8b94ec552171b0837605f7747 Mon Sep 17 00:00:00 2001 From: draknyte1 Date: Fri, 4 Nov 2016 15:23:26 +1000 Subject: $ Cleaned up the entire project. > Much neat, very nices. --- src/Java/gtPlusPlus/core/item/ModItems.java | 719 +++++++++-------- src/Java/gtPlusPlus/core/item/base/BaseEuItem.java | 893 ++++++++++++--------- .../core/item/base/BaseItemBackpack.java | 100 +-- .../gtPlusPlus/core/item/base/BaseItemBrain.java | 104 ++- .../core/item/base/BaseItemComponent.java | 187 ++--- .../gtPlusPlus/core/item/base/BaseItemGeneric.java | 26 +- .../gtPlusPlus/core/item/base/BaseItemLoot.java | 130 ++- .../core/item/base/BaseItemWithCharge.java | 62 +- .../core/item/base/BaseItemWithDamageValue.java | 24 +- .../gtPlusPlus/core/item/base/BasicSpawnEgg.java | 413 +++++----- src/Java/gtPlusPlus/core/item/base/CoreItem.java | 119 +-- .../core/item/base/bolts/BaseItemBolt.java | 4 +- .../core/item/base/cell/BaseItemCell.java | 41 +- .../core/item/base/dusts/BaseItemDust.java | 320 ++++---- .../core/item/base/dusts/BaseItemDustAbstract.java | 35 +- .../core/item/base/dusts/BaseItemDustUnique.java | 120 +-- .../item/base/dusts/decimal/BaseItemCentidust.java | 47 +- .../item/base/dusts/decimal/BaseItemDecidust.java | 47 +- .../core/item/base/foods/BaseItemFood.java | 31 +- .../core/item/base/foods/BaseItemHotFood.java | 82 +- .../core/item/base/gears/BaseItemGear.java | 6 +- .../core/item/base/ingots/BaseItemIngot.java | 120 +-- .../core/item/base/ingots/BaseItemIngotHot.java | 61 +- .../core/item/base/itemblock/ItemBlockBase.java | 21 +- .../core/item/base/itemblock/ItemBlockFluid.java | 79 +- .../core/item/base/itemblock/ItemBlockGtBlock.java | 54 +- .../item/base/itemblock/ItemBlockGtFrameBox.java | 19 +- .../item/base/itemblock/ItemBlockTileEntity.java | 46 +- .../core/item/base/nugget/BaseItemNugget.java | 6 +- .../core/item/base/plates/BaseItemPlate.java | 15 +- .../core/item/base/plates/BaseItemPlateDouble.java | 10 +- .../core/item/base/rings/BaseItemRing.java | 4 +- .../core/item/base/rods/BaseItemRod.java | 25 +- .../core/item/base/rods/BaseItemRodLong.java | 45 +- .../core/item/base/rotors/BaseItemRotor.java | 4 +- .../core/item/base/screws/BaseItemScrew.java | 25 +- .../gtPlusPlus/core/item/effects/RarityEffect.java | 16 +- .../gtPlusPlus/core/item/effects/RarityEpic.java | 12 +- .../gtPlusPlus/core/item/effects/RarityRare.java | 12 +- .../core/item/effects/RarityUncommon.java | 10 +- .../core/item/general/BedLocator_Base.java | 102 ++- .../gtPlusPlus/core/item/general/BufferCore.java | 91 +-- .../core/item/general/ItemBlueprint.java | 377 ++++----- .../core/item/general/ItemCloakingDevice.java | 293 ++++--- .../core/item/general/ItemHealingDevice.java | 263 +++--- .../core/item/general/NuclearFuelRodBase.java | 329 ++++---- .../core/item/general/RF2EU_Battery.java | 359 ++++----- .../core/item/general/fuelrods/FuelRod_Base.java | 297 ++++--- .../item/general/fuelrods/FuelRod_Thorium.java | 4 +- src/Java/gtPlusPlus/core/item/init/ItemsFoods.java | 66 +- .../core/item/materials/MaterialHandler.java | 4 +- .../core/item/tool/misc/SandstoneHammer.java | 64 +- .../core/item/tool/staballoy/MultiPickaxeBase.java | 258 +++--- .../core/item/tool/staballoy/MultiSpadeBase.java | 128 +-- .../core/item/tool/staballoy/StaballoyAxe.java | 491 ++++++----- .../core/item/tool/staballoy/StaballoyPickaxe.java | 509 ++++++------ .../core/item/tool/staballoy/StaballoySpade.java | 466 +++++------ 57 files changed, 4265 insertions(+), 3930 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 884973572d..79b813c745 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -1,7 +1,4 @@ package gtPlusPlus.core.item; -import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines; -import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; -import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; @@ -32,323 +29,374 @@ import net.minecraft.item.*; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.EnumHelper; + public final class ModItems { - public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18); - - public static Item AAA_Broken; - - public static Item itemDebugShapeSpawner; - - public static Item itemBaseSpawnEgg; - - //EnderIO - public static Item itemPlateSoularium; - public static Item itemPlateRedstoneAlloy; - public static Item itemPlateElectricalSteel; - public static Item itemPlatePulsatingIron; - public static Item itemPlateEnergeticAlloy; - public static Item itemPlateVibrantAlloy; - public static Item itemPlateConductiveIron; - public static Item itemPlateDarkSteel; - //Big Reactors - public static Item itemPlateBlutonium; - public static Item itemPlateCyanite; - public static Item itemPlateLudicrite; - //Thaumcraft - public static Item itemPlateVoidMetal; - //Pneumaticraft - public static Item itemPlateCompressedIron; - //SimplyJetpacks - public static Item itemPlateEnrichedSoularium; - //rfTools - public static Item itemPlateDimensionShard; - //Staballoy - public static Item itemStaballoyPickaxe; - public static Item itemStaballoyAxe; - //Tools - public static Item itemSandstoneHammer; - //Machine Related - public static Item itemBufferCore0; - //Material related - public static Item itemStickyRubber; - public static Item itemIngotBatteryAlloy; - public static Item itemPlateBatteryAlloy; - public static Item itemHeliumBlob; - public static Item itemPLACEHOLDER_Circuit; - - public static Item FuelRod_Empty; - public static Item FuelRod_Thorium; - public static Item FuelRod_Uranium; - public static Item FuelRod_Plutonium; - - public static Item itemBedLocator_Base; - public static Item itemBaseItemWithCharge; - - public static Item itemIngotRaisinBread; - public static Item itemHotIngotRaisinBread; - - public static ItemFood itemFoodRaisinToast; - public static BaseItemHotFood itemHotFoodRaisinToast; - public static BaseItemFood itemFoodCurriedSausages; - public static BaseItemHotFood itemHotFoodCurriedSausages; - - public static Item RfEuBattery; - public static Item itemPersonalCloakingDevice; - public static Item itemPersonalCloakingDeviceCharged; - public static Item itemPersonalHealingDevice; - - public static MultiPickaxeBase MP_GTMATERIAL; - public static MultiSpadeBase MS_GTMATERIAL; - - public static BaseItemDecidust itemBaseDecidust; - public static BaseItemCentidust itemBaseCentidust; - - public static ItemStack FluidCell; - - public static BaseItemBackpack backpack_Red; - public static BaseItemBackpack backpack_Green; - public static BaseItemBackpack backpack_Blue; - public static BaseItemBackpack backpack_Yellow; - public static BaseItemBackpack backpack_Purple; - public static BaseItemBackpack backpack_Cyan; - public static BaseItemBackpack backpack_Maroon; - public static BaseItemBackpack backpack_Olive; - public static BaseItemBackpack backpack_DarkGreen; - public static BaseItemBackpack backpack_DarkPurple; - public static BaseItemBackpack backpack_Teal; - public static BaseItemBackpack backpack_Navy; - public static BaseItemBackpack backpack_Silver; - public static BaseItemBackpack backpack_Gray; - public static BaseItemBackpack backpack_Black; - public static BaseItemBackpack backpack_White; - - public static ItemBlueprint itemBlueprintBase; - - public static Item dustLithiumCarbonate; - public static Item dustLithiumHydroxide; - public static Item dustLithiumPeroxide; - public static Item dustLithiumFluoride; - - public static Item dustUraniumTetraFluoride; - public static Item dustUraniumHexaFluoride; - - public static Item dustBerylliumFluoride; - - public static Item dustQuicklime; - public static Item dustCalciumHydroxide; - public static Item dustCalciumCarbonate; - public static Item dust2LiOH_CaCO3; - public static Item dustLi2BeF4; - - public static BaseEuItem metaItem2; - - - //@SuppressWarnings("unused") + public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18); + + public static Item AAA_Broken; + + public static Item itemDebugShapeSpawner; + + public static Item itemBaseSpawnEgg; + + // EnderIO + public static Item itemPlateSoularium; + public static Item itemPlateRedstoneAlloy; + public static Item itemPlateElectricalSteel; + public static Item itemPlatePulsatingIron; + public static Item itemPlateEnergeticAlloy; + public static Item itemPlateVibrantAlloy; + public static Item itemPlateConductiveIron; + public static Item itemPlateDarkSteel; + // Big Reactors + public static Item itemPlateBlutonium; + public static Item itemPlateCyanite; + public static Item itemPlateLudicrite; + // Thaumcraft + public static Item itemPlateVoidMetal; + // Pneumaticraft + public static Item itemPlateCompressedIron; + // SimplyJetpacks + public static Item itemPlateEnrichedSoularium; + // rfTools + public static Item itemPlateDimensionShard; + // Staballoy + public static Item itemStaballoyPickaxe; + public static Item itemStaballoyAxe; + // Tools + public static Item itemSandstoneHammer; + // Machine Related + public static Item itemBufferCore0; + // Material related + public static Item itemStickyRubber; + public static Item itemIngotBatteryAlloy; + public static Item itemPlateBatteryAlloy; + public static Item itemHeliumBlob; + public static Item itemPLACEHOLDER_Circuit; + + public static Item FuelRod_Empty; + public static Item FuelRod_Thorium; + public static Item FuelRod_Uranium; + public static Item FuelRod_Plutonium; + + public static Item itemBedLocator_Base; + public static Item itemBaseItemWithCharge; + + public static Item itemIngotRaisinBread; + public static Item itemHotIngotRaisinBread; + + public static ItemFood itemFoodRaisinToast; + public static BaseItemHotFood itemHotFoodRaisinToast; + public static BaseItemFood itemFoodCurriedSausages; + public static BaseItemHotFood itemHotFoodCurriedSausages; + + public static Item RfEuBattery; + public static Item itemPersonalCloakingDevice; + public static Item itemPersonalCloakingDeviceCharged; + public static Item itemPersonalHealingDevice; + + public static MultiPickaxeBase MP_GTMATERIAL; + public static MultiSpadeBase MS_GTMATERIAL; + + public static BaseItemDecidust itemBaseDecidust; + public static BaseItemCentidust itemBaseCentidust; + + public static ItemStack FluidCell; + + public static BaseItemBackpack backpack_Red; + public static BaseItemBackpack backpack_Green; + public static BaseItemBackpack backpack_Blue; + public static BaseItemBackpack backpack_Yellow; + public static BaseItemBackpack backpack_Purple; + public static BaseItemBackpack backpack_Cyan; + public static BaseItemBackpack backpack_Maroon; + public static BaseItemBackpack backpack_Olive; + public static BaseItemBackpack backpack_DarkGreen; + public static BaseItemBackpack backpack_DarkPurple; + public static BaseItemBackpack backpack_Teal; + public static BaseItemBackpack backpack_Navy; + public static BaseItemBackpack backpack_Silver; + public static BaseItemBackpack backpack_Gray; + public static BaseItemBackpack backpack_Black; + public static BaseItemBackpack backpack_White; + + public static ItemBlueprint itemBlueprintBase; + + public static Item dustLithiumCarbonate; + public static Item dustLithiumHydroxide; + public static Item dustLithiumPeroxide; + public static Item dustLithiumFluoride; + + public static Item dustUraniumTetraFluoride; + public static Item dustUraniumHexaFluoride; + + public static Item dustBerylliumFluoride; + + public static Item dustQuicklime; + public static Item dustCalciumHydroxide; + public static Item dustCalciumCarbonate; + public static Item dust2LiOH_CaCO3; + public static Item dustLi2BeF4; + + public static BaseEuItem metaItem2; + + // @SuppressWarnings("unused") @SuppressWarnings("unused") - public static final void init(){ + public static final void init() { - AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0); + ModItems.AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", + Utils.rgbtoHexValue(128, 128, 128), 0); - //Debug Loading - if (CORE.DEBUG){ + // Debug Loading + if (CORE.DEBUG) { DEBUG_INIT.registerItems(); - } - - - //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.getItemStack(CORE.MODID+":itemStickyRubber", 1)); - - itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob"); + } + + // Some Simple forms of materials + ModItems.itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber") + .setCreativeTab(AddToCreativeTab.tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber"); + GameRegistry.registerItem(ModItems.itemStickyRubber, "itemStickyRubber"); + GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID + ":itemStickyRubber", 1)); + + ModItems.itemHeliumBlob = new CoreItem("itemHeliumBlob", AddToCreativeTab.tabMisc) + .setTextureName(CORE.MODID + ":itemHeliumBlob"); GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHeliumBlob)); - //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob"); - - //Make some backpacks - //Primary colours - backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0)); - backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0)); - backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200)); - //Secondary Colours - backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0)); - backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200)); - backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200)); - //Tertiary Colours - backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0)); - backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0)); - backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0)); - backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128)); - backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128)); - backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128)); - //Shades - backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192)); - backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128)); - backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20)); - backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240)); - - itemBlueprintBase = new ItemBlueprint("itemBlueprint"); - - //Start meta Item Generation + // GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob"); + + // Make some backpacks + // Primary colours + ModItems.backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0)); + ModItems.backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0)); + ModItems.backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200)); + // Secondary Colours + ModItems.backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0)); + ModItems.backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200)); + ModItems.backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200)); + // Tertiary Colours + ModItems.backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0)); + ModItems.backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0)); + ModItems.backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0)); + ModItems.backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128)); + ModItems.backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128)); + ModItems.backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128)); + // Shades + ModItems.backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192)); + ModItems.backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128)); + ModItems.backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20)); + ModItems.backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240)); + + ModItems.itemBlueprintBase = new ItemBlueprint("itemBlueprint"); + + // Start meta Item Generation ItemsFoods.load(); - try{ - //Elements generate first so they can be used in compounds. - - //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. - MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233); - MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM); - - //Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though - if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + try { + // Elements generate first so they can be used in compounds. + + // Uranium-233 is a fissile isotope of uranium that is bred from + // thorium-232 as part of the thorium fuel cycle. + MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233); + MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM); + + // Carbides - Tungsten Carbide exists in .09 so don't generate it. - + // Should still come before alloys though + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { MaterialGenerator.generate(ALLOY.TUNGSTEN_CARBIDE); } MaterialGenerator.generate(ALLOY.SILICON_CARBIDE); MaterialGenerator.generate(ALLOY.ZIRCONIUM_CARBIDE); MaterialGenerator.generate(ALLOY.TANTALUM_CARBIDE); - MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE); - - //Generate some Alloys - - //Misc Alloys + MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE); + + // Generate some Alloys + + // Misc Alloys MaterialGenerator.generate(ALLOY.ENERGYCRYSTAL); MaterialGenerator.generate(ALLOY.BLOODSTEEL); MaterialGenerator.generate(ALLOY.BEDROCKIUM); MaterialGenerator.generate(ALLOY.ZERON_100); - //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper + // Tumbaga was the name given by Spaniards to a non-specific alloy + // of gold and copper MaterialGenerator.generate(ALLOY.TUMBAGA); - //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible + // Potin is traditionally an alloy of bronze, tin and lead, with + // varying quantities of each possible MaterialGenerator.generate(ALLOY.POTIN); - - //Staballoy & Tantalloy + + // Staballoy & Tantalloy MaterialGenerator.generate(ALLOY.STABALLOY); MaterialGenerator.generate(ALLOY.TANTALLOY_60); MaterialGenerator.generate(ALLOY.TANTALLOY_61); - //Inconel + // Inconel MaterialGenerator.generate(ALLOY.INCONEL_625); MaterialGenerator.generate(ALLOY.INCONEL_690); MaterialGenerator.generate(ALLOY.INCONEL_792); - - //Maraging Steel + // Maraging Steel MaterialGenerator.generate(ALLOY.MARAGING250); MaterialGenerator.generate(ALLOY.MARAGING300); MaterialGenerator.generate(ALLOY.MARAGING350); - - //Composite Alloys + + // Composite Alloys MaterialGenerator.generate(ALLOY.STELLITE); - MaterialGenerator.generate(ALLOY.TALONITE); + MaterialGenerator.generate(ALLOY.TALONITE); - //Hastelloy + // Hastelloy MaterialGenerator.generate(ALLOY.HASTELLOY_W); MaterialGenerator.generate(ALLOY.HASTELLOY_X); MaterialGenerator.generate(ALLOY.HASTELLOY_C276); MaterialGenerator.generate(ALLOY.HASTELLOY_N); - //Incoloy + // Incoloy MaterialGenerator.generate(ALLOY.INCOLOY_020); MaterialGenerator.generate(ALLOY.INCOLOY_DS); MaterialGenerator.generate(ALLOY.INCOLOY_MA956); - - //Leagrisium - MaterialGenerator.generate(ALLOY.LEAGRISIUM); - //Must be the final Alloy to Generate - MaterialGenerator.generate(ALLOY.QUANTUM); - - - } catch (Throwable r){ - Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage()); - //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage()); - Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName()); - Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName()); + + // Leagrisium + MaterialGenerator.generate(ALLOY.LEAGRISIUM); + // Must be the final Alloy to Generate + MaterialGenerator.generate(ALLOY.QUANTUM); + + } + catch (final Throwable r) { + Utils.LOG_INFO("Failed to Generated a Material. " + r.getMessage()); + // Utils.LOG_INFO("Failed to Generated a Material. + // "+r.getCause().getMessage()); + Utils.LOG_INFO("Failed to Generated a Material. " + r.getStackTrace()[0].getMethodName()); + Utils.LOG_INFO("Failed to Generated a Material. " + r.getStackTrace()[1].getMethodName()); r.printStackTrace(); System.exit(1); } - - - //Nuclear Fuel Dusts - dustUraniumTetraFluoride = ItemUtils.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; - dustUraniumHexaFluoride = ItemUtils.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; - - dustBerylliumFluoride = ItemUtils.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", Utils.rgbtoHexValue(175, 175, 175))[0]; //https://en.wikipedia.org/wiki/Beryllium_fluoride - - dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate - dustLithiumFluoride = ItemUtils.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; //https://en.wikipedia.org/wiki/Lithium_fluoride - dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide - dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide - - if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken || !LoadedMods.IHL){ - dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide + // Nuclear Fuel Dusts + ModItems.dustUraniumTetraFluoride = ItemUtils.generateSpecialUseDusts("UraniumTetrafluoride", + "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; + ModItems.dustUraniumHexaFluoride = ItemUtils.generateSpecialUseDusts("UraniumHexafluoride", + "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; + + ModItems.dustBerylliumFluoride = ItemUtils.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", + Utils.rgbtoHexValue(175, 175, 175))[0]; // https://en.wikipedia.org/wiki/Beryllium_fluoride + + ModItems.dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", + Utils.rgbtoHexValue(240, 240, 240))[0]; // https://en.wikipedia.org/wiki/Lithium_carbonate + ModItems.dustLithiumFluoride = ItemUtils.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", + Utils.rgbtoHexValue(245, 245, 245))[0]; // https://en.wikipedia.org/wiki/Lithium_fluoride + ModItems.dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", + Utils.rgbtoHexValue(250, 250, 250))[0]; // https://en.wikipedia.org/wiki/Lithium_peroxide + ModItems.dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", + Utils.rgbtoHexValue(250, 250, 250))[0]; // https://en.wikipedia.org/wiki/Lithium_hydroxide + + if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken + || !LoadedMods.IHL) { + ModItems.dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime", + Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_oxide } - dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide - dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate - dust2LiOH_CaCO3 = ItemUtils.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate - - //FLiBe Fuel Compounds - dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe - - metaItem2 = new BaseEuItem(); - metaItem2.registerItem(0, EnumChatFormatting.BLACK+"Test Item 0", 0, 0, "I am 0."); - metaItem2.registerItem(1, EnumChatFormatting.GREEN+"Test Item 1", 1006346000, 1, "I Hold EU 1.", 500); - metaItem2.registerItem(2, EnumChatFormatting.GOLD+"Test Item 2", 1004630000, 2, "I Hold EU 2.", 8000); - metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000); - metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare, EnumChatFormatting.DARK_GREEN, true); - metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.", EnumRarity.uncommon, EnumChatFormatting.RED, true); - + ModItems.dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", + Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_hydroxide + ModItems.dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", + Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_carbonate + ModItems.dust2LiOH_CaCO3 = ItemUtils.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", + Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_carbonate + + // FLiBe Fuel Compounds + ModItems.dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", + Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/FLiBe + + ModItems.metaItem2 = new BaseEuItem(); + ModItems.metaItem2.registerItem(0, EnumChatFormatting.BLACK + "Test Item 0", 0, 0, "I am 0."); + ModItems.metaItem2.registerItem(1, EnumChatFormatting.GREEN + "Test Item 1", 1006346000, 1, "I Hold EU 1.", + 500); + ModItems.metaItem2.registerItem(2, EnumChatFormatting.GOLD + "Test Item 2", 1004630000, 2, "I Hold EU 2.", + 8000); + ModItems.metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000); + ModItems.metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare, + EnumChatFormatting.DARK_GREEN, true); + ModItems.metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.", + EnumRarity.uncommon, EnumChatFormatting.RED, true); + // ItemList.Battery_RE_HV_Cadmium.set(BaseEuItem. - //GameRegistry.registerItem(this, unlocalName); - - boolean gtStyleTools = LoadedMods.Gregtech; + // GameRegistry.registerItem(this, unlocalName); + + final boolean gtStyleTools = LoadedMods.Gregtech; - Materials[] rm = Materials.values(); - for (Materials m : rm){ - MP_GTMATERIAL = ItemUtils.generateMultiPick(gtStyleTools, m); - MS_GTMATERIAL = ItemUtils.generateMultiShovel(gtStyleTools, m); - /*itemBaseDecidust = UtilsItems.generateDecidust(m); - itemBaseCentidust = UtilsItems.generateCentidust(m);*/ + final Materials[] rm = Materials.values(); + for (final Materials m : rm) { + ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(gtStyleTools, m); + ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(gtStyleTools, m); + /* + * itemBaseDecidust = UtilsItems.generateDecidust(m); + * itemBaseCentidust = UtilsItems.generateCentidust(m); + */ } - //EnderIO Resources - if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){ + // EnderIO Resources + if (LoadedMods.EnderIO || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("EnderIO Found - Loading Resources."); - //Item Init - itemPlateSoularium = new BaseItemPlate("itemPlate"+"Soularium", "Soularium", new short[]{95, 90, 54}, 2, 0); - itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate"+"RedstoneAlloy", "Redstone Alloy", new short[]{178,34,34}, 2, 0); - itemPlateElectricalSteel =new BaseItemPlate("itemPlate"+"ElectricalSteel", "Electrical Steel", new short[]{194, 194, 194}, 2, 0); - itemPlatePulsatingIron = new BaseItemPlate("itemPlate"+"PhasedIron", "Phased Iron", new short[]{50, 91, 21}, 2, 0); - itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate"+"EnergeticAlloy", "Energetic Alloy", new short[]{252, 152, 45}, 2, 0); - itemPlateVibrantAlloy = new BaseItemPlate("itemPlate"+"VibrantAlloy", "Vibrant Alloy", new short[]{204, 242, 142}, 2, 0); - itemPlateConductiveIron = new BaseItemPlate("itemPlate"+"ConductiveIron", "Conductive Iron", new short[]{164, 109, 100}, 2, 0); + // Item Init + ModItems.itemPlateSoularium = new BaseItemPlate("itemPlate" + "Soularium", "Soularium", new short[] { + 95, 90, 54 + }, 2, 0); + ModItems.itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate" + "RedstoneAlloy", "Redstone Alloy", + new short[] { + 178, 34, 34 + }, 2, 0); + ModItems.itemPlateElectricalSteel = new BaseItemPlate("itemPlate" + "ElectricalSteel", "Electrical Steel", + new short[] { + 194, 194, 194 + }, 2, 0); + ModItems.itemPlatePulsatingIron = new BaseItemPlate("itemPlate" + "PhasedIron", "Phased Iron", new short[] { + 50, 91, 21 + }, 2, 0); + ModItems.itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate" + "EnergeticAlloy", "Energetic Alloy", + new short[] { + 252, 152, 45 + }, 2, 0); + ModItems.itemPlateVibrantAlloy = new BaseItemPlate("itemPlate" + "VibrantAlloy", "Vibrant Alloy", + new short[] { + 204, 242, 142 + }, 2, 0); + ModItems.itemPlateConductiveIron = new BaseItemPlate("itemPlate" + "ConductiveIron", "Conductive Iron", + new short[] { + 164, 109, 100 + }, 2, 0); } else { Utils.LOG_WARNING("EnderIO not Found - Skipping Resources."); } - //Big Reactors - if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){ + // Big Reactors + if (LoadedMods.Big_Reactors || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("BigReactors Found - Loading Resources."); - //Item Init - itemPlateBlutonium = new BaseItemPlate("itemPlate"+"Blutonium", "Blutonium", new short[]{0, 0, 255}, 2, 0); - itemPlateCyanite = new BaseItemPlate("itemPlate"+"Cyanite", "Cyanite", new short[]{0, 191, 255}, 2, 0); - itemPlateLudicrite = new BaseItemPlate("itemPlate"+"Ludicrite", "Ludicrite", new short[]{167, 5, 179}, 2, 0); + // Item Init + ModItems.itemPlateBlutonium = new BaseItemPlate("itemPlate" + "Blutonium", "Blutonium", new short[] { + 0, 0, 255 + }, 2, 0); + ModItems.itemPlateCyanite = new BaseItemPlate("itemPlate" + "Cyanite", "Cyanite", new short[] { + 0, 191, 255 + }, 2, 0); + ModItems.itemPlateLudicrite = new BaseItemPlate("itemPlate" + "Ludicrite", "Ludicrite", new short[] { + 167, 5, 179 + }, 2, 0); } else { Utils.LOG_WARNING("BigReactors not Found - Skipping Resources."); } - //Thaumcraft - if (LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT){ + // Thaumcraft + if (LoadedMods.Thaumcraft || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("Thaumcraft Found - Loading Resources."); - //Item Init + // Item Init try { - ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); - itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void", new short[]{82, 17, 82}, 2, 0); + ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); + ModItems.itemPlateVoidMetal = new BaseItemPlate("itemPlate" + "Void", "Void", new short[] { + 82, 17, 82 + }, 2, 0); GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal)); - } catch (NullPointerException e){ + } + catch (final NullPointerException e) { e.getClass(); } @@ -356,123 +404,146 @@ public final class ModItems { else { Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources."); } - //ExtraUtils - if (LoadedMods.Extra_Utils|| LOAD_ALL_CONTENT){ + // ExtraUtils + if (LoadedMods.Extra_Utils || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("ExtraUtilities Found - Loading Resources."); - //Item Init + // Item Init try { - //itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateBedrockium"); - } catch (NullPointerException e){ + // itemPlateBedrockium = new + // Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + // + ":itemPlateBedrockium"); + } + catch (final NullPointerException e) { e.getClass(); } - //Registry - //GameRegistry.registerItem(itemPlateBedrockium, "itemPlateBedrockium"); + // Registry + // GameRegistry.registerItem(itemPlateBedrockium, + // "itemPlateBedrockium"); } else { Utils.LOG_WARNING("ExtraUtilities not Found - Skipping Resources."); } - //Pneumaticraft - if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){ + // Pneumaticraft + if (LoadedMods.PneumaticCraft || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("PneumaticCraft Found - Loading Resources."); - //Item Init - itemPlateCompressedIron = new BaseItemPlate("itemPlate"+"CompressedIron", "Compressed Iron", new short[]{128, 128, 128}, 2, 0); + // Item Init + ModItems.itemPlateCompressedIron = new BaseItemPlate("itemPlate" + "CompressedIron", "Compressed Iron", + new short[] { + 128, 128, 128 + }, 2, 0); } else { Utils.LOG_WARNING("PneumaticCraft not Found - Skipping Resources."); } - //Simply Jetpacks - if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){ + // Simply Jetpacks + if (LoadedMods.Simply_Jetpacks || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources."); - //Item Init - itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium"); - //Registry - GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium"); + // Item Init + ModItems.itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium") + .setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium"); + // Registry + GameRegistry.registerItem(ModItems.itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium"); } else { Utils.LOG_WARNING("SimplyJetpacks not Found - Skipping Resources."); } - //rfTools - if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){ + // rfTools + if (LoadedMods.RFTools || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("rfTools Found - Loading Resources."); - //Item Init - itemPlateDimensionShard = new BaseItemPlate("itemPlate"+"DimensionShard", "Dimensional Shard", new short[]{170, 230, 230}, 2, 0); + // Item Init + ModItems.itemPlateDimensionShard = new BaseItemPlate("itemPlate" + "DimensionShard", "Dimensional Shard", + new short[] { + 170, 230, 230 + }, 2, 0); } else { Utils.LOG_WARNING("rfTools not Found - Skipping Resources."); } - //IC2 Exp - if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){ + // IC2 Exp + if (LoadedMods.IndustrialCraft2 || CORE.LOAD_ALL_CONTENT) { Utils.LOG_INFO("IndustrialCraft2 Found - Loading Resources."); - //Item Init - FuelRod_Empty = new FuelRod_Base("itemFuelRod_Empty", "Empty", 0, 1000); - FuelRod_Thorium = new FuelRod_Base("itemFuelRod_Thorium", "Thorium", 1000, 1000); - FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500); - FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000); - RfEuBattery = new RF2EU_Battery(); - - try {Class baublesTest = Class.forName("baubles.api.IBauble"); - if (baublesTest != null){ - COMPAT_Baubles.run(); - } - else { - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + // Item Init + ModItems.FuelRod_Empty = new FuelRod_Base("itemFuelRod_Empty", "Empty", 0, 1000); + ModItems.FuelRod_Thorium = new FuelRod_Base("itemFuelRod_Thorium", "Thorium", 1000, 1000); + ModItems.FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500); + ModItems.FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000); + ModItems.RfEuBattery = new RF2EU_Battery(); + + try { + final Class baublesTest = Class.forName("baubles.api.IBauble"); + if (baublesTest != null) { + COMPAT_Baubles.run(); + } + else { + Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + } } - } catch(Throwable T){ - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + catch (final Throwable T) { + Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); } - //Registry - //GameRegistry.registerItem(FuelRod_Empty, "itemFuelRod_Empty"); - //GameRegistry.registerItem(FuelRod_Thorium, "itemFuelRod_Thorium"); - //GameRegistry.registerItem(FuelRod_Uranium, "itemFuelRod_Uranium"); - //GameRegistry.registerItem(FuelRod_Plutonium, "itemFuelRod_Plutonium"); - - //FluidCell = new ItemStack(new IC2_ItemFluidCell("itemGT++FluidCell")); - + // Registry + // GameRegistry.registerItem(FuelRod_Empty, "itemFuelRod_Empty"); + // GameRegistry.registerItem(FuelRod_Thorium, + // "itemFuelRod_Thorium"); + // GameRegistry.registerItem(FuelRod_Uranium, + // "itemFuelRod_Uranium"); + // GameRegistry.registerItem(FuelRod_Plutonium, + // "itemFuelRod_Plutonium"); + + // FluidCell = new ItemStack(new + // IC2_ItemFluidCell("itemGT++FluidCell")); } else { Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources."); } - - //Special Item Handling Case + // Special Item Handling Case if (configSwitches.enableAlternativeBatteryAlloy) { - //ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); TODO - ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 2, 0); + // ModItems.itemIngotBatteryAlloy = new + // BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new + // short[]{35, 228, 141}, 0); TODO + ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", new short[] { + 35, 228, 141 + }, 2, 0); } - - //UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), Utils.generateSingularRandomHexValue()); - - + // UtilsItems.generateSpawnEgg("ic2", "boatcarbon", + // Utils.generateSingularRandomHexValue(), + // Utils.generateSingularRandomHexValue()); /* * Misc Items */ - //Staballoy Equipment - itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName()); - itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName()); + // Staballoy Equipment + ModItems.itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", ModItems.STABALLOY) + .setCreativeTab(AddToCreativeTab.tabTools); + GameRegistry.registerItem(ModItems.itemStaballoyPickaxe, ModItems.itemStaballoyPickaxe.getUnlocalizedName()); + ModItems.itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", ModItems.STABALLOY) + .setCreativeTab(AddToCreativeTab.tabTools); + GameRegistry.registerItem(ModItems.itemStaballoyAxe, ModItems.itemStaballoyAxe.getUnlocalizedName()); - //Sandstone Hammer - itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName()); + // Sandstone Hammer + ModItems.itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer") + .setCreativeTab(AddToCreativeTab.tabTools); + GameRegistry.registerItem(ModItems.itemSandstoneHammer, ModItems.itemSandstoneHammer.getUnlocalizedName()); - //Buffer Cores! + // Buffer Cores! Item itemBufferCore; - for(int i=1; i<=10; i++){ - //Utils.LOG_INFO(""+i); + for (int i = 1; i <= 10; i++) { + // Utils.LOG_INFO(""+i); itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName()+i); - //System.out.println("Buffer Core registration count is: "+i); + GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName() + i); + // System.out.println("Buffer Core registration count is: "+i); } - itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); - GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit"); + ModItems.itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit") + .setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); + GameRegistry.registerItem(ModItems.itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit"); - //ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1); - //GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1"); + // ItemBlockGtFrameBox = new + // ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1); + // GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1"); } } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java b/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java index e9e2317044..e92e69f0e0 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java @@ -1,8 +1,5 @@ package gtPlusPlus.core.item.base; -import static gregtech.api.enums.GT_Values.D1; -import static gregtech.api.enums.GT_Values.V; - import java.util.*; import cpw.mods.fml.common.registry.GameRegistry; @@ -33,474 +30,602 @@ import net.minecraft.util.IIcon; public class BaseEuItem extends Item implements ISpecialElectricItem, IElectricItemManager { /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ - private final HashMap>> mItemBehaviors = new HashMap>>(); - public final short mOffset, mItemAmount; - public final BitSet mEnabledItems; - public final BitSet mVisibleItems; - public final IIcon[][] mIconList; - /** The unlocalized name of this item. */ - private String unlocalizedName; - - private ArrayList> rarity = new ArrayList>(); - private ArrayList> descColour = new ArrayList>(); - private ArrayList> itemName = new ArrayList>(); - private ArrayList> itemDescription = new ArrayList>(); - private ArrayList> hasEffect = new ArrayList>(); - - public final HashMap mElectricStats = new HashMap(); - public final HashMap mBurnValues = new HashMap(); + private final HashMap>> mItemBehaviors = new HashMap>>(); + public final short mOffset, mItemAmount; + public final BitSet mEnabledItems; + public final BitSet mVisibleItems; + public final IIcon[][] mIconList; + /** The unlocalized name of this item. */ + private String unlocalizedName; + + private final ArrayList> rarity = new ArrayList>(); + private final ArrayList> descColour = new ArrayList>(); + private final ArrayList> itemName = new ArrayList>(); + private final ArrayList> itemDescription = new ArrayList>(); + private final ArrayList> hasEffect = new ArrayList>(); + + public final HashMap mElectricStats = new HashMap(); + public final HashMap mBurnValues = new HashMap(); public BaseEuItem() { - this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766); - } - - public BaseEuItem(String unlocalizedName, CreativeTabs creativeTab, short aOffset, short aItemAmount) { - mEnabledItems = new BitSet(aItemAmount); - mVisibleItems = new BitSet(aItemAmount); - mOffset = (short) Math.min(32766, aOffset); - mItemAmount = (short) Math.min(aItemAmount, 32766 - mOffset); - mIconList = new IIcon[aItemAmount][1]; - setHasSubtypes(true); - setMaxDamage(0); - setUnlocalizedName(unlocalizedName); - setCreativeTab(creativeTab); - setMaxStackSize(1); - GameRegistry.registerItem(this, unlocalizedName); - } - - - public void registerItem(int id, String localizedName, long euStorage, int tier, String description) { - registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false); - } - - public void registerItem(int id, String localizedName, long euStorage, int tier, String description, int burnTime) { - registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false); - setBurnValue(id, burnTime); - } - - - public void registerItem(int id, String localizedName, long euStorage, short tier, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect) { - addItem(id, localizedName, EnumChatFormatting.YELLOW+"Electric", new Object[]{}); - setElectricStats(mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true); - this.rarity.add(new Pair(id, regRarity)); - this.itemName.add(new Pair(id, localizedName)); - this.itemDescription.add(new Pair(id, description)); - this.descColour.add(new Pair(id, colour)); - this.hasEffect.add(new Pair(id, Effect)); - } + this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766); + } - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(ItemStack par1ItemStack){ - if (rarity.get(par1ItemStack.getItemDamage()-mOffset) != null) - return rarity.get(par1ItemStack.getItemDamage()-mOffset).getValue(); - return EnumRarity.common; + public BaseEuItem(final String unlocalizedName, final CreativeTabs creativeTab, final short aOffset, + final short aItemAmount) { + this.mEnabledItems = new BitSet(aItemAmount); + this.mVisibleItems = new BitSet(aItemAmount); + this.mOffset = (short) Math.min(32766, aOffset); + this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset); + this.mIconList = new IIcon[aItemAmount][1]; + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(creativeTab); + this.setMaxStackSize(1); + GameRegistry.registerItem(this, unlocalizedName); } + @SuppressWarnings({ + "unchecked", "rawtypes" + }) @Override - public boolean hasEffect(ItemStack par1ItemStack){ - if (hasEffect.get(par1ItemStack.getItemDamage()-mOffset) != null) - return hasEffect.get(par1ItemStack.getItemDamage()-mOffset).getValue(); - return false; + public final void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, + final boolean aF3_H) { + // aList.add("Meta: "+(aStack.getItemDamage()-mOffset)); + if (this.descColour.get(aStack.getItemDamage() - this.mOffset) != null + && this.itemDescription.get(aStack.getItemDamage() - this.mOffset) != null) { + aList.add(this.descColour.get(aStack.getItemDamage() - this.mOffset).getValue() + + this.itemDescription.get(aStack.getItemDamage() - this.mOffset).getValue()); + } + final String tKey = this.getUnlocalizedName(aStack) + ".tooltip", + tString = GT_LanguageManager.getTranslation(tKey); + if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) { + aList.add(tString); + } + final Long[] tStats = this.getElectricStats(aStack); + if (tStats != null) { + if (tStats[3] > 0) { + aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY); + } + else { + final long tCharge = this.getRealCharge(aStack); + if (tStats[3] == -2 && tCharge <= 0) { + aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + + EnumChatFormatting.GRAY); + } + else { + aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + + GT_Values.V[(int) (tStats[2] >= 0 + ? tStats[2] < GT_Values.V.length ? tStats[2] : GT_Values.V.length - 1 : 1)] + + EnumChatFormatting.GRAY); + } + } + } + final ArrayList> tList = this.mItemBehaviors.get((short) this.getDamage(aStack)); + if (tList != null) { + for (final IItemBehaviour tBehavior : tList) { + aList = tBehavior.getAdditionalToolTips(this, aList, aStack); + } + } } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - //aList.add("Meta: "+(aStack.getItemDamage()-mOffset)); - if (descColour.get(aStack.getItemDamage()-mOffset) != null && itemDescription.get(aStack.getItemDamage()-mOffset) != null) - aList.add(descColour.get(aStack.getItemDamage()-mOffset).getValue()+itemDescription.get(aStack.getItemDamage()-mOffset).getValue()); - String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey); - if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); - Long[] tStats = getElectricStats(aStack); - if (tStats != null) { - if (tStats[3] > 0) { - aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY); - } else { - long tCharge = getRealCharge(aStack); - if (tStats[3] == -2 && tCharge <= 0) { - aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY); - } else { - aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY); - } - } - } - ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour tBehavior : tList) - aList = tBehavior.getAdditionalToolTips(this, aList, aStack); - } - - - @Override - public final Item getChargedItem(ItemStack itemStack) { - return this; + /** + * This adds a Custom Item to the ending Range. + * + * @param aID + * The Id of the assigned Item [0 - mItemAmount] (The MetaData + * gets auto-shifted by +mOffset) + * @param aEnglish + * The Default Localized Name of the created Item + * @param aToolTip + * The Default ToolTip of the created Item, you can also insert + * null for having no ToolTip + * @param aFoodBehavior + * The Food Value of this Item. Can be null aswell. Just a + * convenience thing. + * @param aRandomData + * The OreDict Names you want to give the Item. Also used for TC + * Aspects and some other things. + * @return An ItemStack containing the newly created Item. + */ + @SuppressWarnings("unchecked") + public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) { + if (aToolTip == null) { + aToolTip = ""; + } + if (aID >= 0 && aID < this.mItemAmount) { + final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID); + this.mEnabledItems.set(aID); + this.mVisibleItems.set(aID); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); + final List tAspects = new ArrayList(); + // Important Stuff to do first + for (final Object tRandomData : aRandomData) { + if (tRandomData instanceof SubTag) { + if (tRandomData == SubTag.INVISIBLE) { + this.mVisibleItems.set(aID, false); + continue; + } + if (tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); + continue; + } + } + } + // now check for the rest + for (final Object tRandomData : aRandomData) { + if (tRandomData != null) { + boolean tUseOreDict = true; + if (tRandomData instanceof IItemBehaviour) { + this.addItemBehavior(this.mOffset + aID, (IItemBehaviour) tRandomData); + tUseOreDict = false; + } + if (tRandomData instanceof IItemContainer) { + ((IItemContainer) tRandomData).set(rStack); + tUseOreDict = false; + } + if (tRandomData instanceof SubTag) { + continue; + } + if (tRandomData instanceof TC_AspectStack) { + ((TC_AspectStack) tRandomData).addToAspectList(tAspects); + continue; + } + if (tRandomData instanceof ItemData) { + if (GT_Utility.isStringValid(tRandomData)) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); + } + else { + GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData); + } + continue; + } + if (tUseOreDict) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); + continue; + } + } + } + if (GregTech_API.sThaumcraftCompat != null) { + GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + } + return rStack; + } + return null; } - @Override - public final Item getEmptyItem(ItemStack itemStack) { + /** + * Adds a special Item Behaviour to the Item. + *

+ * Note: the boolean Behaviours sometimes won't be executed if another + * boolean Behaviour returned true before. + * + * @param aMetaValue + * the Meta Value of the Item you want to add it to. [0 - 32765] + * @param aBehavior + * the Click Behavior you want to add. + * @return the Item itself for convenience in constructing. + */ + public final BaseEuItem addItemBehavior(final int aMetaValue, final IItemBehaviour aBehavior) { + if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) { + return this; + } + ArrayList> tList = this.mItemBehaviors.get((short) aMetaValue); + if (tList == null) { + tList = new ArrayList>(1); + this.mItemBehaviors.put((short) aMetaValue, tList); + } + tList.add(aBehavior); return this; } @Override - public final double getMaxCharge(ItemStack aStack) { - Long[] tStats = getElectricStats(aStack); - if (tStats == null) return 0; - return Math.abs(tStats[0]); + public final boolean canProvideEnergy(final ItemStack aStack) { + final Long[] tStats = this.getElectricStats(aStack); + if (tStats == null) { + return false; + } + return tStats[3] > 0 || aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3); } @Override - public final double getTransferLimit(ItemStack aStack) { - Long[] tStats = getElectricStats(aStack); - if (tStats == null) return 0; - return Math.max(tStats[1], tStats[3]); + public final boolean canUse(final ItemStack aStack, final double aAmount) { + return this.getRealCharge(aStack) >= aAmount; } @Override - public final int getTier(ItemStack aStack) { - Long[] tStats = getElectricStats(aStack); - return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]); + public final double charge(final ItemStack aStack, final double aCharge, final int aTier, + final boolean aIgnoreTransferLimit, final boolean aSimulate) { + final Long[] tStats = this.getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier + || !(tStats[3] == -1 || tStats[3] == -3 || tStats[3] < 0 && aCharge == Integer.MAX_VALUE) + || aStack.stackSize != 1) { + return 0; + } + final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE + ? Long.MAX_VALUE + : Math.min(Math.abs(tStats[0]), + tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); + if (!aSimulate) { + this.setCharge(aStack, tNewCharge); + } + return tNewCharge - tChargeBefore; } @Override - public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) { - Long[] tStats = getElectricStats(aStack); - if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) - return 0; - long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); - if (!aSimulate) setCharge(aStack, tNewCharge); - return tNewCharge - tChargeBefore; + public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) { + if (aPlayer == null || aPlayer.worldObj.isRemote) { + return; + } + for (int i = 1; i < 5; i++) { + final ItemStack tArmor = aPlayer.getEquipmentInSlot(i); + if (GT_ModHandler.isElectricItem(tArmor)) { + final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem(); + if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= this.getTier(aStack)) { + final double tCharge = ElectricItem.manager.discharge(tArmor, + this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), + Integer.MAX_VALUE, true, true, false); + if (tCharge > 0) { + this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false); + if (aPlayer instanceof EntityPlayer) { + final Container tContainer = ((EntityPlayer) aPlayer).openContainer; + if (tContainer != null) { + tContainer.detectAndSendChanges(); + } + } + } + } + } + } } @Override - public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) { - Long[] tStats = getElectricStats(aStack); - if (tStats == null || tStats[2] > aTier) return 0; - if (aBatteryAlike && !canProvideEnergy(aStack)) return 0; + public final double discharge(final ItemStack aStack, final double aCharge, final int aTier, + final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) { + final Long[] tStats = this.getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier) { + return 0; + } + if (aBatteryAlike && !this.canProvideEnergy(aStack)) { + return 0; + } if (tStats[3] > 0) { - if (aCharge < tStats[3] || aStack.stackSize < 1) return 0; - if (!aSimulate) aStack.stackSize--; + if (aCharge < tStats[3] || aStack.stackSize < 1) { + return 0; + } + if (!aSimulate) { + aStack.stackSize--; + } return tStats[3]; } - long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); - if (!aSimulate) setCharge(aStack, tNewCharge); + final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0, + tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); + if (!aSimulate) { + this.setCharge(aStack, tNewCharge); + } return tChargeBefore - tNewCharge; } @Override - public final double getCharge(ItemStack aStack) { - return getRealCharge(aStack); + public final double getCharge(final ItemStack aStack) { + return this.getRealCharge(aStack); } @Override - public final boolean canUse(ItemStack aStack, double aAmount) { - return getRealCharge(aStack) >= aAmount; + public final Item getChargedItem(final ItemStack itemStack) { + return this; } - @Override - public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) { - chargeFromArmor(aStack, aPlayer); - if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true; - double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true); - if (tTransfer == aAmount) { - discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false); - chargeFromArmor(aStack, aPlayer); - return true; - } - discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false); - chargeFromArmor(aStack, aPlayer); - return false; + @SuppressWarnings("static-method") + public short getChargedMetaData(final ItemStack aStack) { + return (short) aStack.getItemDamage(); } - @Override - public final boolean canProvideEnergy(ItemStack aStack) { - Long[] tStats = getElectricStats(aStack); - if (tStats == null) return false; - return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3)); + public final Long[] getElectricStats(final ItemStack aStack) { + return this.mElectricStats.get((short) aStack.getItemDamage()); } @Override - public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) { - if (aPlayer == null || aPlayer.worldObj.isRemote) return; - for (int i = 1; i < 5; i++) { - ItemStack tArmor = aPlayer.getEquipmentInSlot(i); - if (GT_ModHandler.isElectricItem(tArmor)) { - IElectricItem tArmorItem = (IElectricItem) tArmor.getItem(); - if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) { - double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false); - if (tCharge > 0) { - charge(aStack, tCharge, Integer.MAX_VALUE, true, false); - if (aPlayer instanceof Ent