2011-06-09 22:57:44 -07:00
|
|
|
package org.bukkit;
|
|
|
|
|
2012-01-29 11:10:40 +01:00
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
2011-06-09 22:57:44 -07:00
|
|
|
/**
|
|
|
|
* A list of effects that the server is able to send to players.
|
|
|
|
*/
|
|
|
|
public enum Effect {
|
|
|
|
CLICK2(1000),
|
2012-01-29 11:10:40 +01:00
|
|
|
CLICK1(1001),
|
|
|
|
BOW_FIRE(1002),
|
2011-06-09 22:57:44 -07:00
|
|
|
DOOR_TOGGLE(1003),
|
|
|
|
EXTINGUISH(1004),
|
|
|
|
RECORD_PLAY(1005),
|
2011-11-28 18:40:04 +01:00
|
|
|
GHAST_SHRIEK(1007),
|
|
|
|
GHAST_SHOOT(1008),
|
|
|
|
BLAZE_SHOOT(1009),
|
2011-06-09 22:57:44 -07:00
|
|
|
SMOKE(2000),
|
2011-11-28 18:40:04 +01:00
|
|
|
STEP_SOUND(2001),
|
|
|
|
POTION_BREAK(2002),
|
|
|
|
ENDER_SIGNAL(2003),
|
|
|
|
MOBSPAWNER_FLAMES(2004);
|
2011-06-09 22:57:44 -07:00
|
|
|
|
|
|
|
private final int id;
|
2012-01-29 11:10:40 +01:00
|
|
|
private static final Map<Integer, Effect> BY_ID = Maps.newHashMap();
|
2011-06-09 22:57:44 -07:00
|
|
|
|
|
|
|
Effect(int id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
2012-01-29 11:10:40 +01:00
|
|
|
/**
|
|
|
|
* Gets the ID for this effect.
|
|
|
|
*
|
|
|
|
* @return ID of this effect
|
|
|
|
*/
|
2011-06-09 22:57:44 -07:00
|
|
|
public int getId() {
|
|
|
|
return this.id;
|
|
|
|
}
|
2012-01-29 11:10:40 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Effect associated with the given ID.
|
|
|
|
*
|
|
|
|
* @param id ID of the Effect to return
|
|
|
|
* @return Effect with the given ID
|
|
|
|
*/
|
|
|
|
public static Effect getById(int id) {
|
|
|
|
return BY_ID.get(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
static {
|
|
|
|
for (Effect effect : values()) {
|
|
|
|
BY_ID.put(effect.id, effect);
|
|
|
|
}
|
|
|
|
}
|
2011-06-09 22:57:44 -07:00
|
|
|
}
|