Package forestry.api.farming
Interface IFarmListener
public interface IFarmListener
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterCropHarvest(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 booleanbeforeCropHarvest(ICrop crop) Called before a crop is harvested.default booleancancelTask(IFarmLogic logic, net.minecraft.core.Direction direction) Can be used to cancel farm task on a per side/IFarmLogicbasis.default voidhasCollected(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 voidhasCultivated(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 voidhasScheduledHarvest(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
Called before a crop is harvested.- Parameters:
crop- ICrop about to be harvested.- Returns:
- true to cancel further processing of this crop.
-
afterCropHarvest
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- HarvestedICrop
-
hasCollected
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
Can be used to cancel farm task on a per side/IFarmLogicbasis.- Returns:
- true to skip any work action on the given logic and direction for this work cycle.
-