emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
221 stars 46 forks source link

Info pages apparently cannot have newlines (using KubeJS's JEI support) #424

Closed aaronhowser1 closed 5 months ago

aaronhowser1 commented 5 months ago

With this script in KubeJS:

event.addItem(
        [
            'mna:arcane_crown',
            'mna:bone_armor_boots',
            'mna:bone_armor_chest',
            'mna:bone_armor_head',
            'mna:bone_armor_leggings',
            'mna:bone_ring',
            'mna:council_armor_boots',
            'mna:council_armor_chest',
            'mna:council_armor_head',
            'mna:council_armor_leggings',
            'mna:demon_armor_boots',
            'mna:demon_armor_chest',
            'mna:demon_armor_head',
            'mna:demon_armor_leggings',
            'mna:eldrin_bracelet',
            'mna:eldrin_sight_unguent',
            'mna:emberglow_bracelet',
            'mna:fey_armor_boots',
            'mna:fey_armor_head',
            'mna:fey_armor_chest',
            'mna:fey_armor_leggings',
            'mna:hellfire_staff',
            'mna:hellfire_trident',
            'mna:spectral_elytra',
            'mna:trickery_bracelet',
            Item.of(
                'mna:torn_journal_page',
                '{part:"mna:components/posession",thesis:0b}'
            ),
            Item.of(
                'mna:torn_journal_page',
                '{part:"mna:components/shield",thesis:0b}'
            ),
            Item.of(
                'mna:torn_journal_page',
                '{part:"mna:components/mana_shield",thesis:0b}'
            ),
            Item.of(
                'mna:torn_journal_page',
                '{part:"mna:components/sunder",thesis:0b}'
            ),
            Item.of(
                'mna:torn_journal_page',
                '{part:"mna:components/mind_vision",thesis:0b}'
            ),
            'mna:thaumaturgic_link',
        ],
        [
            'Can be purchased from The Broker',
            ' ',
            'Note that these can all be acquired in other ways; the recipes are not visible until unlocked.',
        ]
    )

This is what I get with JEI image

This is what I get with JEI + EMI image

emilyploszaj commented 5 months ago

JEI only exposes preformated strings for info recipes, meaning EMI cannot distinguish between a line break JEI did or a line break made by a description itself. There isn't anything EMI can do to augment this functionality, to have better info recipe support, you can use EMI's resource format which you can generate from kubejs: https://github.com/emilyploszaj/emi/wiki/Adding-Recipes