NmsProxyTileChest.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:Pure 作者:
@Override
public void a(final int index, final ye yeArg) {
    /*
     * (ye.d)   is the obfuscated field  name of ItemStack.id
     * (ye.b)   is the obfuscated field  name of ItemStack.stackSize
     * (ye.k()) is the obfuscated method name of ItemStack.getItemDamage()
     */
    @SuppressWarnings("deprecation")
    final ItemStack item = new ItemStack(
        yeArg.d,
        yeArg.b,
        (short) yeArg.k()
    );

    /*
     * (by)           is the obfuscated class  name of NBTTagCompound
     * (ye.d)         is the obfuscated field  name of ItemStack.stackTagCompound
     * (cg)           is the obfuscated class  name of NBTTagList
     * (by.a(String)) is the obfuscated method name of NBTTagCompound.getTag(String)
     * (cg.c())       is the obfuscated method name of NBTTagList.tagCount()
     * (cg.b(int))    is the obfuscated method name of NBTTagList.getCompoundTagAt(int)
     */
    // Enchanted Books can be generated, let's handle that.
    if (item.getType() == Material.ENCHANTED_BOOK) {
        final by itemNbt = yeArg.e;
        if (itemNbt != null) {
            final cg storedEnchNbt = (cg) itemNbt.a("StoredEnchantments");
            if (storedEnchNbt != null && storedEnchNbt.c() > 0) {
                final EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item.getItemMeta();
                for (int i = 0; i < storedEnchNbt.c(); i++) {
                    this.addMcEnchant(meta, (by) storedEnchNbt.b(i));
                }
                item.setItemMeta(meta);
            }
        }
    }

    this.inv.setItem(index, item);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号