Package wtf.choco.alchema.util
Class AlchemaEventFactory
java.lang.Object
wtf.choco.alchema.util.AlchemaEventFactory
public final class AlchemaEventFactory
extends java.lang.Object
A utility class to more easily call the various events in Alchema.
- Author:
- Parker Hawke - Choco
-
Method Summary
Modifier and Type Method Description static @NotNull CauldronIngredientAddEvent
callCauldronIngredientAddEvent(@NotNull AlchemicalCauldron cauldron, @NotNull CauldronIngredient ingredient, @NotNull org.bukkit.entity.Item item)
Call and return theCauldronIngredientAddEvent
.static @NotNull CauldronIngredientsDropEvent
callCauldronIngredientsDropEvent(@NotNull AlchemicalCauldron cauldron, @NotNull java.util.Collection<@NotNull org.bukkit.entity.Item> items, @Nullable org.bukkit.entity.Player player, CauldronIngredientsDropEvent.Reason reason)
Call and return theCauldronIngredientsDropEvent
.static @NotNull CauldronItemCraftEvent
callCauldronItemCraftEvent(@NotNull AlchemicalCauldron cauldron, @NotNull CauldronRecipe recipe, @Nullable org.bukkit.entity.Player player)
Call and return theCauldronItemCraftEvent
.static void
callCauldronRecipeRegisterEvent(@NotNull CauldronRecipeRegistry recipeRegistry)
Call theCauldronRecipeRegisterEvent
.static @NotNull EntityDamageByCauldronEvent
callEntityDamageByCauldronEvent(@NotNull org.bukkit.entity.LivingEntity entity, @NotNull AlchemicalCauldron cauldron, double damage)
Call and return theEntityDamageByCauldronEvent
.static @NotNull EntityDeathByCauldronEvent
callEntityDeathByCauldronEvent(@NotNull org.bukkit.entity.LivingEntity entity, @NotNull AlchemicalCauldron cauldron, int essence)
Call and return theEntityDamageByCauldronEvent
.static @NotNull EntityDropEssenceEvent
callEntityDropEssenceEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull EntityEssenceData essenceData, int amountOfEssence)
Call and return theEntityDropEssenceEvent
.static @NotNull PlayerConsumeEntityEssenceEvent
callPlayerConsumeEntityEssenceEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack item, @NotNull EntityEssenceData essenceData)
Call and return thePlayerConsumeEntityEssenceEvent
.static @NotNull PlayerEssenceCollectEvent
callPlayerEssenceCollectEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.EquipmentSlot hand, @NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.entity.Entity entity, @NotNull EntityEssenceData essenceData, int essenceAmount)
Call and return thePlayerEssenceCollectEvent
.static boolean
handleCauldronBubbleEvent(@NotNull AlchemicalCauldron cauldron)
Handle theCauldronBubbleEvent
and return whether or not it's cancelled.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
callEntityDamageByCauldronEvent
@NotNull public static @NotNull EntityDamageByCauldronEvent callEntityDamageByCauldronEvent(@NotNull @NotNull org.bukkit.entity.LivingEntity entity, @NotNull @NotNull AlchemicalCauldron cauldron, double damage)Call and return theEntityDamageByCauldronEvent
.- Parameters:
entity
- the damaged entitycauldron
- the cauldrondamage
- the damage inflicted- Returns:
- the event
-
callEntityDeathByCauldronEvent
@NotNull public static @NotNull EntityDeathByCauldronEvent callEntityDeathByCauldronEvent(@NotNull @NotNull org.bukkit.entity.LivingEntity entity, @NotNull @NotNull AlchemicalCauldron cauldron, int essence)Call and return theEntityDamageByCauldronEvent
.- Parameters:
entity
- the damaged entitycauldron
- the cauldronessence
- the amount of essence to be inserted into the cauldron- Returns:
- the event
-
callEntityDropEssenceEvent
@NotNull public static @NotNull EntityDropEssenceEvent callEntityDropEssenceEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull EntityEssenceData essenceData, int amountOfEssence)Call and return theEntityDropEssenceEvent
.- Parameters:
entity
- the entity dropping the essenceessenceData
- the essence data of the entityamountOfEssence
- the amount of essence to drop- Returns:
- the event
-
callPlayerConsumeEntityEssenceEvent
@NotNull public static @NotNull PlayerConsumeEntityEssenceEvent callPlayerConsumeEntityEssenceEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull EntityEssenceData essenceData)Call and return thePlayerConsumeEntityEssenceEvent
.- Parameters:
player
- the player that consumed the essenceitem
- the vial of entity essence vialessenceData
- the essence data that was consumed- Returns:
- the event
-
callPlayerEssenceCollectEvent
@NotNull public static @NotNull PlayerEssenceCollectEvent callPlayerEssenceCollectEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.EquipmentSlot hand, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull EntityEssenceData essenceData, int essenceAmount)Call and return thePlayerEssenceCollectEvent
.- Parameters:
player
- the player collecting the essencehand
- the hand used to collect the essenceitem
- the item used to collect the essenceentity
- the entity from which the essence was collectedessenceData
- the essence data being collectedessenceAmount
- the amount of essence being collected- Returns:
- the event
-
handleCauldronBubbleEvent
Handle theCauldronBubbleEvent
and return whether or not it's cancelled.- Parameters:
cauldron
- the cauldron- Returns:
- true if not cancelled, false otherwise
-
callCauldronIngredientAddEvent
@NotNull public static @NotNull CauldronIngredientAddEvent callCauldronIngredientAddEvent(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull CauldronIngredient ingredient, @NotNull @NotNull org.bukkit.entity.Item item)Call and return theCauldronIngredientAddEvent
.- Parameters:
cauldron
- the cauldroningredient
- the ingredient to be addeditem
- the item entity- Returns:
- the event
-
callCauldronIngredientsDropEvent
@NotNull public static @NotNull CauldronIngredientsDropEvent callCauldronIngredientsDropEvent(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull java.util.Collection<@NotNull org.bukkit.entity.Item> items, @Nullable @Nullable org.bukkit.entity.Player player, @NotNull CauldronIngredientsDropEvent.Reason reason)Call and return theCauldronIngredientsDropEvent
.- Parameters:
cauldron
- the cauldronitems
- the items to dropplayer
- the playerreason
- the reason for the event call- Returns:
- the event
-
callCauldronItemCraftEvent
@NotNull public static @NotNull CauldronItemCraftEvent callCauldronItemCraftEvent(@NotNull @NotNull AlchemicalCauldron cauldron, @NotNull @NotNull CauldronRecipe recipe, @Nullable @Nullable org.bukkit.entity.Player player)Call and return theCauldronItemCraftEvent
.- Parameters:
cauldron
- the cauldronrecipe
- the recipeplayer
- the player- Returns:
- the event
-
callCauldronRecipeRegisterEvent
public static void callCauldronRecipeRegisterEvent(@NotNull @NotNull CauldronRecipeRegistry recipeRegistry)Call theCauldronRecipeRegisterEvent
.- Parameters:
recipeRegistry
- the recipe registry
-