public static ItemStack a(ItemStack var0, class_acd var1) {
    MinecraftKey var2 = (MinecraftKey) class_acd.a.getKey(var1);
    if (var2 != null) {
      NBTTagCompound var3 = var0.hasTag() ? var0.getTag() : new NBTTagCompound();
      var3.put("Potion", var2.toString());
      var0.setTag(var3);
    }

    return var0;
  }
Example #2
0
  public NBTTagCompound save(NBTTagCompound nbttagcompound) {
    MinecraftKey minecraftkey = (MinecraftKey) Item.REGISTRY.c(this.item);

    nbttagcompound.setString(
        "id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
    nbttagcompound.setByte("Count", (byte) this.count);
    nbttagcompound.setShort("Damage", (short) this.damage);
    if (this.tag != null) {
      nbttagcompound.set(
          "tag",
          this.tag.clone()); // CraftBukkit - make defensive copy, data is going to another thread
    }

    return nbttagcompound;
  }