aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/energy
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/energy')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java85
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java140
2 files changed, 115 insertions, 110 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
index 4ec4589c03..d4a7f97051 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
@@ -9,47 +9,46 @@ import net.minecraft.item.ItemStack;
* The item should have a maximum damage of 13.
*/
public interface IC2ElectricItem {
- /**
- * 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
- */
- boolean canProvideEnergy(ItemStack itemStack);
-
- /**
- * Get the item ID to use for a charge energy greater than 0.
- *
- * @return Item ID to use
- */
- Item getChargedItem(ItemStack itemStack);
-
- /**
- * Get the item ID to use for a charge energy of 0.
- *
- * @return Item ID to use
- */
- Item getEmptyItem(ItemStack itemStack);
-
- /**
- * Get the item's maximum charge energy in EU.
- *
- * @return Maximum charge energy
- */
- double getMaxCharge(ItemStack itemStack);
-
- /**
- * 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.
- *
- * @return Item's tier
- */
- int getTier(ItemStack itemStack);
-
- /**
- * Get the item's transfer limit in EU per transfer operation.
- *
- * @return Transfer limit
- */
- double getTransferLimit(ItemStack itemStack);
+ /**
+ * 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
+ */
+ boolean canProvideEnergy(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy greater than 0.
+ *
+ * @return Item ID to use
+ */
+ Item getChargedItem(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy of 0.
+ *
+ * @return Item ID to use
+ */
+ Item getEmptyItem(ItemStack itemStack);
+
+ /**
+ * Get the item's maximum charge energy in EU.
+ *
+ * @return Maximum charge energy
+ */
+ double getMaxCharge(ItemStack itemStack);
+
+ /**
+ * 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.
+ *
+ * @return Item's tier
+ */
+ int getTier(ItemStack itemStack);
+
+ /**
+ * Get the item's transfer limit in EU per transfer operation.
+ *
+ * @return Transfer limit
+ */
+ double getTransferLimit(ItemStack itemStack);
}
-
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
index 8bf42578cc..4ec01ce63c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
@@ -18,78 +18,84 @@ import net.minecraft.item.ItemStack;
* more atomic features in the gateway manager.
*/
public interface IC2ElectricItemManager {
- /**
- * 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
- * @return Energy transferred into the electric item
- */
- double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
+ /**
+ * 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
+ * @return Energy transferred into the electric item
+ */
+ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
- /**
- * 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
- * @return Energy retrieved from the electric item
- */
- double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
+ /**
+ * 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
+ * @return Energy retrieved from the electric item
+ */
+ 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
- * @return charge level in EU
- */
- double getCharge(ItemStack stack);
+ /**
+ * Determine the charge level for the specified 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.
- *
- * @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);
+ /**
+ * 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);
- /**
- * 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
- * @return true if the operation succeeded
- */
- boolean use(ItemStack stack, double amount, EntityLivingBase entity);
+ /**
+ * 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
+ * @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);
+ /**
+ * 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);
+ /**
+ * 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
+ // TODO: add tier getter
}