private Configuration getItemAttributes(ItemStack stack) {
AttributeStorage storage = AttributeStorage.newTarget(stack, STB_ATTRIBUTE_ID);
YamlConfiguration conf = new YamlConfiguration();
try {
String s = storage.getData("");
if (s != null) {
conf.loadFromString(s);
if (Debugger.getInstance().getLevel() > 2) {
Debugger.getInstance().debug(3, "get item attributes for " + STBUtil.describeItemStack(stack) + ":");
for (String k : conf.getKeys(false)) {
Debugger.getInstance().debug(3, "- " + k + " = " + conf.get(k));
}
}
return conf;
} else {
throw new IllegalStateException("ItemStack " + stack + " has no STB attribute data!");
}
} catch (InvalidConfigurationException e) {
e.printStackTrace();
return new MemoryConfiguration();
}
}
STBItemRegistry.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:sensibletoolbox
作者:
评论列表
文章目录