Пример #1
0
 @Override
 public CraftMetaPotion clone() {
   CraftMetaPotion clone = (CraftMetaPotion) super.clone();
   if (this.customEffects != null) {
     clone.customEffects = new ArrayList<PotionEffect>(this.customEffects);
   }
   return clone;
 }
Пример #2
0
 CraftMetaPotion(CraftMetaItem meta) {
   super(meta);
   if (!(meta instanceof CraftMetaPotion)) {
     return;
   }
   CraftMetaPotion potionMeta = (CraftMetaPotion) meta;
   if (potionMeta.hasCustomEffects()) {
     this.customEffects = new ArrayList<PotionEffect>(potionMeta.customEffects);
   }
 }
Пример #3
0
  @Override
  public boolean equalsCommon(CraftMetaItem meta) {
    if (!super.equalsCommon(meta)) {
      return false;
    }
    if (meta instanceof CraftMetaPotion) {
      CraftMetaPotion that = (CraftMetaPotion) meta;

      return (this.hasCustomEffects()
          ? that.hasCustomEffects() && this.customEffects.equals(that.customEffects)
          : !that.hasCustomEffects());
    }
    return true;
  }