Class MultiBlockCraftEvent

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

public class MultiBlockCraftEvent extends PlayerEvent implements 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
  • Constructor Details

    • MultiBlockCraftEvent

      @ParametersAreNonnullByDefault public MultiBlockCraftEvent(Player p, MultiBlockMachine machine, ItemStack[] input, 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(Player p, MultiBlockMachine machine, ItemStack input, 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 ItemStack[] getInput()
      Gets the input of the craft.
      Returns:
      The ItemStack[] input that is used in the craft.
    • getOutput

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

      @Nullable public ItemStack setOutput(@Nullable 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 Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlerList

      @Nonnull public static HandlerList getHandlerList()
    • getHandlers

      @Nonnull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event