Class CauldronItemCraftEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
wtf.choco.alchema.api.event.CauldronEvent
wtf.choco.alchema.api.event.CauldronItemCraftEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class CauldronItemCraftEvent
extends CauldronEvent
implements org.bukkit.event.Cancellable
Called when an AlchemicalCauldron has successfully prepared a crafting recipe.
Author:
Parker Hawke - Choco
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor Description
    CauldronItemCraftEvent​(@NotNull AlchemicalCauldron cauldron, @NotNull CauldronRecipe recipe, @Nullable org.bukkit.entity.Player player)
    Construct a new CauldronItemCraftEvent.
    CauldronItemCraftEvent​(@NotNull AlchemicalCauldron cauldron, @NotNull CauldronRecipe recipe, @Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack result, int experience)
    Construct a new CauldronItemCraftEvent with a result.
  • Method Summary

    Modifier and Type Method Description
    int getExperience()
    Get the experience yielded from this craft.
    static @NotNull org.bukkit.event.HandlerList getHandlerList()
    Get the HandlerList instance for this event.
    @NotNull org.bukkit.event.HandlerList getHandlers()  
    @Nullable org.bukkit.entity.Player getPlayer()
    Get the player that (most likely) caused this event (if any).
    @NotNull CauldronRecipe getRecipe()
    Get the recipe that was prepared for this event.
    @Nullable org.bukkit.inventory.ItemStack getResult()
    Get the resulting ItemStack for this cauldron crafting process.
    boolean isCancelled()  
    void setCancelled​(boolean cancel)  
    void setExperience​(int experience)
    Set the experience yielded from this craft.
    void setResult​(@Nullable org.bukkit.inventory.ItemStack result)
    Set the resulting ItemStack of the cauldron crafting process.

    Methods inherited from class wtf.choco.alchema.api.event.CauldronEvent

    getCauldron

    Methods inherited from class org.bukkit.event.block.BlockEvent

    getBlock

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CauldronItemCraftEvent

      public CauldronItemCraftEvent​(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull CauldronRecipe recipe, @Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.inventory.ItemStack result, int experience)
      Construct a new CauldronItemCraftEvent with a result.
      Parameters:
      cauldron - the cauldron that caused the craft
      recipe - the recipe that was crafted
      player - the player that caused this craft event. Can be null
      result - the result of the recipe. May not necessarily be equal to CauldronRecipe.getResult()
      experience - the experience yielded from the recipe
    • CauldronItemCraftEvent

      public CauldronItemCraftEvent​(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull CauldronRecipe recipe, @Nullable @Nullable org.bukkit.entity.Player player)
      Construct a new CauldronItemCraftEvent.
      Parameters:
      cauldron - the cauldron that caused the craft
      recipe - the recipe that was crafted
      player - the player that caused this craft event. Can be null
  • Method Details

    • getRecipe

      @NotNull public @NotNull CauldronRecipe getRecipe()
      Get the recipe that was prepared for this event.
      Returns:
      the recipe
    • getPlayer

      @Nullable public @Nullable org.bukkit.entity.Player getPlayer()
      Get the player that (most likely) caused this event (if any).
      Returns:
      the player that crafted. null if none
    • setResult

      public void setResult​(@Nullable @Nullable org.bukkit.inventory.ItemStack result)
      Set the resulting ItemStack of the cauldron crafting process. Null if none.
      Parameters:
      result - the result to set
    • getResult

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getResult()
      Get the resulting ItemStack for this cauldron crafting process.
      Returns:
      the result
    • setExperience

      public void setExperience​(int experience)
      Set the experience yielded from this craft.
      Parameters:
      experience - the experience to set. Must be 0 or positive
    • getExperience

      public int getExperience()
      Get the experience yielded from this craft.
      Returns:
      the experience
    • setCancelled

      public void setCancelled​(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Get the HandlerList instance for this event.
      Returns:
      the handler list