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
ConstructorsConstructorDescriptionMultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack[] input, org.bukkit.inventory.ItemStack output) Creates a newMultiBlockCraftEvent.MultiBlockCraftEvent(org.bukkit.entity.Player p, MultiBlockMachine machine, org.bukkit.inventory.ItemStack input, org.bukkit.inventory.ItemStack output) Creates a newMultiBlockCraftEvent. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.inventory.ItemStack[]getInput()Gets the input of the craft.Gets the machine that was used to craft.org.bukkit.inventory.ItemStackGets the output of the craft.booleanvoidsetCancelled(boolean cancel) org.bukkit.inventory.ItemStacksetOutput(org.bukkit.inventory.ItemStack output) Sets the output of the craft.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 newMultiBlockCraftEvent.- Parameters:
p- The player that crafts using a multiblockmachine- The multiblock machine used to craftinput- The input items of the craftoutput- 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 newMultiBlockCraftEvent.- Parameters:
p- The player that crafts using a multiblockmachine- The multiblock machine used to craftinput- The input item of the craftoutput- The resulting item of the craft
-
-
Method Details
-
getMachine
Gets the machine that was used to craft.- Returns:
- The
MultiBlockMachineused 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
ItemStackoutput 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
ItemStackoutput that was replaced.
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlerList
@Nonnull public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
@Nonnull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-