From cbe0e497be8e466c380a5b4fa781b314ede9ada3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 6 Nov 2016 19:32:27 +1000 Subject: Revert "$ Cleaned up the entire project." This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966. --- src/Java/gtPlusPlus/core/item/ModItems.java | 744 ++++++++--------- src/Java/gtPlusPlus/core/item/base/BaseEuItem.java | 920 +++++++++------------ .../core/item/base/BaseItemBackpack.java | 106 +-- .../gtPlusPlus/core/item/base/BaseItemBrain.java | 108 +-- .../core/item/base/BaseItemComponent.java | 194 +++-- .../gtPlusPlus/core/item/base/BaseItemGeneric.java | 29 +- .../gtPlusPlus/core/item/base/BaseItemLoot.java | 135 +-- .../core/item/base/BaseItemWithCharge.java | 67 +- .../core/item/base/BaseItemWithDamageValue.java | 27 +- .../gtPlusPlus/core/item/base/BasicSpawnEgg.java | 435 +++++----- src/Java/gtPlusPlus/core/item/base/CoreItem.java | 132 ++- .../core/item/base/bolts/BaseItemBolt.java | 4 +- .../core/item/base/cell/BaseItemCell.java | 43 +- .../core/item/base/dusts/BaseItemDust.java | 326 ++++---- .../core/item/base/dusts/BaseItemDustAbstract.java | 40 +- .../core/item/base/dusts/BaseItemDustUnique.java | 126 ++- .../item/base/dusts/decimal/BaseItemCentidust.java | 54 +- .../item/base/dusts/decimal/BaseItemDecidust.java | 54 +- .../core/item/base/foods/BaseItemFood.java | 33 +- .../core/item/base/foods/BaseItemHotFood.java | 87 +- .../core/item/base/gears/BaseItemGear.java | 6 +- .../core/item/base/ingots/BaseItemIngot.java | 127 ++- .../core/item/base/ingots/BaseItemIngotHot.java | 66 +- .../core/item/base/itemblock/ItemBlockBase.java | 21 +- .../core/item/base/itemblock/ItemBlockFluid.java | 84 +- .../core/item/base/itemblock/ItemBlockGtBlock.java | 59 +- .../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 | 22 +- .../gtPlusPlus/core/item/effects/RarityEpic.java | 18 +- .../gtPlusPlus/core/item/effects/RarityRare.java | 18 +- .../core/item/effects/RarityUncommon.java | 14 +- .../core/item/general/BedLocator_Base.java | 107 +-- .../gtPlusPlus/core/item/general/BufferCore.java | 100 +-- .../core/item/general/ItemBlueprint.java | 384 +++++---- .../core/item/general/ItemCloakingDevice.java | 308 +++---- .../core/item/general/ItemHealingDevice.java | 276 +++---- .../core/item/general/NuclearFuelRodBase.java | 331 ++++---- .../core/item/general/RF2EU_Battery.java | 378 ++++----- .../core/item/general/fuelrods/FuelRod_Base.java | 300 +++---- .../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 | 73 +- .../core/item/tool/staballoy/MultiPickaxeBase.java | 260 +++--- .../core/item/tool/staballoy/MultiSpadeBase.java | 134 ++- .../core/item/tool/staballoy/StaballoyAxe.java | 519 +++++------- .../core/item/tool/staballoy/StaballoyPickaxe.java | 526 ++++++------ .../core/item/tool/staballoy/StaballoySpade.java | 483 ++++++----- 57 files changed, 4157 insertions(+), 4394 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 79b813c745..2fa0d2c698 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -1,11 +1,14 @@ package gtPlusPlus.core.item; - -import cpw.mods.fml.common.registry.GameRegistry; +import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines; +import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; +import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.*; +import gtPlusPlus.core.item.base.BaseEuItem; +import gtPlusPlus.core.item.base.BaseItemBackpack; +import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; import gtPlusPlus.core.item.base.foods.BaseItemFood; @@ -13,390 +16,350 @@ import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; import gtPlusPlus.core.item.base.plates.BaseItemPlate; import gtPlusPlus.core.item.effects.RarityUncommon; -import gtPlusPlus.core.item.general.*; +import gtPlusPlus.core.item.general.BufferCore; +import gtPlusPlus.core.item.general.ItemBlueprint; +import gtPlusPlus.core.item.general.RF2EU_Battery; import gtPlusPlus.core.item.general.fuelrods.FuelRod_Base; import gtPlusPlus.core.item.init.ItemsFoods; import gtPlusPlus.core.item.tool.misc.SandstoneHammer; -import gtPlusPlus.core.item.tool.staballoy.*; +import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase; +import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; +import gtPlusPlus.core.item.tool.staballoy.StaballoyAxe; +import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.material.*; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.debug.DEBUG_INIT; import gtPlusPlus.core.util.item.ItemUtils; -import net.minecraft.item.*; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.EnumHelper; - +import cpw.mods.fml.common.registry.GameRegistry; 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(){ - ModItems.AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", - Utils.rgbtoHexValue(128, 128, 128), 0); + 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 - 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"); + } + + + //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"); GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHeliumBlob)); - // 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 + //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 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 (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()); + + //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()); r.printStackTrace(); System.exit(1); } - // 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 - } - 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); + //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 - final boolean gtStyleTools = LoadedMods.Gregtech; + 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 - 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); - */ + 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 } + 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); + + // ItemList.Battery_RE_HV_Cadmium.set(BaseEuItem. - // EnderIO Resources - if (LoadedMods.EnderIO || CORE.LOAD_ALL_CONTENT) { + //GameRegistry.registerItem(this, unlocalName); + + 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);*/ + } + + //EnderIO Resources + if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){ Utils.LOG_INFO("EnderIO Found - Loading Resources."); - // 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); + //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); } else { Utils.LOG_WARNING("EnderIO not Found - Skipping Resources."); } - // Big Reactors - if (LoadedMods.Big_Reactors || CORE.LOAD_ALL_CONTENT) { + //Big Reactors + if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("BigReactors Found - Loading Resources."); - // 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); + //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); } else { Utils.LOG_WARNING("BigReactors not Found - Skipping Resources."); } - // Thaumcraft - if (LoadedMods.Thaumcraft || CORE.LOAD_ALL_CONTENT) { + //Thaumcraft + if (LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("Thaumcraft Found - Loading Resources."); - // Item Init + //Item Init try { - ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); - ModItems.itemPlateVoidMetal = new BaseItemPlate("itemPlate" + "Void", "Void", new short[] { - 82, 17, 82 - }, 2, 0); + ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); + itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void", new short[]{82, 17, 82}, 2, 0); GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal)); - } - catch (final NullPointerException e) { + } catch (NullPointerException e){ e.getClass(); } @@ -404,146 +367,123 @@ public final class ModItems { else { Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources."); } - // ExtraUtils - if (LoadedMods.Extra_Utils || CORE.LOAD_ALL_CONTENT) { + //ExtraUtils + if (LoadedMods.Extra_Utils|| 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 (final NullPointerException e) { + //itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateBedrockium"); + } catch (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 || CORE.LOAD_ALL_CONTENT) { + //Pneumaticraft + if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("PneumaticCraft Found - Loading Resources."); - // Item Init - ModItems.itemPlateCompressedIron = new BaseItemPlate("itemPlate" + "CompressedIron", "Compressed Iron", - new short[] { - 128, 128, 128 - }, 2, 0); + //Item Init + 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 || CORE.LOAD_ALL_CONTENT) { + //Simply Jetpacks + if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources."); - // Item Init - ModItems.itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium") - .setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium"); - // Registry - GameRegistry.registerItem(ModItems.itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium"); + //Item Init + itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium"); + //Registry + GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium"); } else { Utils.LOG_WARNING("SimplyJetpacks not Found - Skipping Resources."); } - // rfTools - if (LoadedMods.RFTools || CORE.LOAD_ALL_CONTENT) { + //rfTools + if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("rfTools Found - Loading Resources."); - // Item Init - ModItems.itemPlateDimensionShard = new BaseItemPlate("itemPlate" + "DimensionShard", "Dimensional Shard", - new short[] { - 170, 230, 230 - }, 2, 0); + //Item Init + 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 || CORE.LOAD_ALL_CONTENT) { + //IC2 Exp + if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("IndustrialCraft2 Found - Loading 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."); - } + //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."); } - catch (final Throwable T) { - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + } catch(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 - 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()); + //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()); - // Sandstone Hammer - ModItems.itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer") - .setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(ModItems.itemSandstoneHammer, ModItems.itemSandstoneHammer.getUnlocalizedName()); + //Sandstone Hammer + itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools); + GameRegistry.registerItem(itemSandstoneHammer, 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); } - ModItems.itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit") - .setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); - GameRegistry.registerItem(ModItems.itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit"); + itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); + GameRegistry.registerItem(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 e92e69f0e0..80412fdd3c 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java @@ -1,10 +1,7 @@ package gtPlusPlus.core.item.base; -import java.util.*; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.V; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.SubTag; @@ -12,620 +9,509 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.array.Pair; -import ic2.api.item.*; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import ic2.api.item.IElectricItemManager; +import ic2.api.item.ISpecialElectricItem; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.HashMap; +import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.item.*; +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 cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; 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 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(); + 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(); public BaseEuItem() { - this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766); - } - - 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); + 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)); + } - @SuppressWarnings({ - "unchecked", "rawtypes" - }) @Override - 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); - } - } + @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; } - /** - * 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 boolean hasEffect(ItemStack par1ItemStack){ + if (hasEffect.get(par1ItemStack.getItemDamage()-mOffset) != null) + return hasEffect.get(par1ItemStack.getItemDamage()-mOffset).getValue(); + return false; } - /** - * 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); + + @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; } @Override - 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); + public final Item getEmptyItem(ItemStack itemStack) { + return this; } @Override - public final boolean canUse(final ItemStack aStack, final double aAmount) { - return this.getRealCharge(aStack) >= aAmount; + public final double getMaxCharge(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return Math.abs(tStats[0]); } @Override - 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; + public final double getTransferLimit(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return Math.max(tStats[1], tStats[3]); } @Override - 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(); - } - } - } - } - } - } + public final int getTier(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]); } @Override - 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) { + public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tSt