Class MultiBlockCraftEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.github.thebusybiscuit.slimefun4.api.events.MultiBlockCraftEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class MultiBlockCraftEvent extends org.bukkit.event.player.PlayerEvent implements org.bukkit.event.Cancellable
This Event is called when a Player crafts an item using a MultiBlockMachine. Unlike the MultiBlockInteractEvent, this event only fires if an output to a craft is expected. If this event is cancelled, ingredients will not be consumed and no output item results.
Author:
char321, JustAHuman
  • Nested Class Summary

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

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

    Fields inherited from class org.bukkit.event.player.PlayerEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack[] input, org.bukkit.inventory.ItemStack output)
    Creates a new MultiBlockCraftEvent.
    MultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack input, org.bukkit.inventory.ItemStack output)
    Creates a new MultiBlockCraftEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
     
    org.bukkit.event.HandlerList
     
    org.bukkit.inventory.ItemStack[]
    Gets the input of the craft.
    Gets the machine that was used to craft.
    org.bukkit.inventory.ItemStack
    Gets the output of the craft.
    boolean
     
    void
    setCancelled(boolean cancel)
     
    org.bukkit.inventory.ItemStack
    setOutput(org.bukkit.inventory.ItemStack output)
    Sets the output of the craft.

    Methods inherited from class org.bukkit.event.player.PlayerEvent

    getPlayer

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • MultiBlockCraftEvent

      @ParametersAreNonnullByDefault public MultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack[] input, org.bukkit.inventory.ItemStack output)
      Creates a new MultiBlockCraftEvent.
      Parameters:
      p - The player that crafts using a multiblock
      machine - The multiblock machine used to craft
      input - The input items of the craft
      output - The resulting item of the craft
    • MultiBlockCraftEvent

      @ParametersAreNonnullByDefault public MultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack input, org.bukkit.inventory.ItemStack output)
      Creates a new MultiBlockCraftEvent.
      Parameters:
      p - The player that crafts using a multiblock
      machine - The multiblock machine used to craft
      input - The input item of the craft
      output - The resulting item of the craft
  • Method Details

    • getMachine

      @Nonnull public MultiBlockMachine getMachine()
      Gets the machine that was used to craft.
      Returns:
      The MultiBlockMachine used to craft.
    • getInput

      @Nonnull public org.bukkit.inventory.ItemStack[] getInput()
      Gets the input of the craft.
      Returns:
      The ItemStack[] input that is used in the craft.
    • getOutput

      @Nonnull public org.bukkit.inventory.ItemStack getOutput()
      Gets the output of the craft.
      Returns:
      The ItemStack output that results from the craft.
    • setOutput

      @Nullable public org.bukkit.inventory.ItemStack setOutput(@Nullable org.bukkit.inventory.ItemStack output)
      Sets the output of the craft. Keep in mind that this overwrites any existing output.
      Parameters:
      output - The new item for the event to produce.
      Returns:
      The previous ItemStack output that was replaced.
    • isCancelled

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

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

      @Nonnull public static org.bukkit.event.HandlerList getHandlerList()
    • getHandlers

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