Interface IFarmListener


public interface IFarmListener
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    afterCropHarvest(List<net.minecraft.world.item.ItemStack> harvested, ICrop crop)
    Called after a crop has been harvested, but before harvested items are stowed in the farms inventory.
    default boolean
    Called before a crop is harvested.
    default boolean
    cancelTask(IFarmLogic logic, net.minecraft.core.Direction direction)
    Can be used to cancel farm task on a per side/IFarmLogic basis.
    default void
    hasCollected(List<net.minecraft.world.item.ItemStack> collected, IFarmLogic logic)
    Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue.
    default void
    hasCultivated(IFarmLogic logic, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction, int extent)
    Called after farmland has successfully been cultivated by a farm logic.
    default void
    hasScheduledHarvest(Collection<ICrop> harvested, IFarmLogic logic, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction, int extent)
    Called after the stack of harvested crops has been returned by the farm logic, but before it is added to the farm's pending queue.
  • Method Details

    • beforeCropHarvest

      default boolean beforeCropHarvest(ICrop crop)
      Called before a crop is harvested.
      Parameters:
      crop - ICrop about to be harvested.
      Returns:
      true to cancel further processing of this crop.
    • afterCropHarvest

      default void afterCropHarvest(List<net.minecraft.world.item.ItemStack> harvested, ICrop crop)
      Called after a crop has been harvested, but before harvested items are stowed in the farms inventory.
      Parameters:
      harvested - Collection of harvested stacks. May be manipulated. Ensure removal of stacks with 0 or less items!
      crop - Harvested ICrop
    • hasCollected

      default void hasCollected(List<net.minecraft.world.item.ItemStack> collected, IFarmLogic logic)
      Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue.
      Parameters:
      collected - Collection of collected stacks. May be manipulated. Ensure removal of stacks with 0 or less items!
    • hasCultivated

      default void hasCultivated(IFarmLogic logic, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction, int extent)
      Called after farmland has successfully been cultivated by a farm logic.
    • hasScheduledHarvest

      default void hasScheduledHarvest(Collection<ICrop> harvested, IFarmLogic logic, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction, int extent)
      Called after the stack of harvested crops has been returned by the farm logic, but before it is added to the farm's pending queue.
    • cancelTask

      default boolean cancelTask(IFarmLogic logic, net.minecraft.core.Direction direction)
      Can be used to cancel farm task on a per side/IFarmLogic basis.
      Returns:
      true to skip any work action on the given logic and direction for this work cycle.