Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.potion.PotionEffectType Class Referenceabstract
Inheritance diagram for org.bukkit.potion.PotionEffectType:
org.bukkit.potion.PotionEffectTypeWrapper

Public Member Functions

PotionEffect createEffect (int duration, int amplifier)
 
abstract double getDurationModifier ()
 
int getId ()
 
abstract String getName ()
 
abstract boolean isInstant ()
 
boolean equals (Object obj)
 
int hashCode ()
 
String toString ()
 

Static Public Member Functions

static PotionEffectType getById (int id)
 
static PotionEffectType getByName (String name)
 
static void registerPotionEffectType (PotionEffectType type)
 
static void stopAcceptingRegistrations ()
 
static PotionEffectType[] values ()
 

Static Public Attributes

static final PotionEffectType SPEED = new PotionEffectTypeWrapper(1)
 
static final PotionEffectType SLOW = new PotionEffectTypeWrapper(2)
 
static final PotionEffectType FAST_DIGGING = new PotionEffectTypeWrapper(3)
 
static final PotionEffectType SLOW_DIGGING = new PotionEffectTypeWrapper(4)
 
static final PotionEffectType INCREASE_DAMAGE = new PotionEffectTypeWrapper(5)
 
static final PotionEffectType HEAL = new PotionEffectTypeWrapper(6)
 
static final PotionEffectType HARM = new PotionEffectTypeWrapper(7)
 
static final PotionEffectType JUMP = new PotionEffectTypeWrapper(8)
 
static final PotionEffectType CONFUSION = new PotionEffectTypeWrapper(9)
 
static final PotionEffectType REGENERATION = new PotionEffectTypeWrapper(10)
 
static final PotionEffectType DAMAGE_RESISTANCE = new PotionEffectTypeWrapper(11)
 
static final PotionEffectType FIRE_RESISTANCE = new PotionEffectTypeWrapper(12)
 
static final PotionEffectType WATER_BREATHING = new PotionEffectTypeWrapper(13)
 
static final PotionEffectType INVISIBILITY = new PotionEffectTypeWrapper(14)
 
static final PotionEffectType BLINDNESS = new PotionEffectTypeWrapper(15)
 
static final PotionEffectType NIGHT_VISION = new PotionEffectTypeWrapper(16)
 
static final PotionEffectType HUNGER = new PotionEffectTypeWrapper(17)
 
static final PotionEffectType WEAKNESS = new PotionEffectTypeWrapper(18)
 
static final PotionEffectType POISON = new PotionEffectTypeWrapper(19)
 
static final PotionEffectType WITHER = new PotionEffectTypeWrapper(20)
 
static final PotionEffectType HEALTH_BOOST = new PotionEffectTypeWrapper(21)
 
static final PotionEffectType ABSORPTION = new PotionEffectTypeWrapper(22)
 
static final PotionEffectType SATURATION = new PotionEffectTypeWrapper(23)
 

Protected Member Functions

 PotionEffectType (int id)
 

Detailed Description

Represents a type of potion and its effect on an entity.

Definition at line 11 of file PotionEffectType.java.

Member Function Documentation

PotionEffect org.bukkit.potion.PotionEffectType.createEffect ( int  duration,
int  amplifier 
)

Creates a PotionEffect from this PotionEffectType, applying duration modifiers and checks.

See also
PotionBrewer::createEffect(PotionEffectType, int, int)
Parameters
durationtime in ticks
amplifierthe effect's amplifier
Returns
a resulting potion effect

Definition at line 144 of file PotionEffectType.java.

References org.bukkit.potion.PotionBrewer.createEffect(), and org.bukkit.potion.Potion.getBrewer().

144  {
145  return Potion.getBrewer().createEffect(this, duration, amplifier);
146  }
static PotionEffectType org.bukkit.potion.PotionEffectType.getById ( int  id)
static

Gets the effect type specified by the unique id.

Parameters
idUnique ID to fetch
Returns
Resulting type, or null if not found.
Deprecated:
Magic value

Definition at line 218 of file PotionEffectType.java.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.getType().

218  {
219  if (id >= byId.length || id < 0)
220  return null;
221  return byId[id];
222  }
static PotionEffectType org.bukkit.potion.PotionEffectType.getByName ( String  name)
static

Gets the effect type specified by the given name.

Parameters
nameName of PotionEffectType to fetch
Returns
Resulting PotionEffectType, or null if not found.

Definition at line 230 of file PotionEffectType.java.

230  {
231  Validate.notNull(name, "name cannot be null");
232  return byName.get(name.toLowerCase());
233  }
abstract double org.bukkit.potion.PotionEffectType.getDurationModifier ( )
abstract

Returns the duration modifier applied to effects of this type.

Returns
duration modifier
int org.bukkit.potion.PotionEffectType.getId ( )

Returns the unique ID of this type.

Returns
Unique ID
Deprecated:
Magic value

Definition at line 162 of file PotionEffectType.java.

