STBItemRegistry.java 文件源码

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

项目:sensibletoolbox 作者:
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();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号