Class ProjectileExplodeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class ProjectileExplodeEvent extends ProjectileEvent implements org.bukkit.event.Cancellable
Called whenever an explosion is spawned by a weapon (When a projectile explodes, usually). While this event is Cancellable, you should ALWAYS cancel ProjectilePreExplodeEvent (this will skip a lot more calculations, saving that precious CPU).
  • Constructor Details

    • ProjectileExplodeEvent

      public ProjectileExplodeEvent(WeaponProjectile projectile, List<org.bukkit.block.Block> blocks, BlockRegenSorter sorter, it.unimi.dsi.fastutil.objects.Object2DoubleMap<org.bukkit.entity.LivingEntity> entities, me.deecaad.core.mechanics.MechanicManager mechanics)
  • Method Details

    • getBlocks

      public List<org.bukkit.block.Block> getBlocks()
      Returns the list of blocks that were affected by the ExplosionShape. You can modify this list.
      Returns:
      The non-null list of blocks affected.
    • setBlocks

      public void setBlocks(List<org.bukkit.block.Block> blocks)
      Overrides the current list of blocks affected by the explosion. Using this method may cause compatibility issues with other plugins using this event, so use this carefully.
      Parameters:
      blocks - The non-null list of blocks to be destroyed.
    • getSorter

      public BlockRegenSorter getSorter()
      A BlockRegenSorter simply sorts the block list after this event is called. This is nice for regeneration, as we can make the explosions regenerate in a "satisfying pattern".
      Returns:
      The current block regen sorter.
    • setSorter

      public void setSorter(BlockRegenSorter sorter)
      Sets the sorter that will decide the order blocks regenerate in.
      Parameters:
      sorter - The block sorter to use, or null.
      See Also:
    • getEntities

      public it.unimi.dsi.fastutil.objects.Object2DoubleMap<org.bukkit.entity.LivingEntity> getEntities()
      Gets the list of entities mapped to their exposure (A number 0..1 that determines how exposed that entity is to the explosion. Higher numbers mean more damage).
      Returns:
      The non-null entities mapped to their exposures.
    • setEntities

      public void setEntities(it.unimi.dsi.fastutil.objects.Object2DoubleMap<org.bukkit.entity.LivingEntity> entities)
      Overrides the current list of entities affected by the explosion. Using this method may cause compatibility issues with other plugins using this event, so use this carefully.
      Parameters:
      entities - The non-null map of entities and their exposures (0..1).
    • getMechanics

      public me.deecaad.core.mechanics.MechanicManager getMechanics()
    • setMechanics

      public void setMechanics(me.deecaad.core.mechanics.MechanicManager mechanics)
    • getHandlers

      @NotNull public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable