Files
MinecraftForge/src/main/java/net/minecraftforge/common/IShearable.java
T
Lex Manos 53659fca06 Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 00:00:54 -08:00

50 lines
1.8 KiB
Java

package net.minecraftforge.common;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
/**
*
* 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
* @param pos Block's position in world.
* @return If this is shearable, and onSheared should be called.
*/
public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos);
/**
* 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, and removal of the block.
* As those are handled by ItemShears itself.
*
* 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
* @param pos If this is a block, the block's position in world.
* @param fortune The fortune level of the shears being used
* @return A ArrayList containing all items from this shearing. Possible to be null.
*/
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune);
}