Interface IForgeShearable

    • Method Detail

      • isShearable

        default boolean isShearable​(@Nonnull
                                    ItemStack item,
                                    World world,
                                    BlockPos pos)
        Checks if the object is currently shearable Example: Sheep return false when they have no wool
        Parameters:
        item - The ItemStack that is being used, may be empty.
        world - The current world.
        pos - Block's position in world.
        Returns:
        If this is shearable, and onSheared should be called.
      • onSheared

        @Nonnull
        default java.util.List<ItemStack> onSheared​(@Nullable
                                                    PlayerEntity player,
                                                    @Nonnull
                                                    ItemStack item,
                                                    World world,
                                                    BlockPos pos,
                                                    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, 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.
        Parameters:
        item - The ItemStack that is being used, may be empty.
        world - The current world.
        pos - If this is a block, the block's position in world.
        fortune - The fortune level of the shears being used.
        Returns:
        A List containing all items from this shearing. May be empty.