Class BoxCraftEvent
java.lang.Object
net.okocraft.box.api.event.BoxEvent
net.okocraft.box.feature.craft.event.BoxCraftEvent
- All Implemented Interfaces:
Cancellable
An event that called when the
Player
is crafting items in Box.-
Constructor Summary
ConstructorDescriptionBoxCraftEvent
(@NotNull org.bukkit.entity.Player crafter, @NotNull SelectedRecipe selectedRecipe, int times) The constructor ofBoxCraftEvent
. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.entity.Player
Gets the player who is trying to craft.@NotNull SelectedRecipe
Gets the recipe to craft.int
getTimes()
Gets the number of times to craft.boolean
Gets if the event has been cancelled.void
setCancelled
(boolean cancel) Sets the cancel status of the event.@NotNull String
Creates the debug log from this event.toString()
-
Constructor Details
-
BoxCraftEvent
public BoxCraftEvent(@NotNull @NotNull org.bukkit.entity.Player crafter, @NotNull @NotNull SelectedRecipe selectedRecipe, int times) The constructor ofBoxCraftEvent
.- Parameters:
crafter
- thePlayer
who craft itemsselectedRecipe
- theSelectedRecipe
used to craft itemstimes
- the number of times crafted
-
-
Method Details
-
getCrafter
@NotNull public @NotNull org.bukkit.entity.Player getCrafter()Gets the player who is trying to craft.- Returns:
- the player who is trying to craft
-
getSelectedRecipe
Gets the recipe to craft.- Returns:
- the recipe to craft
-
getTimes
public int getTimes()Gets the number of times to craft.- Returns:
- the number of times to craft
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Gets if the event has been cancelled.- Specified by:
isCancelled
in interfaceCancellable
- Returns:
true
if canceled,false
otherwise.
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:Cancellable
Sets the cancel status of the event.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
-true
to cancel,false
to not.
-
toString
-
toDebugLog
Description copied from class:BoxEvent
Creates the debug log from this event.- Overrides:
toDebugLog
in classBoxEvent
- Returns:
- the debug log
-