Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityEffect.java
1 package org.bukkit;
2 
3 import java.util.Map;
4 
5 import com.google.common.collect.Maps;
6 
7 /**
8  * A list of all Effects that can happen to entities.
9  */
10 public enum EntityEffect {
11 
12  /**
13  * When mobs get hurt.
14  */
15  HURT(2),
16 
17  /**
18  * When a mob dies.
19  * <p>
20  * <b>This will cause client-glitches!
21  */
22  DEATH(3),
23 
24  /**
25  * The smoke when taming a wolf fails.
26  * <p>
27  * Without client-mods this will be ignored if the entity is not a wolf.
28  */
30 
31  /**
32  * The hearts when taming a wolf succeeds.
33  * <p>
34  * Without client-mods this will be ignored if the entity is not a wolf.
35  */
37 
38  /**
39  * When a wolf shakes (after being wet).
40  * <p>
41  * Without client-mods this will be ignored if the entity is not a wolf.
42  */
44 
45  /**
46  * When a sheep eats a LONG_GRASS block.
47  */
48  SHEEP_EAT(10),
49 
50  /**
51  * When an Iron Golem gives a rose.
52  * <p>
53  * This will not play an effect if the entity is not an iron golem.
54  */
56 
57  /**
58  * Hearts from a villager.
59  * <p>
60  * This will not play an effect if the entity is not a villager.
61  */
63 
64  /**
65  * When a villager is angry.
66  * <p>
67  * This will not play an effect if the entity is not a villager.
68  */
70 
71  /**
72  * Happy particles from a villager.
73  * <p>
74  * This will not play an effect if the entity is not a villager.
75  */
77 
78  /**
79  * Magic particles from a witch.
80  * <p>
81  * This will not play an effect if the entity is not a witch.
82  */
84 
85  /**
86  * When a zombie transforms into a villager by shaking violently.
87  * <p>
88  * This will not play an effect if the entity is not a zombie.
89  */
91 
92  /**
93  * When a firework explodes.
94  * <p>
95  * This will not play an effect if the entity is not a firework.
96  */
98 
99  private final byte data;
100  private final static Map<Byte, EntityEffect> BY_DATA = Maps.newHashMap();
101 
102  EntityEffect(final int data) {
103  this.data = (byte) data;
104  }
105 
106  /**
107  * Gets the data value of this EntityEffect
108  *
109  * @return The data value
110  * @deprecated Magic value
111  */
112  @Deprecated
113  public byte getData() {
114  return data;
115  }
116 
117  /**
118  * Gets the EntityEffect with the given data value
119  *
120  * @param data Data value to fetch
121  * @return The {@link EntityEffect} representing the given value, or null
122  * if it doesn't exist
123  * @deprecated Magic value
124  */
125  @Deprecated
126  public static EntityEffect getByData(final byte data) {
127  return BY_DATA.get(data);
128  }
129 
130 
131  static {
132  for (EntityEffect entityEffect : values()) {
133  BY_DATA.put(entityEffect.data, entityEffect);
134  }
135  }
136 }
static EntityEffect getByData(final byte data)