Class AndroidFarmEvent

java.lang.Object
org.bukkit.event.Event
io.github.thebusybiscuit.slimefun4.api.events.AndroidFarmEvent
All Implemented Interfaces:
Cancellable

public class AndroidFarmEvent extends Event implements Cancellable
This Event is fired before a FarmerAndroid harvests a Block. If this Event is cancelled, the Block will not be harvested.

The Event will still be fired for non-harvestable blocks.

Author:
TheBusyBiscuit
  • Constructor Details

    • AndroidFarmEvent

      public AndroidFarmEvent(@Nonnull Block block, @Nonnull AndroidInstance android, boolean isAdvanced, @Nullable ItemStack drop)
      Parameters:
      block - The harvested Block
      android - The AndroidInstance that triggered this Event
      isAdvanced - Whether this is an advanced farming action
      drop - The item to be dropped or null
  • Method Details

    • getBlock

      @Nonnull public Block getBlock()
      This method returns the mined Block
      Returns:
      the mined Block
    • getDrop

      @Nullable public ItemStack getDrop()
      This returns the harvested item or null.
      Returns:
      The harvested item or null
    • isAdvanced

      public boolean isAdvanced()
      Whether this was invoked via an advanced farming action
      Returns:
      Whether it is advanced
    • setDrop

      public void setDrop(@Nullable ItemStack drop)
      This will set the ItemStack result.
      Parameters:
      drop - The result or null
    • getAndroid

      @Nonnull public AndroidInstance getAndroid()
      This method returns the AndroidInstance who triggered this Event
      Returns:
      the involved AndroidInstance
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlerList

      @Nonnull public static HandlerList getHandlerList()
    • getHandlers

      @Nonnull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event