Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.entity.PotionSplashEvent Class Reference
Inheritance diagram for org.bukkit.event.entity.PotionSplashEvent:
org.bukkit.event.entity.ProjectileHitEvent org.bukkit.event.Cancellable org.bukkit.event.entity.EntityEvent org.bukkit.event.Event

Public Member Functions

 PotionSplashEvent (final ThrownPotion potion, final Map< LivingEntity, Double > affectedEntities)
 
ThrownPotion getEntity ()
 
ThrownPotion getPotion ()
 
Collection< LivingEntitygetAffectedEntities ()
 
double getIntensity (LivingEntity entity)
 
void setIntensity (LivingEntity entity, double intensity)
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.ProjectileHitEvent
 ProjectileHitEvent (final Projectile projectile)
 
Projectile getEntity ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.EntityEvent
 EntityEvent (final Entity what)
 
Entity getEntity ()
 
EntityType getEntityType ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 
- Static Public Member Functions inherited from org.bukkit.event.entity.ProjectileHitEvent
static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.entity.EntityEvent
Entity entity
 

Detailed Description

Called when a splash potion hits an area

Definition at line 16 of file PotionSplashEvent.java.

Member Function Documentation

Collection<LivingEntity> org.bukkit.event.entity.PotionSplashEvent.getAffectedEntities ( )

Retrieves a list of all effected entities

Returns
A fresh copy of the affected entity list

Definition at line 46 of file PotionSplashEvent.java.

46  {
47  return new ArrayList<LivingEntity>(affectedEntities.keySet());
48  }
double org.bukkit.event.entity.PotionSplashEvent.getIntensity ( LivingEntity  entity)

Gets the intensity of the potion's effects for given entity; This depends on the distance to the impact center

Parameters
entityWhich entity to get intensity for
Returns
intensity relative to maximum effect; 0.0: not affected; 1.0: fully hit by potion effects

Definition at line 58 of file PotionSplashEvent.java.

58  {
59  Double intensity = affectedEntities.get(entity);
60  return intensity != null ? intensity : 0.0;
61  }
ThrownPotion org.bukkit.event.entity.PotionSplashEvent.getPotion ( )

Gets the potion which caused this event

Returns
The thrown potion entity

Definition at line 37 of file PotionSplashEvent.java.

37  {
38  return (ThrownPotion) getEntity();
39  }
boolean org.bukkit.event.entity.PotionSplashEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 78 of file PotionSplashEvent.java.

78  {
79  return cancelled;
80  }
void org.bukkit.event.entity.PotionSplashEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 82 of file PotionSplashEvent.java.

82  {
83  cancelled = cancel;
84  }
void org.bukkit.event.entity.PotionSplashEvent.setIntensity ( LivingEntity  entity,
double  intensity 
)

Overwrites the intensity for a given entity

Parameters
entityFor which entity to define a new intensity
intensityrelative to maximum effect

Definition at line 69 of file PotionSplashEvent.java.

69  {
70  Validate.notNull(entity, "You must specify a valid entity.");
71  if (intensity <= 0.0) {
72  affectedEntities.remove(entity);
73  } else {
74  affectedEntities.put(entity, Math.min(intensity, 1.0));
75  }
76  }

The documentation for this class was generated from the following file: