Package wtf.choco.alchema.api.event
Class CauldronIngredientAddEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
wtf.choco.alchema.api.event.CauldronEvent
wtf.choco.alchema.api.event.CauldronIngredientAddEvent
public class CauldronIngredientAddEvent extends CauldronEvent
Called when an
Item consumed by an AlchemicalCauldron and an ingredient
is added to the cauldron.
By default, a CauldronIngredientItemStack is added. This event should be used
to change the implementation inserted into the cauldron for more accurate recipe
calculation.
- 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 CauldronIngredientAddEvent(@NotNull AlchemicalCauldron cauldron, @NotNull CauldronIngredient ingredient, @NotNull org.bukkit.entity.Item item)Construct a newCauldronIngredientAddEvent. -
Method Summary
Modifier and Type Method Description static @NotNull org.bukkit.event.HandlerListgetHandlerList()Get the HandlerList instance for this event.@NotNull org.bukkit.event.HandlerListgetHandlers()@NotNull CauldronIngredientgetIngredient()Get theCauldronIngredientimplementation to be added to the cauldron.@NotNull org.bukkit.entity.ItemgetItem()Get theItemthat was thrown into the cauldron to cause this event.@NotNull org.bukkit.inventory.ItemStackgetItemStack()Get theItemStackthat was thrown into the cauldron to cause this event.@Nullable org.bukkit.OfflinePlayergetPlayer()Get the player that threw theIteminto the cauldron to cause this event (if there is one).@Nullable java.util.UUIDgetPlayerUUID()Get the UUID of the player that threw theIteminto the cauldron to cause this event (if there is one).voidsetIngredient(@NotNull CauldronIngredient ingredient)Set theCauldronIngredientimplementation to be added to the cauldron.Methods inherited from class wtf.choco.alchema.api.event.CauldronEvent
getCauldronMethods inherited from class org.bukkit.event.block.BlockEvent
getBlockMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CauldronIngredientAddEvent
public CauldronIngredientAddEvent(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull CauldronIngredient ingredient, @NotNull @NotNull org.bukkit.entity.Item item)Construct a newCauldronIngredientAddEvent.- Parameters:
cauldron- the cauldron that caused the craftingredient- the ingredient to be added to the cauldronitem- the item thrown into the cauldron
-
-
Method Details
-
setIngredient
Set theCauldronIngredientimplementation to be added to the cauldron.By default, a
CauldronIngredientItemStackis added to anAlchemicalCauldronwhen anItemis dropped inside. This method should be used to change the implementation inserted into the cauldron for more accurate recipe calculation.- Parameters:
ingredient- the ingredient to set
-
getIngredient
Get theCauldronIngredientimplementation to be added to the cauldron.- Returns:
- the ingredient
-
getItem
@NotNull public @NotNull org.bukkit.entity.Item getItem()Get theItemthat was thrown into the cauldron to cause this event.NOTE: The item returned by this method will be destroyed by implementation after all event listeners have been called upon. Therefore it is best not to rely on the validity of the Item entity returned by this method.
- Returns:
- the item
-
getItemStack
@NotNull public @NotNull org.bukkit.inventory.ItemStack getItemStack()Get theItemStackthat was thrown into the cauldron to cause this event. This is a convenience method and is equivalent togetItem().getItemStack().- Returns:
- the item stack
-
getPlayerUUID
@Nullable public @Nullable java.util.UUID getPlayerUUID()Get the UUID of the player that threw theIteminto the cauldron to cause this event (if there is one).- Returns:
- the thrower UUID. null if none
-
getPlayer
@Nullable public @Nullable org.bukkit.OfflinePlayer getPlayer()Get the player that threw theIteminto the cauldron to cause this event (if there is one).- Returns:
- the thrower. null if none
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Get the HandlerList instance for this event.- Returns:
- the handler list
-