Updated CoFH API
This commit is contained in:
parent
77c68b05bf
commit
1580d968ec
5 changed files with 81 additions and 1 deletions
|
@ -6,6 +6,6 @@ public class CoFHAPIProps {
|
|||
|
||||
}
|
||||
|
||||
public static final String VERSION = "1.7.10R1.0.1";
|
||||
public static final String VERSION = "1.7.10R1.0.10";
|
||||
|
||||
}
|
||||
|
|
41
src/api/java/cofh/api/item/IEmpowerableItem.java
Normal file
41
src/api/java/cofh/api/item/IEmpowerableItem.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package cofh.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes which may be "Empowered" - what that means is completely up to you. This just provides a uniform way of dealing with
|
||||
* them.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEmpowerableItem {
|
||||
|
||||
/**
|
||||
* Check whether or not a given item is currently in an empowered state.
|
||||
*/
|
||||
boolean isEmpowered(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Attempt to set the empowered state of the item.
|
||||
*
|
||||
* @param stack
|
||||
* ItemStack to be empowered/disempowered.
|
||||
* @param state
|
||||
* Desired state.
|
||||
* @return TRUE if the operation was successful, FALSE if it was not.
|
||||
*/
|
||||
boolean setEmpoweredState(ItemStack stack, boolean state);
|
||||
|
||||
/**
|
||||
* Callback method for reacting to a state change. Useful in KeyBinding handlers.
|
||||
*
|
||||
* @param player
|
||||
* Player holding the item, if applicable.
|
||||
* @param stack
|
||||
* The item being held.
|
||||
*/
|
||||
void onStateChange(EntityPlayer player, ItemStack stack);
|
||||
|
||||
}
|
20
src/api/java/cofh/api/item/IInventoryContainerItem.java
Normal file
20
src/api/java/cofh/api/item/IInventoryContainerItem.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package cofh.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that are themselves inventories.
|
||||
*
|
||||
* A reference implementation is provided {@link ItemInventoryContainer}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IInventoryContainerItem {
|
||||
|
||||
/**
|
||||
* Get the size of this inventory of this container item.
|
||||
*/
|
||||
int getSizeInventory(ItemStack container);
|
||||
|
||||
}
|
10
src/api/java/cofh/api/item/package-info.java
Normal file
10
src/api/java/cofh/api/item/package-info.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* (C) 2014 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|item")
|
||||
package cofh.api.item;
|
||||
|
||||
import cofh.api.CoFHAPIProps;
|
||||
import cpw.mods.fml.common.API;
|
||||
|
9
src/api/java/cofh/api/package-info.java
Normal file
9
src/api/java/cofh/api/package-info.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* (C) 2014 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI")
|
||||
package cofh.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
|
Loading…
Reference in a new issue