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 theAndroidInstance
who triggered thisEvent
org.bukkit.block.Block
getBlock()
This method returns the minedBlock
org.bukkit.inventory.ItemStack
getDrop()
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 actionboolean
void
setCancelled
(boolean cancel) void
setDrop
(org.bukkit.inventory.ItemStack drop) This will set theItemStack
result.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 harvestedBlock
android
- TheAndroidInstance
that triggered thisEvent
isAdvanced
- 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 theItemStack
result.- Parameters:
drop
- The result or null
-
getAndroid
This method returns theAndroidInstance
who triggered thisEvent
- Returns:
- the involved
AndroidInstance
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlerList
@Nonnull public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@Nonnull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-