From 0669f5eb9d5029a8b94ec552171b0837605f7747 Mon Sep 17 00:00:00 2001 From: draknyte1 Date: Fri, 4 Nov 2016 15:23:26 +1000 Subject: $ Cleaned up the entire project. > Much neat, very nices. --- .../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 | 399 +- .../gregtech/api/enums/GregtechOreDictNames.java | 16 +- .../gregtech/api/enums/GregtechOrePrefixes.java | 1908 ++++++--- .../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 | 98 +- .../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 | 173 +- .../gregtech/api/gui/CONTAINER_SolarGenerator.java | 130 +- .../gregtech/api/gui/CONTAINER_SteamCondenser.java | 163 +- .../xmod/gregtech/api/gui/GUI_DeluxeTank.java | 48 +- .../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 | 28 +- .../internal/Interface_OreRecipeRegistrator.java | 25 +- .../Interface_OreRecipeRegistrator_GT.java | 22 +- .../api/interfaces/internal/Interface_Texture.java | 14 +- .../interfaces/internal/Interface_ToolStats.java | 181 +- .../gregtech/api/items/Gregtech_Generic_Item.java | 283 +- .../xmod/gregtech/api/items/Gregtech_MetaItem.java | 581 +-- .../gregtech/api/items/Gregtech_MetaItem_Base.java | 1197 +++--- .../gregtech/api/items/Gregtech_MetaItem_X32.java | 359 +- .../xmod/gregtech/api/items/Gregtech_MetaTool.java | 712 ++-- .../gregtech/api/items/tools/GT_MetaGenTool.java | 723 ++-- .../gregtech/api/items/types/ToolType_Base.java | 114 +- .../api/items/types/ToolType_HardHammer.java | 201 +- .../gregtech/api/items/types/ToolType_Wrench.java | 281 +- .../GT_MetaTileEntity_DeluxeTank.java | 418 +- .../implementations/GregtechMetaCondensor.java | 301 +- .../implementations/GregtechMetaEnergyBuffer.java | 564 +-- .../GregtechMetaPipeEntityFluid.java | 547 +-- .../GregtechMetaPipeEntity_Cable.java | 443 ++- .../GregtechMetaPipeEntity_SuperConductor.java | 450 ++- .../implementations/GregtechMetaSafeBlock.java | 110 +- .../GregtechMetaSuperConductorNodeBase.java | 610 +-- .../base/GregtechMetaPipeEntityBase_Cable.java | 541 ++- .../base/GregtechMetaTileEntity.java | 86 +- .../base/GregtechMeta_MultiBlockBase.java | 1826 +++++---- .../GregtechDoubleFuelGeneratorBase.java | 597 +-- .../base/generators/GregtechMetaBoilerBase.java | 621 +-- .../generators/GregtechMetaSolarGenerator.java | 377 +- .../GregtechRocketFuelGeneratorBase.java | 554 +-- .../GregtechBaseMetaTileEntityLossless.java | 4173 +++++++++++--------- .../GregtechMetaPipeEntity_BaseSuperConductor.java | 1292 +++--- .../lossless/GregtechMetaTileEntityLossless.java | 86 +- .../GregtechMetaTileEntityLosslessBasicTank.java | 494 +-- ...chMetaTileEntityLosslessTieredMachineBlock.java | 111 +- .../base/lossless/MetaTileEntityLossless.java | 1758 +++++---- .../base/machines/GregtechMetaSafeBlockBase.java | 479 ++- .../creative/GregtechMetaCreativeEnergyBuffer.java | 380 +- .../xmod/gregtech/api/objects/GregtechFluid.java | 33 +- .../gregtech/api/objects/GregtechItemData.java | 256 +- .../api/objects/GregtechMaterialStack.java | 84 +- .../api/objects/GregtechRenderedTexture.java | 310 +- .../ProcessingSkookumChoocherToolRecipes.java | 20 +- .../api/util/GregtechOreDictUnificator.java | 798 ++-- .../api/util/GregtechRecipeRegistrator.java | 955 +++-- 72 files changed, 16499 insertions(+), 12304 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java index 4ec4589c03..561899ea99 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java @@ -10,7 +10,8 @@ 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 */ @@ -39,7 +40,8 @@ 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 */ @@ -52,4 +54,3 @@ 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 311947e5e6..9ffc803494 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java @@ -4,92 +4,124 @@ 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); /** - * 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. + * Get the tool tip to display for electric items. * - * @param itemStack electric item's stack - * @param amount minimum amount of energy required - * @return true if there's enough energy + * @param itemStack + * ItemStack to determine the tooltip for + * @return tool tip string or null for none */ - boolean canUse(ItemStack stack, double amount); + String getToolTip(ItemStack stack); /** - * 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 e2af820c16..d6031edb23 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java @@ -10,82 +10,72 @@ 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 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; - } - } - } + 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"); + } + } } \ 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 ee5200a23f..52c34bf4f1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -1,7 +1,6 @@ package gtPlusPlus.xmod.gregtech.api.enums; -import static gregtech.api.enums.GT_Values.W; - +import gregtech.api.enums.GT_Values; import gregtech.api.util.*; import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer; import net.minecraft.block.Block; @@ -15,250 +14,272 @@ 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 }; - private ItemStack mStack; - private boolean mHasNotBeenSet = true; - - public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas; + + // 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; @Override - 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; + 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)); } @Override - public GregtechItemList set(ItemStack aStack) { - mHasNotBeenSet = false; - mStack = GT_Utility.copyAmount(1, aStack); - return this; + 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)); } @Override - 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(); + 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()); } @Override - 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()); + 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(); } @Override - public final boolean hasBeenSet() { - return !mHasNotBeenSet; + 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)); } @Override - public boolean isStackEqual(Object aStack) { - return isStackEqual(aStack, false, false); + 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)); } @Override - 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); + 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); } @Override - 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)); + 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)); } @Override - 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)); + 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); } @Override - 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)); + public final boolean hasBeenSet() { + return !this.mHasNotBeenSet; } @Override - 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)); + public boolean isStackEqual(final Object aStack) { + return this.isStackEqual(aStack, false, false); } @Override - 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); + 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); } @Override - 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); + 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; } @Override - 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)); + 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; } @Override - 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)); + 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); return this; } @Override - 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)); + public GregtechItemList set(final ItemStack aStack) { + this.mHasNotBeenSet = false; + this.mStack = GT_Utility.copyAmount(1, aStack); 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 dcb075349d..d573144fca 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java @@ -12,28 +12,24 @@ 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() { - unlocalisedName = name(); + this.unlocalisedName = this.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 1c8ae2bc3c..3530b3d084 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -1,10 +1,5 @@ package gtPlusPlus.xmod.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 java.util.*; import gregtech.api.enums.*; @@ -14,6 +9,7 @@ import gregtech.api.objects.GT_FluidStack; import gregtech.api.objects.MaterialStack; import gregtech.api.util.*; 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; @@ -23,722 +19,1177 @@ 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) - */ - 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 + * 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) */ - 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 aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { - mIsUnificatable = aIsUnificatable; - mIsMaterialBased = aIsMaterialBased; - mIsSelfReferencing = aIsSelfReferencing; - mIsContainer = aIsContainer; - mDontUnificateActively = aDontUnificateActively; - mIsUsedForBlocks = aIsUsedForBlocks; - mAllowNormalRecycling = aAllowNormalRecycling; - mGenerateDefaultItem = aGenerateDefaultItem; - mIsEnchantable = aIsEnchantable; - mIsUsedForOreProcessing = aIsUsedForOreProcessing; - mMaterialGenerationBits = aMaterialGenerationBits; - mMaterialAmount = aMaterialAmount; - mRegularLocalName = aRegularLocalName; - mLocalizedMaterialPre = aLocalizedMaterialPre; - mLocalizedMaterialPost = aLocalizedMaterialPost; - mDefaultStackSize = (byte) aDefaultStackSize; - mTextureIndex = (short) aTextureindex; - - - //TODO - Utilise some form of way to check if it's gt 5.9 if so, use string switch. - if (name().startsWith("ore")) { - getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("wire") || name().startsWith("cable")) { - getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("dust")) { - getTcAspectStack(TC_Aspects.PERDITIO.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("crushed")) { - getTcAspectStack(TC_Aspects.PERFODIO.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("ingot") || name().startsWith("nugget")) { - getTcAspectStack(TC_Aspects.METALLUM.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("armor")) { - getTcAspectStack(TC_Aspects.TUTAMEN.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("stone")) { - getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("pipe")) { - getTcAspectStack(TC_Aspects.ITER.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("gear")) { - getTcAspectStack(TC_Aspects.MOTUS.name(), 1).addToAspectList(mAspects); - getTcAspectStack(TC_Aspects.MACHINA.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("frame") || name().startsWith("plate")) { - getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("tool")) { - getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(mAspects); - } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) { - getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(mAspects); - } else if (name().startsWith("crate")) { - getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(mAspects); - } else if (name().startsWith("circuit")) { - getTcAspectStack("COGNITIO", 1); - } else if (name().startsWith("computer")) { - getTcAspectStack("COGNITIO", 4).addToAspectList(mAspects); - } else if (name().startsWith("battery")) { - getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(mAspects); - } - } - - public static GregtechOrePrefixes getOrePrefix(String aOre) { - for (GregtechOrePrefixes tPrefix : values()) - if (aOre.startsWith(tPrefix.toString())) { - return tPrefix; - } - return null; - } - - public static String stripPrefix(String aOre) { - for (GregtechOrePrefixes tPrefix : values()) { - if (aOre.startsWith(tPrefix.toString())) { - return aOre.replaceFirst(tPrefix.toString(), ""); - } - } - return aOre; - } - - public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) { - for (GregtechOrePrefixes tPrefix : values()) { - if (aOre.startsWith(tPrefix.toString())) { - return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString()); - } - } - return ""; - } - - public static GregtechOrePrefixes getPrefix(String aPrefixName) { - return getPrefix(aPrefixName, null); - } - - public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) { - Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false); - if (tObject != null && tObject instanceof GregtechOrePrefixes) return (GregtechOrePrefixes) tObject; - return aReplacement; - } - - public static Materials getMaterial(String aOre) { - return Materials.get(stripPrefix(aOre)); - } - - public static Materials getMaterial(String aOre, GregtechOrePrefixes aPrefix) { - return Materials.get(aOre.replaceFirst(aPrefix.toString(), "")); - } - - public static Materials getRealMaterial(String aOre, GregtechOrePrefixes aPrefix) { - return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), "")); - } - - public static boolean isInstanceOf(String aName, GregtechOrePrefixes aPrefix) { - return aName == null ? false : aName.startsWith(aPrefix.toString()); - } - - public boolean add(ItemStack aStack) { - if (aStack == null) return false; - if (!contains(aStack)) mPrefixedItems.add(aStack); - while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null); - return true; - } - - - public boolean contains(ItemStack aStack) { - if (aStack == null) return false; - for (ItemStack tStack : mPrefixedItems) - if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true; - return false; - } - - public boolean doGenerateItem(Materials aMaterial) { - return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) && !mNotGeneratedItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial)); - } - - public boolean ignoreMaterials(Materials... aMaterials) { - for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial); - return true; - } - - public boolean isIgnored(GT_Materials aMaterial) { - if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true; - return mIgnoredMaterials.contains(aMaterial); - } - - public boolean addFamiliarPrefix(GregtechOrePrefixes aPrefix) { - if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false; - return mFamiliarPrefixes.add(aPrefix); - } - - public boolean add(Interface_OreRecipeRegistrator aRegistrator) { - if (aRegistrator == null) return false; - return mOreProcessing.add(aRegistrator); - } - - public void processOre(GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if (aMaterial != null && (aMaterial != GT_Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) - for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessing) { - if (D2) - GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); - tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); - } - } - - //TODO - public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) - for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessingFake) { - if (D2) - GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); - tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); - } - } - - public Object get(Object aMaterial) { - if (aMaterial instanceof GT_Materials) return new GregtechItemData(this, (GT_Materials) aMaterial); - return name() + aMaterial; - } - - public String getDefaultLocalNameForItem(Materials aMaterial) { - - - // Use Standard Localization - return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost; - } + 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 public enum GT_Materials implements IColorModulationContainer, ISubTagContainer { - - /** - * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen. + * This is the Default Material returned in case no Material