YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraftforge.common.IShearable Interface Reference
Inheritance diagram for net.minecraftforge.common.IShearable:
net.minecraft.block.BlockLeaves net.minecraft.block.BlockTallGrass net.minecraft.block.BlockVine net.minecraft.entity.passive.EntityMooshroom net.minecraft.entity.passive.EntitySheep

Public Member Functions

boolean isShearable (ItemStack item, World world, int x, int y, int z)
 
ArrayList< ItemStackonSheared (ItemStack item, World world, int x, int y, int z, int fortune)
 

Detailed Description

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.

Member Function Documentation

boolean net.minecraftforge.common.IShearable.isShearable ( ItemStack  item,
World  world,
int  x,
int  y,
int  z 
)

Checks if the object is currently shearable Example: Sheep return false when they have no wool

Parameters
itemThe itemstack that is being used, Possible to be null
worldThe current world
xThe X Position
yThe Y Position
zThe Z Position
Returns
If this is shearable, and onSheared should be called.

Implemented in net.minecraft.block.BlockVine, net.minecraft.block.BlockLeaves, net.minecraft.entity.passive.EntitySheep, net.minecraft.block.BlockTallGrass, and net.minecraft.entity.passive.EntityMooshroom.

ArrayList<ItemStack> net.minecraftforge.common.IShearable.onSheared ( ItemStack  item,
World  world,
int  x,
int  y,
int  z,
int  fortune 
)

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, except for dropping of the items.

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.

Parameters
itemThe itemstack that is being used, Possible to be null
worldThe current world
xThe X Position
yThe Y Position
zThe Z Position
fortuneThe fortune level of the shears being used
Returns
A ArrayList containing all items from this shearing. Possible to be null.

Implemented in net.minecraft.block.BlockVine, net.minecraft.block.BlockLeaves, net.minecraft.entity.passive.EntitySheep, net.minecraft.block.BlockTallGrass, and net.minecraft.entity.passive.EntityMooshroom.


The documentation for this interface was generated from the following file: