Inline

Inline

48 Downloads

Support for glowing items

u9g opened this issue ยท 0 comments

commented

Hi, first of all this is a super cool mod, Thanks for making it!

but it seems like a small change of making the item matcher show an item with a glint hard crashes the mod.

        InlineClientAPI.INSTANCE.addMatcher(new RegexMatcher.Simple("<item:([a-z:\\/_]+)>", itemMatcherID, (MatchResult mr) ->{
            Item item = Registries.ITEM.get(new Identifier(mr.group(1)));
            if(item == null) return null;
            ItemStack stack = new ItemStack(item);
            stack.addEnchantment(Enchantments.FORTUNE, 3);
            HoverEvent he = new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ItemStackContent(stack));
            return new DataMatch(new ItemInlineData(stack), Style.EMPTY.withHoverEvent(he));
        }, MatcherInfo.fromId(itemMatcherID)));

This code for example adds fortune 3 to the item, but the glint rendering code seems to break something and the entire mod crashes, so I'd appreciate if support for that could be added.