Пример #1
0
 @Override
 public void set(final ThrownPotion entity) {
   if (types != null) {
     final ItemType t = CollectionUtils.getRandom(types);
     assert t != null;
     entity.setItem(t.getRandom());
   }
 }
Пример #2
0
 @Override
 protected boolean match(final ThrownPotion entity) {
   if (types != null) {
     for (final ItemType t : types) {
       if (t.isOfType(entity.getItem())) return true;
     }
     return false;
   }
   return true;
 }
Пример #3
0
 //		return ItemType.serialize(types);
 @Override
 @Deprecated
 protected boolean deserialize(final String s) {
   if (s.isEmpty()) return true;
   types = ItemType.deserialize(s);
   return types != null;
 }
Пример #4
0
 @Override
 public boolean isSupertypeOf(final EntityData<?> e) {
   if (!(e instanceof ThrownPotionData)) return false;
   final ThrownPotionData d = (ThrownPotionData) e;
   if (types != null) {
     return d.types != null && ItemType.isSubset(types, d.types);
   }
   return true;
 }