2012-08-05 19:41:18 -07:00
|
|
|
package net.minecraftforge.common;
|
2012-02-24 22:07:58 -08:00
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2014-11-25 19:56:35 -08:00
|
|
|
import java.util.List;
|
2012-12-12 21:58:35 -08:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-11-25 19:56:35 -08:00
|
|
|
import net.minecraft.util.BlockPos;
|
2013-12-21 00:10:35 -08:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2012-02-24 22:07:58 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* This allows for mods to create there own Shear-like items
|
|
|
|
|
* and have them interact with Blocks/Entities without extra work.
|
|
|
|
|
* Also, if your block/entity supports the Shears, this allows you
|
|
|
|
|
* to support mod-shears as well.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public interface IShearable
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Checks if the object is currently shearable
|
|
|
|
|
* Example: Sheep return false when they have no wool
|
|
|
|
|
*
|
|
|
|
|
* @param item The itemstack that is being used, Possible to be null
|
|
|
|
|
* @param world The current world
|
2014-11-25 19:56:35 -08:00
|
|
|
* @param pos Block's position in world.
|
2012-02-24 22:07:58 -08:00
|
|
|
* @return If this is shearable, and onSheared should be called.
|
|
|
|
|
*/
|
2014-11-25 19:56:35 -08:00
|
|
|
public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos);
|
2012-02-24 22:07:58 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Performs the shear function on this object.
|
|
|
|
|
* This is called for both client, and server.
|
|
|
|
|
* The object should perform all actions related to being sheared,
|
2014-05-26 11:26:53 -07:00
|
|
|
* except for dropping of the items, and removal of the block.
|
|
|
|
|
* As those are handled by ItemShears itself.
|
2012-02-24 22:07:58 -08:00
|
|
|
*
|
|
|
|
|
* Returns a list of items that resulted from the shearing process.
|
|
|
|
|
*
|
|
|
|
|
* For entities, they should trust there internal location information
|
|
|
|
|
* over the values passed into this function.
|
|
|
|
|
*
|
|
|
|
|
* @param item The itemstack that is being used, Possible to be null
|
|
|
|
|
* @param world The current world
|
2014-11-25 19:56:35 -08:00
|
|
|
* @param pos If this is a block, the block's position in world.
|
2012-02-24 22:07:58 -08:00
|
|
|
* @param fortune The fortune level of the shears being used
|
|
|
|
|
* @return A ArrayList containing all items from this shearing. Possible to be null.
|
|
|
|
|
*/
|
2014-11-25 19:56:35 -08:00
|
|
|
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune);
|
2012-02-24 22:07:58 -08:00
|
|
|
}
|