Exemple #1
0
 public void play(Location location) {
   if (type != null) {
     if (data == null)
       location.getWorld().playEffect(location, type, 0, EffectData.DEFAULT_RADIUS);
     else location.getWorld().playEffect(location, type, data.getData(), data.getRadius());
   }
 }
Exemple #2
0
 @Override
 public String toString() {
   String ret = type.toString();
   // TODO: Will data ever be null, or will it just be 0?
   if (data != null) ret += "@" + data.get(type);
   return ret;
 }
Exemple #3
0
 public static SoundEffect parse(String key) {
   String[] split = key.split("@");
   String name = split[0], data = "";
   if (split.length > 1) data = split[1];
   try {
     Effect effect = enumValue(Effect.class, name);
     if (effect == null) return null;
     EffectData state = EffectData.parse(effect, data);
     return new SoundEffect(effect, state);
   } catch (IllegalArgumentException e) {
     return null;
   }
 }