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
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
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionMultiBlockCraftEvent(Player p, MultiBlockMachine machine, ItemStack[] input, ItemStack output) Creates a newMultiBlockCraftEvent.MultiBlockCraftEvent(Player p, MultiBlockMachine machine, ItemStack input, ItemStack output) Creates a newMultiBlockCraftEvent. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListgetInput()Gets the input of the craft.Gets the machine that was used to craft.Gets the output of the craft.booleanvoidsetCancelled(boolean cancel) Sets the output of the craft.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
MultiBlockCraftEvent
@ParametersAreNonnullByDefault public MultiBlockCraftEvent(Player p, MultiBlockMachine machine, ItemStack[] input, 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(Player p, MultiBlockMachine machine, ItemStack input, 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
Gets the input of the craft.- Returns:
- The
ItemStack[]input that is used in the craft.
-
getOutput
Gets the output of the craft.- Returns:
- The
ItemStackoutput that results from the craft.
-
setOutput
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 interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceCancellable
-
getHandlerList
-
getHandlers
- Specified by:
getHandlersin classEvent
-