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/xmod/gregtech/HANDLER_GT.java | 40 +- .../xmod/gregtech/api/energy/IC2ElectricItem.java | 7 +- .../api/energy/IC2ElectricItemManager.java | 142 +- .../xmod/gregtech/api/enums/CustomGtTextures.java | 146 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 402 +- .../gregtech/api/enums/GregtechOreDictNames.java | 16 +- .../gregtech/api/enums/GregtechOrePrefixes.java | 1932 +++------ .../gregtech/api/enums/GregtechTextureSet.java | 284 +- .../xmod/gregtech/api/enums/GregtechTextures.java | 323 +- .../gregtech/api/enums/GregtechToolDictNames.java | 6 +- .../gregtech/api/gui/CONTAINER_DeluxeTank.java | 111 +- .../api/gui/CONTAINER_IndustrialCentrifuge.java | 50 +- .../api/gui/CONTAINER_IronBlastFurnace.java | 36 +- .../xmod/gregtech/api/gui/CONTAINER_MatterFab.java | 44 +- .../gregtech/api/gui/CONTAINER_MultiMachine.java | 36 +- .../xmod/gregtech/api/gui/CONTAINER_SafeBlock.java | 178 +- .../gregtech/api/gui/CONTAINER_SolarGenerator.java | 139 +- .../gregtech/api/gui/CONTAINER_SteamCondenser.java | 172 +- .../xmod/gregtech/api/gui/GUI_DeluxeTank.java | 47 +- .../gregtech/api/gui/GUI_IndustrialCentrifuge.java | 96 +- .../gregtech/api/gui/GUI_IronBlastFurnace.java | 43 +- .../xmod/gregtech/api/gui/GUI_MatterFab.java | 110 +- .../xmod/gregtech/api/gui/GUI_MultiMachine.java | 96 +- .../xmod/gregtech/api/gui/GUI_SafeBlock.java | 86 +- .../xmod/gregtech/api/gui/GUI_SolarGenerator.java | 67 +- .../xmod/gregtech/api/gui/GUI_SteamCondenser.java | 89 +- .../api/interfaces/GregtechItemContainer.java | 37 +- .../interfaces/internal/IGregtech_RecipeAdder.java | 151 +- .../internal/Interface_IconContainer.java | 24 +- .../internal/Interface_ItemBehaviour.java | 33 +- .../internal/Interface_OreRecipeRegistrator.java | 25 +- .../Interface_OreRecipeRegistrator_GT.java | 22 +- .../api/interfaces/internal/Interface_Texture.java | 14 +- .../interfaces/internal/Interface_ToolStats.java | 186 +- .../gregtech/api/items/Gregtech_Generic_Item.java | 303 +- .../xmod/gregtech/api/items/Gregtech_MetaItem.java | 605 ++- .../gregtech/api/items/Gregtech_MetaItem_Base.java | 1213 +++--- .../gregtech/api/items/Gregtech_MetaItem_X32.java | 378 +- .../xmod/gregtech/api/items/Gregtech_MetaTool.java | 728 ++-- .../gregtech/api/items/tools/GT_MetaGenTool.java | 741 ++-- .../gregtech/api/items/types/ToolType_Base.java | 123 +- .../api/items/types/ToolType_HardHammer.java | 213 +- .../gregtech/api/items/types/ToolType_Wrench.java | 292 +- .../GT_MetaTileEntity_DeluxeTank.java | 418 +- .../implementations/GregtechMetaCondensor.java | 301 +- .../implementations/GregtechMetaEnergyBuffer.java | 563 ++- .../GregtechMetaPipeEntityFluid.java | 563 ++- .../GregtechMetaPipeEntity_Cable.java | 460 +-- .../GregtechMetaPipeEntity_SuperConductor.java | 466 +-- .../implementations/GregtechMetaSafeBlock.java | 110 +- .../GregtechMetaSuperConductorNodeBase.java | 614 ++- .../base/GregtechMetaPipeEntityBase_Cable.java | 559 +-- .../base/GregtechMetaTileEntity.java | 85 +- .../base/GregtechMeta_MultiBlockBase.java | 1849 ++++----- .../GregtechDoubleFuelGeneratorBase.java | 601 ++- .../base/generators/GregtechMetaBoilerBase.java | 625 ++- .../generators/GregtechMetaSolarGenerator.java | 376 +- .../GregtechRocketFuelGeneratorBase.java | 558 ++- .../GregtechBaseMetaTileEntityLossless.java | 4189 +++++++++----------- .../GregtechMetaPipeEntity_BaseSuperConductor.java | 1312 +++--- .../lossless/GregtechMetaTileEntityLossless.java | 85 +- .../GregtechMetaTileEntityLosslessBasicTank.java | 494 ++- ...chMetaTileEntityLosslessTieredMachineBlock.java | 110 +- .../base/lossless/MetaTileEntityLossless.java | 1779 ++++----- .../base/machines/GregtechMetaSafeBlockBase.java | 483 +-- .../creative/GregtechMetaCreativeEnergyBuffer.java | 388 +- .../xmod/gregtech/api/objects/GregtechFluid.java | 33 +- .../gregtech/api/objects/GregtechItemData.java | 265 +- .../api/objects/GregtechMaterialStack.java | 84 +- .../api/objects/GregtechRenderedTexture.java | 314 +- .../ProcessingSkookumChoocherToolRecipes.java | 24 +- .../api/util/GregtechOreDictUnificator.java | 814 ++-- .../api/util/GregtechRecipeRegistrator.java | 966 ++--- .../xmod/gregtech/common/Meta_GT_Proxy.java | 1234 +++--- .../common/blocks/GregtechMetaCasingBlocks.java | 71 +- .../common/blocks/GregtechMetaCasingBlocks2.java | 56 +- .../blocks/GregtechMetaCasingBlocksAbstract.java | 232 +- .../common/blocks/GregtechMetaCasingItems.java | 9 +- .../common/blocks/GregtechMetaItemCasings1.java | 40 +- .../blocks/GregtechMetaItemCasingsAbstract.java | 81 +- .../common/blocks/fluid/GregtechFluidHandler.java | 343 +- .../blocks/textures/CasingTextureHandler.java | 125 +- .../blocks/textures/CasingTextureHandler2.java | 108 +- .../textures/TexturesCentrifugeMultiblock.java | 791 ++-- .../common/blocks/textures/TexturesGregtech58.java | 802 ++-- .../common/blocks/textures/TexturesGregtech59.java | 901 ++--- .../common/blocks/textures/TexturesGtBlock.java | 285 +- .../common/blocks/textures/TexturesGtTools.java | 77 +- .../common/items/MetaGeneratedGregtechItems.java | 979 +---- .../common/items/MetaGeneratedGregtechTools.java | 26 +- .../items/behaviours/Behaviour_Choocher.java | 81 +- .../items/behaviours/Behaviour_Prospecting_Ex.java | 203 +- .../GT_MetaTileEntity_TesseractGenerator.java | 736 ++-- .../GT_MetaTileEntity_TesseractTerminal.java | 634 +-- .../generators/GT_MetaTileEntity_Boiler_Solar.java | 267 +- ...gtechMetaTileEntityDoubleFuelGeneratorBase.java | 261 +- .../GregtechMetaTileEntityGeothermalGenerator.java | 162 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 259 +- .../GregtechMetaTileEntitySolarGenerator.java | 233 +- .../GregtechMetaTileEntitySuperCondensor.java | 212 +- .../basic/GregtechMetaTileEntityChunkLoader.java | 252 +- .../machines/multi/GregtechMTE_NuclearReactor.java | 354 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 445 +-- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 360 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 486 ++- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 355 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 353 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 290 +- .../GregtechMetaTileEntity_IndustrialSinter.java | 336 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 294 +- .../GregtechMetaTileEntity_IronBlastFurnace.java | 778 ++-- .../GregtechMetaTileEntity_MassFabricator.java | 547 ++- .../multi/GregtechMetaTileEntity_MultiTank.java | 609 ++- ...chMetaTileEntity_PowerSubStationController.java | 274 +- .../storage/GT_MetaTileEntity_TieredTank.java | 258 +- .../gregtech/common/tools/TOOL_Gregtech_Base.java | 162 +- .../common/tools/TOOL_Gregtech_Choocher.java | 326 +- .../xmod/gregtech/loaders/Gregtech_Blocks.java | 36 +- .../loaders/ProcessingToolHeadChoocher.java | 141 +- .../loaders/Processing_Textures_Items.java | 5 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 270 +- .../gregtech/loaders/RecipeGen_BlastSmelterGT.java | 229 +- .../gregtech/loaders/RecipeGen_DustGeneration.java | 153 +- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 126 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 162 +- .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 259 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 460 +-- .../recipes/machines/RECIPEHANDLER_CokeOven.java | 47 +- .../recipes/machines/RECIPEHANDLER_Dehydrator.java | 66 +- .../machines/RECIPEHANDLER_MatterFabricator.java | 49 +- .../registration/gregtech/Gregtech4Content.java | 46 +- .../registration/gregtech/GregtechConduits.java | 581 ++- .../registration/gregtech/GregtechDehydrator.java | 123 +- .../gregtech/GregtechEnergyBuffer.java | 203 +- .../GregtechGeothermalThermalGenerator.java | 80 +- .../gregtech/GregtechIndustrialBlastSmelter.java | 19 +- .../gregtech/GregtechIndustrialCentrifuge.java | 22 +- .../gregtech/GregtechIndustrialCokeOven.java | 22 +- .../gregtech/GregtechIndustrialElectrolyzer.java | 22 +- .../gregtech/GregtechIndustrialMacerator.java | 22 +- .../gregtech/GregtechIndustrialMassFabricator.java | 22 +- .../gregtech/GregtechIndustrialMultiTank.java | 26 +- .../gregtech/GregtechIndustrialPlatePress.java | 22 +- .../gregtech/GregtechIndustrialWiremill.java | 22 +- .../gregtech/GregtechIronBlastFurnace.java | 18 +- .../registration/gregtech/GregtechLFTR.java | 23 +- .../gregtech/GregtechPowerSubStation.java | 22 +- .../gregtech/GregtechRocketFuelGenerator.java | 80 +- .../registration/gregtech/GregtechSafeBlock.java | 154 +- .../gregtech/GregtechSolarGenerators.java | 54 +- .../gregtech/GregtechSteamCondenser.java | 22 +- .../gregtech/GregtechSuperConductionPoint.java | 22 +- .../gregtech/GregtechTieredFluidTanks.java | 54 +- 153 files changed, 21301 insertions(+), 27344 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index a234d006da..2b3c23daf1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -6,7 +6,9 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import gtPlusPlus.xmod.gregtech.loaders.*; +import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; +import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; public class HANDLER_GT { @@ -14,33 +16,33 @@ public class HANDLER_GT { public static GT_Config mMaterialProperties = null; @SuppressWarnings("unused") - public static void init() { + public static void preInit(){ + new MetaGeneratedGregtechItems(); + if (mMaterialProperties != null){ + GT_Materials.init(mMaterialProperties); + } + GregtechFluidHandler.run(); + } - // Load General Blocks and set up some Basic Meta Tile Entitie states - Gregtech_Blocks.run(); + @SuppressWarnings("unused") + public static void init(){ - // Register Tile Entities + //Load General Blocks and set up some Basic Meta Tile Entitie states + Gregtech_Blocks.run(); + + //Register Tile Entities COMPAT_HANDLER.registerGregtechMachines(); - - // Add Custom Pipes, Wires and Cables. + + //Add Custom Pipes, Wires and Cables. GregtechConduits.run(); new MetaGeneratedGregtechTools(); new ProcessingToolHeadChoocher().run(); RecipeGen_BlastSmelterGT.generateRecipes(); - - } - - public static void postInit() { - + } - @SuppressWarnings("unused") - public static void preInit() { - new MetaGeneratedGregtechItems(); - if (HANDLER_GT.mMaterialProperties != null) { - GT_Materials.init(HANDLER_GT.mMaterialProperties); - } - GregtechFluidHandler.run(); + public static void postInit(){ + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java index 561899ea99..4ec4589c03 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java @@ -10,8 +10,7 @@ import net.minecraft.item.ItemStack; */ public interface IC2ElectricItem { /** - * Determine if the item can be used in a machine or as an armor part to - * supply energy. + * Determine if the item can be used in a machine or as an armor part to supply energy. * * @return Whether the item can supply energy */ @@ -40,8 +39,7 @@ public interface IC2ElectricItem { /** * Get the item's tier, lower tiers can't send energy to higher ones. - * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are - * Tier 3. + * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. * * @return Item's tier */ @@ -54,3 +52,4 @@ public interface IC2ElectricItem { */ double getTransferLimit(ItemStack itemStack); } + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java index 9ffc803494..311947e5e6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java @@ -4,124 +4,92 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; /** - * This interface specifies a manager to handle the various tasks for electric - * items. + * This interface specifies a manager to handle the various tasks for electric items. * - * The default implementation does the following: - store and retrieve the - * charge - handle charging, taking amount, tier, transfer limit, - * canProvideEnergy and simulate into account - replace item IDs if appropriate - * (getChargedItemId() and getEmptyItemId()) - update and manage the damage - * value for the visual charge indicator - * - * @note If you're implementing your own variant (ISpecialElectricItem), you can - * delegate to the default implementations through - * ElectricItem.rawManager. The default implementation is designed to - * minimize its dependency on its own constraints/structure and delegates - * most work back to the more atomic features in the gateway manager. + * The default implementation does the following: + * - store and retrieve the charge + * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account + * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId()) + * - update and manage the damage value for the visual charge indicator + * + * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the + * default implementations through ElectricItem.rawManager. The default implementation is designed + * to minimize its dependency on its own constraints/structure and delegates most work back to the + * more atomic features in the gateway manager. */ public interface IC2ElectricItemManager { - /** - * Determine if the specified electric item has at least a specific amount - * of EU. This is supposed to be used in the item code during operation, for - * example if you want to implement your own electric item. BatPacks are not - * taken into account. - * - * @param itemStack - * electric item's stack - * @param amount - * minimum amount of energy required - * @return true if there's enough energy - */ - boolean canUse(ItemStack stack, double amount); - /** * Charge an item with a specified amount of energy. * - * @param itemStack - * electric item's stack - * @param amount - * amount of energy to charge in EU - * @param tier - * tier of the charging device, has to be at least as high as the - * item to charge - * @param ignoreTransferLimit - * ignore the transfer limit specified by getTransferLimit() - * @param simulate - * don't actually change the item, just determine the return - * value + * @param itemStack electric item's stack + * @param amount amount of energy to charge in EU + * @param tier tier of the charging device, has to be at least as high as the item to charge + * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() + * @param simulate don't actually change the item, just determine the return value * @return Energy transferred into the electric item */ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); - /** - * Charge an item from the BatPack a player is wearing. This is supposed to - * be used in the item code during operation, for example if you want to - * implement your own electric item. use() already contains this - * functionality. - * - * @param itemStack - * electric item's stack - * @param entity - * entity holding the item - */ - void chargeFromArmor(ItemStack stack, EntityLivingBase entity); - /** * Discharge an item by a specified amount of energy * - * @param itemStack - * electric item's stack - * @param amount - * amount of energy to discharge in EU - * @param tier - * tier of the discharging device, has to be at least as high as - * the item to discharge - * @param ignoreTransferLimit - * ignore the transfer limit specified by getTransferLimit() - * @param externally - * use the supplied item externally, i.e. to power something else - * as if it was a battery - * @param simulate - * don't actually discharge the item, just determine the return - * value + * @param itemStack electric item's stack + * @param amount amount of energy to discharge in EU + * @param tier tier of the discharging device, has to be at least as high as the item to discharge + * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() + * @param externally use the supplied item externally, i.e. to power something else as if it was a battery + * @param simulate don't actually discharge the item, just determine the return value * @return Energy retrieved from the electric item */ - double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, - boolean simulate); + double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate); /** * Determine the charge level for the specified item. - * - * @param itemStack - * ItemStack containing the electric item + * + * @param itemStack ItemStack containing the electric item * @return charge level in EU */ double getCharge(ItemStack stack); /** - * Get the tool tip to display for electric items. + * Determine if the specified electric item has at least a specific amount of EU. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * BatPacks are not taken into account. * - * @param itemStack - * ItemStack to determine the tooltip for - * @return tool tip string or null for none + * @param itemStack electric item's stack + * @param amount minimum amount of energy required + * @return true if there's enough energy */ - String getToolTip(ItemStack stack); + boolean canUse(ItemStack stack, double amount); /** - * Try to retrieve a specific amount of energy from an Item, and if - * applicable, a BatPack. This is supposed to be used in the item code - * during operation, for example if you want to implement your own electric - * item. + * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. * - * @param itemStack - * electric item's stack - * @param amount - * amount of energy to discharge in EU - * @param entity - * entity holding the item + * @param itemStack electric item's stack + * @param amount amount of energy to discharge in EU + * @param entity entity holding the item * @return true if the operation succeeded */ boolean use(ItemStack stack, double amount, EntityLivingBase entity); + /** + * Charge an item from the BatPack a player is wearing. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * use() already contains this functionality. + * + * @param itemStack electric item's stack + * @param entity entity holding the item + */ + void chargeFromArmor(ItemStack stack, EntityLivingBase entity); + + /** + * Get the tool tip to display for electric items. + * + * @param itemStack ItemStack to determine the tooltip for + * @return tool tip string or null for none + */ + String getToolTip(ItemStack stack); + // TODO: add tier getter } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java index d6031edb23..e2af820c16 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java @@ -10,72 +10,82 @@ import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; public class CustomGtTextures { - public enum ItemIcons implements IIconContainer, Runnable { - VOID // The Empty Texture - , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR, JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE, SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN, HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING, POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV, DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, - - SKOOKUMCHOOCHER, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE; - - public static class CustomIcon implements IIconContainer, Runnable { - protected IIcon mIcon, mOverlay; - protected String mIconName; - - public CustomIcon(final String aIconName) { - this.mIconName = aIconName; - GregTech_API.sGTItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - - @Override - public void run() { - this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName); - this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName + "_OVERLAY"); - } - } - - public static final ITexture[] ERROR_RENDERING = new ITexture[] { - new GT_RenderedTexture(RENDERING_ERROR) - }; - - protected IIcon mIcon, mOverlay; - - private ItemIcons() { - GregTech_API.sGTItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - - @Override - public void run() { - this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this); - this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY"); - } - } + public enum ItemIcons implements IIconContainer, Runnable { + VOID // The Empty Texture + , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR, + JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE, + SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN, + HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, + HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, + HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING, + POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV, + DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, + DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, + DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, + ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, + ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, + ENERGY_BAR_8, + + SKOOKUMCHOOCHER, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE; + + public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)}; + + protected IIcon mIcon, mOverlay; + + private ItemIcons() { + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public IIcon getIcon() { + return mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return mOverlay; + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + + @Override + public void run() { + mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this); + mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY"); + } + + public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; + protected String mIconName; + + public CustomIcon(String aIconName) { + mIconName = aIconName; + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public IIcon getIcon() { + return mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return mOverlay; + } + + @Override + public void run() { + mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + mIconName); + mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + mIconName + "_OVERLAY"); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + } + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 52c34bf4f1..9837c6944f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -1,7 +1,9 @@ package gtPlusPlus.xmod.gregtech.api.enums; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.*; +import static gregtech.api.enums.GT_Values.W; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -14,272 +16,250 @@ import net.minecraftforge.fluids.Fluid; public enum GregtechItemList implements GregtechItemContainer { Energy_Buffer_CREATIVE, - - // Energy Buffers + + //Energy Buffers Energy_Buffer_1by1_ULV, Energy_Buffer_1by1_LV, Energy_Buffer_1by1_MV, Energy_Buffer_1by1_HV, Energy_Buffer_1by1_EV, Energy_Buffer_1by1_IV, Energy_Buffer_1by1_LuV, Energy_Buffer_1by1_ZPM, Energy_Buffer_1by1_UV, Energy_Buffer_1by1_MAX, - - // Cobble Generators + + //Cobble Generators Cobble_Generator_ULV, Cobble_Generator_LV, Cobble_Generator_MV, Cobble_Generator_HV, Cobble_Generator_EV, Cobble_Generator_IV, Cobble_Generator_LuV, Cobble_Generator_ZPM, Cobble_Generator_UV, Cobble_Generator_MAX, - - // The max Steam condenser - Condensor_MAX, - - // Player owned Safes + + //The max Steam condenser + Condensor_MAX, + + //Player owned Safes GT_Safe_ULV, GT_Safe_LV, GT_Safe_MV, GT_Safe_HV, GT_Safe_EV, GT_Safe_IV, GT_Safe_LuV, GT_Safe_ZPM, GT_Safe_UV, GT_Safe_MAX, - - // Rocket Engines + + //Rocket Engines Rocket_Engine_EV, Rocket_Engine_IV, Rocket_Engine_LuV, - - // IronBlastFurnace Machine_Bronze_BlastFurnace + + //IronBlastFurnace Machine_Bronze_BlastFurnace Machine_Iron_BlastFurnace, Casing_IronPlatedBricks, - - // Machine Casings - Casing_Shielding, - - // Large Centrifuge + + //Machine Casings + Casing_Shielding, + + //Large Centrifuge Industrial_Centrifuge, Casing_Centrifuge1, - - // Coke Oven - Industrial_CokeOven, Casing_CokeOven, Casing_CokeOven_Coil1, Casing_CokeOven_Coil2, - - // Bending Maching // Plate Press // Press - Casing_MaterialPress, Industrial_PlatePress, - - // Gregtech Machine Parts - Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX, Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX, Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX, Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX, Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX, Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX, Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX, Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX, - - // Circuits - Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, Circuit_IV, Circuit_LuV, Circuit_ZPM, - // Circuit Parts - Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM, - - // Unused Machine Casings - Casing_MacerationStack, Casing_MatterGen, Casing_MatterFab, Casing_U7, - // Unused Machine Coils + + //Coke Oven + Industrial_CokeOven, Casing_CokeOven, Casing_CokeOven_Coil1, Casing_CokeOven_Coil2, + + //Bending Maching // Plate Press // Press + Casing_MaterialPress, Industrial_PlatePress, + + //Gregtech Machine Parts + Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX, + Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX, + Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX, + Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX, + Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX, + Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX, + Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX, + Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX, + + //Circuits + Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, + Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, + Circuit_IV, Circuit_LuV, Circuit_ZPM, + //Circuit Parts + Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, + Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, + Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, + Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM, + + //Unused Machine Casings + Casing_MacerationStack, Casing_MatterGen, Casing_MatterFab, Casing_U7, + //Unused Machine Coils Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_BlastSmelter, Casing_BlastSmelter, - - // Windmill Shaft Shape for Extruder - Shape_Extruder_WindmillShaft, - - // Batteries + + //Windmill Shaft Shape for Extruder + Shape_Extruder_WindmillShaft, + + //Batteries Battery_RE_EV_Sodium, Battery_RE_EV_Cadmium, Battery_RE_EV_Lithium, - - // Industrial Electrolyzer - Casing_Electrolyzer, Industrial_Electrolyzer, - - // Industrial Maceration Stack - Casing_WireFactory, Industrial_MacerationStack, - - // Industrial Wire Factory - Industrial_WireFactory, - - Industrial_MassFab, - - // Solar Generators - GT_Solar_ULV, GT_Solar_LV, GT_Solar_MV, GT_Solar_HV, GT_Solar_EV, GT_Solar_IV, GT_Solar_LuV, GT_Solar_ZPM, GT_Solar_UV, GT_Solar_MAX, - - // Cooked Raisin Toast for ImQ009 - Food_Baked_Raisin_Bread, - - // For sintering TODO - Industrial_AlloyBlastSmelter, - - // Block that enables uplink to a superconductor network - SuperConductorInputNode, - - // The two tiers of reactor casings - Casing_Reactor_I, Casing_Reactor_II, - - // Power sub-station for mass storage. 3 hatches for input and output, - // whatever voltages you desire. - PowerSubStation, - - // Chemical Dehydrators for nuclear fuels + + //Industrial Electrolyzer + Casing_Electrolyzer, Industrial_Electrolyzer, + + //Industrial Maceration Stack + Casing_WireFactory, Industrial_MacerationStack, + + //Industrial Wire Factory + Industrial_WireFactory, + + Industrial_MassFab, + + //Solar Generators + GT_Solar_ULV, GT_Solar_LV, GT_Solar_MV, + GT_Solar_HV, GT_Solar_EV, GT_Solar_IV, + GT_Solar_LuV, GT_Solar_ZPM, GT_Solar_UV, GT_Solar_MAX, + + + + //Cooked Raisin Toast for ImQ009 + Food_Baked_Raisin_Bread, + + //For sintering TODO + Industrial_AlloyBlastSmelter, + + //Block that enables uplink to a superconductor network + SuperConductorInputNode, + + //The two tiers of reactor casings + Casing_Reactor_I, Casing_Reactor_II, + + //Power sub-station for mass storage. 3 hatches for input and output, whatever voltages you desire. + PowerSubStation, + + //Chemical Dehydrators for nuclear fuels GT_Dehydrator_EV, GT_Dehydrator_IV, GT_Dehydrator_LuV, GT_Dehydrator_ZPM, - - // Fluid Storage Tanks - GT_FluidTank_ULV, GT_FluidTank_LV, GT_FluidTank_MV, GT_FluidTank_HV, GT_FluidTank_EV, GT_FluidTank_IV, GT_FluidTank_LuV, GT_FluidTank_ZPM, GT_FluidTank_UV, GT_FluidTank_MAX, - - // Fluid Cells to regulate flows. - Fluid_Cell_1L, Fluid_Cell_16L, Fluid_Cell_36L, Fluid_Cell_144L, - - // Multitank - Industrial_MultiTank, Industrial_MultiTankDense, Casing_MultitankExterior, - - // Gt4 Workbenches - GT4_Workbench_Bronze, GT4_Workbench_Advanced, - - // Geothermal Engines - Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV, - - // Tesseracts - GT4_Tesseract_Generator, GT4_Tesseract_Terminal, - - // Casings Tier 2 [17-32] - Casing_StructuralGlass, Casing_PlaceHolder1, Casing_PlaceHolder2, Casing_PlaceHolder3, Casing_PlaceHolder4, Casing_PlaceHolder5, Casing_PlaceHolder6, Casing_PlaceHolder7, Casing_PlaceHolder8, Casing_PlaceHolder9, Casing_PlaceHolder10, Casing_PlaceHolder11, Casing_PlaceHolder12, Casing_PlaceHolder13, Casing_PlaceHolder14, Casing_PlaceHolder15, - - // LFTR - ThoriumReactor,; - - public static final GregtechItemList[] DYE_ONLY_ITEMS = { - Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV - }; - public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas; - private ItemStack mStack; - - private boolean mHasNotBeenSet = true; + + //Fluid Storage Tanks + GT_FluidTank_ULV, GT_FluidTank_LV, GT_FluidTank_MV, GT_FluidTank_HV, GT_FluidTank_EV, + GT_FluidTank_IV, GT_FluidTank_LuV, GT_FluidTank_ZPM, GT_FluidTank_UV, GT_FluidTank_MAX, + + //Fluid Cells to regulate flows. + Fluid_Cell_1L, Fluid_Cell_16L, Fluid_Cell_36L, Fluid_Cell_144L, + + //Multitank + Industrial_MultiTank, Industrial_MultiTankDense, Casing_MultitankExterior, + + //Gt4 Workbenches + GT4_Workbench_Bronze, GT4_Workbench_Advanced, + + //Geothermal Engines + Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV, + + //Tesseracts + GT4_Tesseract_Generator, GT4_Tesseract_Terminal, + + //Casings Tier 2 [17-32] + Casing_StructuralGlass, + Casing_PlaceHolder1, Casing_PlaceHolder2, Casing_PlaceHolder3, + Casing_PlaceHolder4, Casing_PlaceHolder5, Casing_PlaceHolder6, + Casing_PlaceHolder7, Casing_PlaceHolder8, Casing_PlaceHolder9, + Casing_PlaceHolder10, Casing_PlaceHolder11, Casing_PlaceHolder12, + Casing_PlaceHolder13, Casing_PlaceHolder14, Casing_PlaceHolder15, + + //LFTR + ThoriumReactor, + ; + + public static final GregtechItemList[] + DYE_ONLY_ITEMS = { + Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV }; + private ItemStack mStack; + private boolean mHasNotBeenSet = true; + + public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas; @Override - public ItemStack get(final long aAmount, final Object... aReplacements) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return GT_Utility.copyAmount(aAmount, aReplacements); - } - return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack)); + public GregtechItemList set(Item aItem) { + mHasNotBeenSet = false; + if (aItem == null) return this; + ItemStack aStack = new ItemStack(aItem, 1, 0); + mStack = GT_Utility.copyAmount(1, aStack); + return this; } @Override - public ItemStack getAlmostBroken(final long aAmount, final Object... aReplacements) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return GT_Utility.copyAmount(aAmount, aReplacements); - } - return GT_Utility.copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, - GT_OreDictUnificator.get(this.mStack)); + public GregtechItemList set(ItemStack aStack) { + mHasNotBeenSet = false; + mStack = GT_Utility.copyAmount(1, aStack); + return this; } @Override - public Block getBlock() { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - return GT_Utility.getBlockFromStack(this.getItem()); + public Item getItem() { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return null; + return mStack.getItem(); } @Override - public Item getItem() { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return null; - } - return this.mStack.getItem(); + public Block getBlock() { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromStack(getItem()); } @Override - public ItemStack getUndamaged(final long aAmount, final Object... aReplacements) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return GT_Utility.copyAmount(aAmount, aReplacements); - } - return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack)); + public final boolean hasBeenSet() { + return !mHasNotBeenSet; } @Override - public ItemStack getWildcard(final long aAmount, final Object... aReplacements) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return GT_Utility.copyAmount(aAmount, aReplacements); - } - return GT_Utility.copyAmountAndMetaData(aAmount, GT_Values.W, GT_OreDictUnificator.get(this.mStack)); + public boolean isStackEqual(Object aStack) { + return isStackEqual(aStack, false, false); } @Override - public ItemStack getWithCharge(final long aAmount, final int aEnergy, final Object... aReplacements) { - final ItemStack rStack = this.get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) { - return null; - } - GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); - return GT_Utility.copyAmount(aAmount, rStack); + public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { + if (GT_Utility.isStackInvalid(aStack)) return false; + return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?getWildcard(1):get(1), aIgnoreNBT); } @Override - public ItemStack getWithDamage(final long aAmount, final long aMetaValue, final Object... aReplacements) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - if (GT_Utility.isStackInvalid(this.mStack)) { - return GT_Utility.copyAmount(aAmount, aReplacements); - } - return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack)); + public ItemStack get(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); } @Override - public ItemStack getWithName(final long aAmount, final String aDisplayName, final Object... aReplacements) { - final ItemStack rStack = this.get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) { - return null; - } - rStack.setStackDisplayName(aDisplayName); - return GT_Utility.copyAmount(aAmount, rStack); + public ItemStack getWildcard(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); } @Override - public final boolean hasBeenSet() { - return !this.mHasNotBeenSet; + public ItemStack getUndamaged(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); } @Override - public boolean isStackEqual(final Object aStack) { - return this.isStackEqual(aStack, false, false); + public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage()-1, GT_OreDictUnificator.get(mStack)); } @Override - public boolean isStackEqual(final Object aStack, final boolean aWildcard, final boolean aIgnoreNBT) { - if (GT_Utility.isStackInvalid(aStack)) { - return false; - } - return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), - aIgnoreNBT); + public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + rStack.setStackDisplayName(aDisplayName); + return GT_Utility.copyAmount(aAmount, rStack); } @Override - public GregtechItemList registerOre(final Object... aOreNames) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - for (final Object tOreName : aOreNames) { - GT_OreDictUnificator.registerOre(tOreName, this.get(1)); - } - return this; + public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); + return GT_Utility.copyAmount(aAmount, rStack); } @Override - public GregtechItemList registerWildcardAsOre(final Object... aOreNames) { - if (this.mHasNotBeenSet) { - throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); - } - for (final Object tOreName : aOreNames) { - GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1)); - } - return this; + public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); } @Override - public GregtechItemList set(final Item aItem) { - this.mHasNotBeenSet = false; - if (aItem == null) { - return this; - } - final ItemStack aStack = new ItemStack(aItem, 1, 0); - this.mStack = GT_Utility.copyAmount(1, aStack); + public GregtechItemList registerOre(Object... aOreNames) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); return this; } @Override - public GregtechItemList set(final ItemStack aStack) { - this.mHasNotBeenSet = false; - this.mStack = GT_Utility.copyAmount(1, aStack); + public GregtechItemList registerWildcardAsOre(Object... aOreNames) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); return this; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java index d573144fca..dcb075349d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java @@ -12,24 +12,28 @@ package gtPlusPlus.xmod.gregtech.api.enums; * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb * Infinite (Cheaty) -* +* Circuits - Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, - Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, + Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, + Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, Circuit_IV, Circuit_LuV, Circuit_ZPM, Circuit Parts - Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, + Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; */ public enum GregtechOreDictNames { - buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM, Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; + buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM, + Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, + Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, + Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, + Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; public String unlocalisedName; private void ModObject() { - this.unlocalisedName = this.name(); + unlocalisedName = name(); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 3530b3d084..9a1ef1376d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -1,1195 +1,758 @@ package gtPlusPlus.xmod.gregtech.api.enums; -import java.util.*; - -import gregtech.api.enums.*; +import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GT_Values.D2; +import static gregtech.api.enums.GT_Values.M; +import static gtPlusPlus.core.util.Utils.getTcAspectStack; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Element; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.TC_Aspects.TC_AspectStack; -import gregtech.api.interfaces.*; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.ICondition; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_FluidStack; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.*; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData; import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; public enum GregtechOrePrefixes { - /* - * Electric Components. + /* Electric Components. * - * usual Materials for this are: Primitive (Tier 1) Basic (Tier 2) as used - * by UE as well : IC2 Circuit and RE-Battery Good (Tier 3) Advanced (Tier - * 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium - * Battery Data (Tier 5) : Data Storage Circuit Elite (Tier 6) as used by UE - * as well : Energy Crystal and Data Control Circuit Master (Tier 7) : - * Energy Flow Circuit and Lapotron Crystal Ultimate (Tier 8) : Data Orb and - * Lapotronic Energy Orb Infinite (Cheaty) + * usual Materials for this are: + * Primitive (Tier 1) + * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery + * Good (Tier 3) + * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery + * Data (Tier 5) : Data Storage Circuit + * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit + * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal + * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb + * Infinite (Cheaty) */ - ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, - GT_Values.B[1], GT_Values.M * 1, 16, 12), // A hot Ingot, which has - // to be cooled down by - // a Vacuum Freezer. - ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, GT_Values.B[1], - GT_Values.M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam - dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, - GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M / 9, 64, 0), // 1/9th - // of - // a - // Dust. - dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, - false, GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M / 4, 64, 1), // 1/4th - // of - // a - // Dust. - dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, - true, GT_Values.B[3], GT_Values.M * 1, 64, 3), // Dust with - // impurities. 1 - // Unit of Main - // Material and 1/9 - // - 1/4 Unit of - // secondary - // Material - dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, - false, true, GT_Values.B[3], GT_Values.M * 1, 64, 2), dustPure("Purified Dusts", "Purified Pile of ", - " Dust", true, true, false, false, false, false, false, true, false, true, GT_Values.B[3], - GT_Values.M * 1, 64, - 4), dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, - GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M * 1, 64, 2), // Pure - // Dust - // worth - // of - // one - // Ingot - // or - // Gem. - // Introduced - // by - // Alblaka. - nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, GT_Values.B[1], - GT_Values.M / 9, 64, 9), // A Nugget. Introduced by Eloraam - plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, - GT_Values.B[1] | GT_Values.B[2], GT_Values.M * 1, 64, 17), // Regular - // Plate - // made - // of - // one - // Ingot/Dust. - // Introduced - // by - // Calclavia - block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, - GT_Values.M * 9, 64, 71), // Storage Block consisting out of 9 - // Ingots/Gems/Dusts. Introduced by - // CovertJaguar - gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, GT_Values.B[2], - GT_Values.M * 1, 64, 8), // A regular Gem worth one Dust. Introduced - // by Eloraam - gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, - GT_Values.B[2], GT_Values.M / 4, 64, 59), // A regular Gem worth one - // small Dust. - // Introduced by - // TerraFirmaCraft - gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, - GT_Values.B[2], GT_Values.M / 2, 64, 60), // A regular Gem worth two - // small Dusts. - // Introduced by - // TerraFirmaCraft - gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, - GT_Values.B[2], GT_Values.M * 2, 32, 61), // A regular Gem worth two - // Dusts. Introduced by - // TerraFirmaCraft - gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, - false, GT_Values.B[2], GT_Values.M * 4, 16, 62), // A regular Gem - // worth four - // Dusts. - // Introduced by - // TerraFirmaCraft - stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, - GT_Values.B[1] | GT_Values.B[2], GT_Values.M / 2, 64, 23), // Stick - // made - // of - // half - // an - // Ingot. - // Introduced - // by - // Eloraam - type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, - GT_Values.M * 8, 64, -1), - - toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, - false, false, GT_Values.B[6], GT_Values.M * 6, 16, 37), // consisting - // out of 6 - // Ingots. - - batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, - false, 0, -1, 64, -1), battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, - false, false, false, 0, -1, 64, -1), // Introduced by - // Calclavia - circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced - // by - // Calclavia - chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced - // by - // Buildcraft - computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A - // whole - // Computer. - // "computerMaster" - // = - // ComputerCube + ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer. + ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam + dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust. + dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust. + dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material + dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2), + dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4), + dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka. + nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam + plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia + block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar + gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam + gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft + gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft + gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft + gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft + stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam + type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1), + + toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + + + + batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), + battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia + circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia + chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft + computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A whole Computer. "computerMaster" = ComputerCube + + public static volatile int VERSION = 508; + + static { + + ingotHot.mHeatDamage = 3.0F; + + } + + public final ArrayList mPrefixedItems = new ArrayList(); + public final short mTextureIndex; + public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; + public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; + public final List mAspects = new ArrayList(); + public final Collection mFamiliarPrefixes = new HashSet(); + /** + * Used to determine the amount of Material this Prefix contains. + * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot. + * 0 = Null + * Negative = Undefined Amount + */ + public final long mMaterialAmount; + private final Collection mNotGeneratedItems = new HashSet(), mIgnoredMaterials = new HashSet(), mGeneratedItems = new HashSet(); + private final ArrayList mOreProcessing = new ArrayList(); + private final ArrayList mOreProcessingFake = new ArrayList(); + public ItemStack mContainerItem = null; + public ICondition mCondition = null; + public byte mDefaultStackSize = 64; + public GregtechMaterialStack mSecondaryMaterial = null; + public GregtechOrePrefixes mPrefixInto = this; + public float mHeatDamage = 0.0F; // Negative for Frost Damage + /** + * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. + */ + public int mMaterialGenerationBits = 0; + private GregtechOrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean