Bukkit
1.4.7-R1.0
Main Page
Related Pages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Enumerator
Pages
PotionType.java
Go to the documentation of this file.
1
package
org.bukkit.potion;
2
3
public
enum
PotionType
{
4
WATER
(0, null, 0),
5
REGEN
(1,
PotionEffectType
.
REGENERATION
, 2),
6
SPEED
(2,
PotionEffectType
.
SPEED
, 2),
7
FIRE_RESISTANCE
(3,
PotionEffectType
.
FIRE_RESISTANCE
, 1),
8
POISON
(4,
PotionEffectType
.
POISON
, 2),
9
INSTANT_HEAL
(5,
PotionEffectType
.
HEAL
, 2),
10
NIGHT_VISION
(6,
PotionEffectType
.
NIGHT_VISION
, 1),
11
WEAKNESS
(8,
PotionEffectType
.
WEAKNESS
, 1),
12
STRENGTH
(9,
PotionEffectType
.
INCREASE_DAMAGE
, 2),
13
SLOWNESS
(10,
PotionEffectType
.
SLOW
, 1),
14
INSTANT_DAMAGE
(12,
PotionEffectType
.
HARM
, 2),
15
INVISIBILITY
(14,
PotionEffectType
.
INVISIBILITY
, 1),
16
;
17
18
private
final
int
damageValue,
maxLevel
;
19
private
final
PotionEffectType
effect;
20
21
PotionType
(
int
damageValue,
PotionEffectType
effect,
int
maxLevel) {
22
this.damageValue = damageValue;
23
this.effect = effect;
24
this.maxLevel = maxLevel;
25
}
26
27
public
PotionEffectType
getEffectType
() {
28
return
effect;
29
}
30
31
public
int
getDamageValue
() {
32
return
damageValue;
33
}
34
35
public
int
getMaxLevel
() {
36
return
maxLevel;
37
}
38
39
public
boolean
isInstant
() {
40
return
effect == null ?
true
: effect.
isInstant
();
41
}
42
43
public
static
PotionType
getByDamageValue
(
int
damage) {
44
for
(
PotionType
type :
PotionType
.values()) {
45
if
(type.damageValue == damage)
46
return
type;
47
}
48
return
null;
49
}
50
51
public
static
PotionType
getByEffect
(
PotionEffectType
effectType) {
52
if
(effectType == null)
53
return
WATER;
54
for
(
PotionType
type :
PotionType
.values()) {
55
if
(effectType.
equals
(type.effect))
56
return
type;
57
}
58
return
null;
59
}
60
}
org
bukkit
potion
PotionType.java
Generated on Fri May 24 2013 11:16:40 for Bukkit by
1.8.2