Updated CoFH API

This commit is contained in:
Aidan C. Brady 2015-03-16 11:12:48 -04:00
parent 77c68b05bf
commit 1580d968ec
5 changed files with 81 additions and 1 deletions

View file

@ -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";
}

View 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);
}

View 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);
}

View 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;

View 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;