MinecraftUtils.java 文件源码

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

项目:VanillaPlus 作者:
public static ItemStack addMeta(ConfigurationSection section, ItemStack item){
    NBTItem nbtItem = new NBTItem(item);
    for(String key : section.getKeys(false)){
        Object value = section.get(key);
        if(value instanceof Integer){
            nbtItem.setInteger(key, (int)value);
        }else if(value instanceof Double){
            nbtItem.setDouble(key, (double)value);
        }else if(value instanceof Boolean){
            nbtItem.setBoolean(key, (boolean)value);
        }else if(value instanceof String){
            nbtItem.setString(key, (String)value);
        }else if(value instanceof ConfigurationSection) {
            NBTCompound compound = nbtItem.getCompound(key);
            if(compound == null)
                compound = nbtItem.addCompound(key);
            applyCompound((ConfigurationSection) value, compound);
        }
    }
    return nbtItem.getItem();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号