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();
}
MinecraftUtils.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:VanillaPlus
作者:
评论列表
文章目录