mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Basic Mana Item system scaffolding.
This commit is contained in:
1 parent
8582e833f0
commit
8ee2b3d081
3 files changed
+81
No files matched your search
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Mar 6, 2014, 9:07:40 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/**
|
||||
* An item that implements this can be counted as an item that can
|
||||
* contain mana.
|
||||
*/
|
||||
public interface IManaItem {
|
||||
|
||||
/**
|
||||
* Gets the amount of mana this item contains
|
||||
*/
|
||||
public int getMana(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the max amount of mana this item can hold.
|
||||
*/
|
||||
public int getMaxMana(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Adds mana to this item.
|
||||
*/
|
||||
public void addMana(ItemStack stack, int mana);
|
||||
|
||||
/**
|
||||
* Can this item receive mana from a mana Pool?
|
||||
* @param pool The pool it's receiving mana from, can be casted to IManaPool.
|
||||
* @see IManaPool#isOutputtingPower()
|
||||
*/
|
||||
public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool);
|
||||
|
||||
/**
|
||||
* Can this item recieve mana from another item?
|
||||
* The getItem() of both stacks can be casted to IManaItem.
|
||||
*/
|
||||
public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack);
|
||||
|
||||
/**
|
||||
* Can this item export mana to a mana Pool?
|
||||
* @param pool The pool it's exporting mana to, can be casted to IManaPool.
|
||||
* @see IManaPool#isOutputtingPower()
|
||||
*/
|
||||
public boolean canExportManaToPool(ItemStack stack,TileEntity pool);
|
||||
|
||||
/**
|
||||
* Can this item export mana to another item?
|
||||
* The getItem() of both stacks can be casted to IManaItem.
|
||||
*/
|
||||
public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack);
|
||||
|
||||
/**
|
||||
* Should the mana in this item be prioritized over the mana in
|
||||
* other items? Generally set to false for generic containers
|
||||
* and true for tools and the like.
|
||||
*/
|
||||
public boolean isPriorityItem(ItemStack stack);
|
||||
}
|
||||
@@ -22,4 +22,10 @@ package vazkii.botania.api.mana;
|
||||
*/
|
||||
public interface IManaPool extends IManaReceiver {
|
||||
|
||||
/**
|
||||
* Returns false if the mana pool is accepting power from other power items,
|
||||
* true if it's sending power into them.
|
||||
*/
|
||||
public boolean isOutputtingPower();
|
||||
|
||||
}
|
||||
@@ -153,6 +153,11 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
public boolean canRecieveManaFromBursts() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutputtingPower() {
|
||||
return false; // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentMana() {
|
||||
|
||||
Reference in new issue
Block a user