diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
commit | cbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch) | |
tree | b85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java | |
parent | c40416b036c0e89451e1558253ccf07bbee028d0 (diff) | |
download | GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2 GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip |
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.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java | 142 |
1 files changed, 55 insertions, 87 deletions
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 } |