@Override
 protected JSONMessage[] get(Event event) {
   JSONMessage j = json.getSingle(event);
   String a = append.getSingle(event);
   if (j == null || a == null) return null;
   return Collect.asArray(j.link(a));
 }
 @Override
 protected ItemStack[] get(Event e) {
   PotionEffectType p = effect.getSingle(e);
   if (p == null) return null;
   ItemStack potion = new Potion(PotionType.getByEffect(p)).toItemStack(1);
   PotionMeta meta = ((PotionMeta) potion.getItemMeta());
   meta.addCustomEffect(new PotionEffect(p, 0, 0), true);
   potion.setItemMeta(meta);
   return Collect.asArray(potion);
 }
Beispiel #3
0
 @Override
 protected Boolean[] get(Event e) {
   Comparator.Relation r = Comparators.compare(first.getSingle(e), second.getSingle(e));
   switch (match) {
     case 0:
       return Collect.asArray(Comparator.Relation.EQUAL.is(r));
     case 1:
       return Collect.asArray((first.getSingle(e) + "").equals(second.getSingle(e) + ""));
     case 2:
       return Collect.asArray(Comparator.Relation.GREATER.is(r));
     case 3:
       return Collect.asArray(Comparator.Relation.SMALLER.is(r));
     case 4:
       return Collect.asArray(Comparator.Relation.GREATER_OR_EQUAL.is(r));
     case 5:
       return Collect.asArray(Comparator.Relation.SMALLER_OR_EQUAL.is(r));
   }
   return null;
 }