Class AndroidFarmEvent

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

public class AndroidFarmEvent extends org.bukkit.event.Event implements org.bukkit.event.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
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    AndroidFarmEvent(org.bukkit.block.Block block, AndroidInstance android, boolean isAdvanced, org.bukkit.inventory.ItemStack drop)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    This method returns the AndroidInstance who triggered this Event
    org.bukkit.block.Block
    This method returns the mined Block
    org.bukkit.inventory.ItemStack
    This returns the harvested item or null.
    static org.bukkit.event.HandlerList
     
    org.bukkit.event.HandlerList
     
    boolean
    Whether this was invoked via an advanced farming action
    boolean
     
    void
    setCancelled(boolean cancel)
     
    void
    setDrop(org.bukkit.inventory.ItemStack drop)
    This will set the ItemStack result.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AndroidFarmEvent

      public AndroidFarmEvent(@Nonnull org.bukkit.block.Block block, @Nonnull AndroidInstance android, boolean isAdvanced, @Nullable org.bukkit.inventory.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 org.bukkit.block.Block getBlock()
      This method returns the mined Block
      Returns:
      the mined Block
    • getDrop

      @Nullable public org.bukkit.inventory.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 org.bukkit.inventory.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 org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlerList

      @Nonnull public static org.bukkit.event.HandlerList getHandlerList()
    • getHandlers

      @Nonnull public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event