示例#1
0
 private static void func_77518_a(IEnchantmentModifier p_77518_0_, ItemStack p_77518_1_) {
   if (p_77518_1_ != null) {
     NBTTagList var2 = p_77518_1_.func_77986_q();
     if (var2 != null) {
       for (int var3 = 0; var3 < var2.func_74745_c(); ++var3) {
         short var4 = ((NBTTagCompound) var2.func_74743_b(var3)).func_74765_d("id");
         short var5 = ((NBTTagCompound) var2.func_74743_b(var3)).func_74765_d("lvl");
         if (Enchantment.field_77331_b[var4] != null) {
           p_77518_0_.func_77493_a(Enchantment.field_77331_b[var4], var5);
         }
       }
     }
   }
 }
示例#2
0
  public static int func_77506_a(int p_77506_0_, ItemStack p_77506_1_) {
    if (p_77506_1_ == null) {
      return 0;
    } else {
      NBTTagList var2 = p_77506_1_.func_77986_q();
      if (var2 == null) {
        return 0;
      } else {
        for (int var3 = 0; var3 < var2.func_74745_c(); ++var3) {
          short var4 = ((NBTTagCompound) var2.func_74743_b(var3)).func_74765_d("id");
          short var5 = ((NBTTagCompound) var2.func_74743_b(var3)).func_74765_d("lvl");
          if (var4 == p_77506_0_) {
            return var5;
          }
        }

        return 0;
      }
    }
  }