STBItemRegistry.java 文件源码

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

项目:sensibletoolbox 作者:
@Override
public boolean isSTBItem(ItemStack stack, Class<? extends BaseSTBItem> c) {
    if (stack == null || !stack.hasItemMeta()) {
        return false;
    }
    ItemMeta im = stack.getItemMeta();
    if (im.hasLore()) {
        List<String> lore = im.getLore();
        if (!lore.isEmpty() && lore.get(0).startsWith(LORE_PREFIX)) {
            if (c != null) {
                Configuration conf = getItemAttributes(stack);
                ReflectionDetails details = reflectionDetailsMap.get(conf.getString("*TYPE"));
                return details != null && c.isAssignableFrom(details.clazz);
            } else {
                return true;
            }
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号