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
ConstructorsConstructorDescriptionAndroidFarmEvent(org.bukkit.block.Block block, AndroidInstance android, boolean isAdvanced, org.bukkit.inventory.ItemStack drop) -
Method Summary
Modifier and TypeMethodDescriptionThis method returns theAndroidInstancewho triggered thisEventorg.bukkit.block.BlockgetBlock()This method returns the minedBlockorg.bukkit.inventory.ItemStackgetDrop()This returns the harvested item or null.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListbooleanWhether this was invoked via an advanced farming actionbooleanvoidsetCancelled(boolean cancel) voidsetDrop(org.bukkit.inventory.ItemStack drop) This will set theItemStackresult.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 harvestedBlockandroid- TheAndroidInstancethat triggered thisEventisAdvanced- Whether this is an advanced farming actiondrop- The item to be dropped or null
-
-
Method Details
-
getBlock
@Nonnull public org.bukkit.block.Block getBlock()This method returns the minedBlock- 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 theItemStackresult.- Parameters:
drop- The result or null
-
getAndroid
This method returns theAndroidInstancewho triggered thisEvent- Returns:
- the involved
AndroidInstance
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlerList
@Nonnull public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@Nonnull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-