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
ConstructorDescriptionAndroidFarmEvent
(Block block, AndroidInstance android, boolean isAdvanced, ItemStack drop) -
Method Summary
Modifier and TypeMethodDescriptionThis method returns theAndroidInstance
who triggered thisEvent
getBlock()
This method returns the minedBlock
getDrop()
This returns the harvested item or null.static HandlerList
boolean
Whether this was invoked via an advanced farming actionboolean
void
setCancelled
(boolean cancel) void
This will set theItemStack
result.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 harvestedBlock
android
- TheAndroidInstance
that triggered thisEvent
isAdvanced
- 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 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 interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlerList
-
getHandlers
- Specified by:
getHandlers
in classEvent
-