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 Details

    • callEntityDamageByCauldronEvent

      @NotNull public static @NotNull EntityDamageByCauldronEvent callEntityDamageByCauldronEvent​(@NotNull @NotNull org.bukkit.entity.LivingEntity entity, @NotNull @NotNull AlchemicalCauldron cauldron, double damage)
      Call and return the EntityDamageByCauldronEvent.
      Parameters:
      entity - the damaged entity
      cauldron - the cauldron
      damage - 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 the EntityDamageByCauldronEvent.
      Parameters:
      entity - the damaged entity
      cauldron - the cauldron
      essence - 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 the EntityDropEssenceEvent.
      Parameters:
      entity - the entity dropping the essence
      essenceData - the essence data of the entity
      amountOfEssence - 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 the PlayerConsumeEntityEssenceEvent.
      Parameters:
      player - the player that consumed the essence
      item - the vial of entity essence vial
      essenceData - 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 the PlayerEssenceCollectEvent.
      Parameters:
      player - the player collecting the essence
      hand - the hand used to collect the essence
      item - the item used to collect the essence
      entity - the entity from which the essence was collected
      essenceData - the essence data being collected
      essenceAmount - the amount of essence being collected
      Returns:
      the event
    • handleCauldronBubbleEvent

      public static boolean handleCauldronBubbleEvent​(@NotNull @NotNull AlchemicalCauldron cauldron)
      Handle the CauldronBubbleEvent 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 the CauldronIngredientAddEvent.
      Parameters:
      cauldron - the cauldron
      ingredient - the ingredient to be added
      item - 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 the CauldronIngredientsDropEvent.
      Parameters:
      cauldron - the cauldron
      items - the items to drop
      player - the player
      reason - 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 the CauldronItemCraftEvent.
      Parameters:
      cauldron - the cauldron
      recipe - the recipe
      player - the player
      Returns:
      the event
    • callCauldronRecipeRegisterEvent

      public static void callCauldronRecipeRegisterEvent​(@NotNull @NotNull CauldronRecipeRegistry recipeRegistry)
      Parameters:
      recipeRegistry - the recipe registry