Referenced by org.bukkit.potion.PotionEffectTypeWrapper.getType().

162  {
163  return id;
164  }
abstract String org.bukkit.potion.PotionEffectType.getName ( )
abstract

Returns the name of this effect type.

Returns
The name of this effect type

Referenced by org.bukkit.potion.PotionEffectType.registerPotionEffectType().

abstract boolean org.bukkit.potion.PotionEffectType.isInstant ( )
abstract

Returns whether the effect of this type happens once, immediately.

Returns
whether this type is normally instant
static void org.bukkit.potion.PotionEffectType.registerPotionEffectType ( PotionEffectType  type)
static

Registers an effect type with the given object.

Generally not to be used from within a plugin.

Parameters
typePotionType to register

Definition at line 242 of file PotionEffectType.java.

References org.bukkit.potion.PotionEffectType.getName().

242  {
243  if (byId[type.id] != null || byName.containsKey(type.getName().toLowerCase())) {
244  throw new IllegalArgumentException("Cannot set already-set type");
245  } else if (!acceptingNew) {
246  throw new IllegalStateException(
247  "No longer accepting new potion effect types (can only be done by the server implementation)");
248  }
249 
250  byId[type.id] = type;
251  byName.put(type.getName().toLowerCase(), type);
252  }
static void org.bukkit.potion.PotionEffectType.stopAcceptingRegistrations ( )
static

Stops accepting any effect type registrations.

Definition at line 257 of file PotionEffectType.java.

257  {
258  acceptingNew = false;
259  }
static PotionEffectType [] org.bukkit.potion.PotionEffectType.values ( )
static

Returns an array of all the registered PotionEffectTypes.

Returns
Array of types.

Definition at line 266 of file PotionEffectType.java.

266  {
267  return byId.clone();
268  }

Member Data Documentation

final PotionEffectType org.bukkit.potion.PotionEffectType.ABSORPTION = new PotionEffectTypeWrapper(22)
static

Increases the maximum health of an entity with health that cannot be regenerated, but is refilled every 30 seconds.

Definition at line 122 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.BLINDNESS = new PotionEffectTypeWrapper(15)
static

Blinds an entity.

Definition at line 85 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.CONFUSION = new PotionEffectTypeWrapper(9)
static

Warps vision on the client.

Definition at line 55 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.DAMAGE_RESISTANCE = new PotionEffectTypeWrapper(11)
static

Decreases damage dealt to an entity.

Definition at line 65 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.FAST_DIGGING = new PotionEffectTypeWrapper(3)
static

Increases dig speed.

Definition at line 25 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.FIRE_RESISTANCE = new PotionEffectTypeWrapper(12)
static

Stops fire damage.

Definition at line 70 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HARM = new PotionEffectTypeWrapper(7)
static

Hurts an entity.

Definition at line 45 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HEAL = new PotionEffectTypeWrapper(6)
static

Heals an entity.

Definition at line 40 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HEALTH_BOOST = new PotionEffectTypeWrapper(21)
static

Increases the maximum health of an entity.

Definition at line 116 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.HUNGER = new PotionEffectTypeWrapper(17)
static

Increases hunger.

Definition at line 95 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.INCREASE_DAMAGE = new PotionEffectTypeWrapper(5)
static

Increases damage dealt.

Definition at line 35 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.INVISIBILITY = new PotionEffectTypeWrapper(14)
static

Grants invisibility.

Definition at line 80 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.JUMP = new PotionEffectTypeWrapper(8)
static

Increases jump height.

Definition at line 50 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.NIGHT_VISION = new PotionEffectTypeWrapper(16)
static

Allows an entity to see in the dark.

Definition at line 90 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.POISON = new PotionEffectTypeWrapper(19)
static

Deals damage to an entity over time.

Definition at line 105 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.REGENERATION = new PotionEffectTypeWrapper(10)
static

Regenerates health.

Definition at line 60 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SATURATION = new PotionEffectTypeWrapper(23)
static

Increases the food level of an entity each tick.

Definition at line 127 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SLOW = new PotionEffectTypeWrapper(2)
static

Decreases movement speed.

Definition at line 20 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SLOW_DIGGING = new PotionEffectTypeWrapper(4)
static

Decreases dig speed.

Definition at line 30 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.SPEED = new PotionEffectTypeWrapper(1)
static

Increases movement speed.

Definition at line 15 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WATER_BREATHING = new PotionEffectTypeWrapper(13)
static

Allows breathing underwater.

Definition at line 75 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WEAKNESS = new PotionEffectTypeWrapper(18)
static

Decreases damage dealt by an entity.

Definition at line 100 of file PotionEffectType.java.

final PotionEffectType org.bukkit.potion.PotionEffectType.WITHER = new PotionEffectTypeWrapper(20)
static

Deals damage to an entity over time and gives the health to the shooter.

Definition at line 111 of file PotionEffectType.java.


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