Class ProjectileExplodeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileExplodeEvent
- All Implemented Interfaces:
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).-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
projectileFields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
weaponTitleFields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionProjectileExplodeEvent(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 Summary
Modifier and TypeMethodDescriptionList<org.bukkit.block.Block> Returns the list of blocks that were affected by theExplosionShape.it.unimi.dsi.fastutil.objects.Object2DoubleMap<org.bukkit.entity.LivingEntity> Gets the list of entities mapped to their exposure (A number 0..1 that determines how exposed that entity is to the explosion.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListme.deecaad.core.mechanics.MechanicManagerABlockRegenSortersimply sorts the block list after this event is called.booleanvoidOverrides the current list of blocks affected by the explosion.voidsetCancelled(boolean cancelled) voidsetEntities(it.unimi.dsi.fastutil.objects.Object2DoubleMap<org.bukkit.entity.LivingEntity> entities) Overrides the current list of entities affected by the explosion.voidsetMechanics(me.deecaad.core.mechanics.MechanicManager mechanics) voidsetSorter(BlockRegenSorter sorter) Sets the sorter that will decide the order blocks regenerate in.Methods inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
getLastLocation, getLocation, getProjectile, getWeaponStackMethods inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
getHand, getHandData, getShooter, getShooterWrapper, getWeaponTitle, isMainHand, isOffHandMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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
Returns the list of blocks that were affected by theExplosionShape. You can modify this list.- Returns:
- The non-null list of blocks affected.
-
setBlocks
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
ABlockRegenSortersimply 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
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:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-