Class AndroidFarmEvent
java.lang.Object
org.bukkit.event.Event
io.github.thebusybiscuit.slimefun4.api.events.AndroidFarmEvent
- All Implemented Interfaces:
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
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionAndroidFarmEvent(Block block, AndroidInstance android, boolean isAdvanced, ItemStack drop) -
Method Summary
Modifier and TypeMethodDescriptionThis method returns theAndroidInstancewho triggered thisEventgetBlock()This method returns the minedBlockgetDrop()This returns the harvested item or null.static HandlerListbooleanWhether this was invoked via an advanced farming actionbooleanvoidsetCancelled(boolean cancel) voidThis will set theItemStackresult.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AndroidFarmEvent
public AndroidFarmEvent(@Nonnull Block block, @Nonnull AndroidInstance android, boolean isAdvanced, @Nullable 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
This method returns the minedBlock- Returns:
- the mined
Block
-
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
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 interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceCancellable
-
getHandlerList
-
getHandlers
- Specified by:
getHandlersin classEvent
-