Class BoxCraftEvent

java.lang.Object
net.okocraft.box.api.event.BoxEvent
net.okocraft.box.feature.craft.event.BoxCraftEvent
All Implemented Interfaces:
Cancellable

public class BoxCraftEvent extends BoxEvent implements Cancellable
An event that called when the Player is crafting items in Box.
  • Constructor Details

    • BoxCraftEvent

      public BoxCraftEvent(@NotNull @NotNull org.bukkit.entity.Player crafter, @NotNull @NotNull SelectedRecipe selectedRecipe, int times)
      The constructor of BoxCraftEvent.
      Parameters:
      crafter - the Player who craft items
      selectedRecipe - the SelectedRecipe used to craft items
      times - 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

      @NotNull public @NotNull SelectedRecipe 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 interface Cancellable
      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 interface Cancellable
      Parameters:
      cancel - true to cancel, false to not.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDebugLog

      @NotNull public @NotNull String toDebugLog()
      Description copied from class: BoxEvent
      Creates the debug log from this event.
      Overrides:
      toDebugLog in class BoxEvent
      Returns:
      the debug log