Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Broken EMI recipes #61

Closed
nimbXnumb opened this issue Feb 21, 2024 · 5 comments
Closed

[Bug] Broken EMI recipes #61

nimbXnumb opened this issue Feb 21, 2024 · 5 comments
Labels
compatibility Broken with another mod

Comments

@nimbXnumb
Copy link
Contributor

Mod version:
20.1 - 0.12-v2
Minecraft version:
1.20.1 Fabric

Bug description:
Broken recipes for all of the backpacks when using EMI

@BeansGalaxy
Copy link
Owner

I'll look into adding support for it, for now JEI is supported in Forge and REI is supported in Fabric but this mod looks super nice

@BeansGalaxy BeansGalaxy added the compatibility Broken with another mod label Feb 22, 2024
@SaltSouls
Copy link

SaltSouls commented Mar 7, 2024

I would like to add to this as this seems to be specifically an issue with the NBT side of how the backpacks are rendered. I would like to ask, is there a reason for this? Why not just make each backpack have its own item, instead of the metal backpack sharing the same item but changing how it looks based on an NBT tag? I'm curious why this approach was chosen over just having basic items, as I feel that would be a lot simpler to implement and work with.

Besides that, it would seem the problem may lay in the fact that this mod has its own custom way have handling crafting using the base crafting table to allow for things like NBT to be added to items. The problem with this is that EMI isn't able to(or at least from what I can tell) properly read the information being passed through, specifically when a backpack is used as an ingredient in a recipe(though sometimes when it is an output as well). I've managed to get around this using KubeJS by forcing a hard NBT check using their strongNBT() function. This manages to fix the displayed backpack in EMI recipes. Maybe looking into how that is working and implementing it into your custom recipe handler would be a way to fix it?

@BeansGalaxy
Copy link
Owner

You can add custom backpacks through data packs so I just have a dyable item beansbackpacks:backpack, a trimmable item beansbackpacks:metal and a trimmable fire proof one beansbackpacks:upgraded. So the nbt tells my mod to read the list of added backpacks for its other properties.

Since looking into support I've gone down a rabbit hole of re-thinking this whole system since JEI & REI work but aren't perfect. Can you attach a link to the code you use to fix that, I'm unfamiliar with KubeJS so somewhere to start would help

Also after all this in the latest snapshot mojang decides to remove nbt and the new system has all the answers I'm looking for.

@SaltSouls
Copy link

SaltSouls commented Mar 8, 2024

Here is an example of what I mean when using KubeJS:

ServerEvents.recipes(event => {

    let MC = (id) => 'minecraft:' + id

    let leather_backpack = Item.of('beansbackpacks:backpack', '{display: {key:"leather"}}').strongNBT()
    let iron_backpack = Item.of('beansbackpacks:metal_backpack', '{display: {key:"iron"}}').strongNBT()

    event.shaped(leather_backpack, [
        'SLS',
        'LGL',
        'LLL'
    ], {
        L: 'kubejs:leather_sheet',
        S: 'kubejs:leather_strip',
        G: MC('gold_nugget')
    }).id('beansbackpacks:leather_backpack')

    event.shaped(iron_backpack, [
        'PDP',
        'IBI',
        'III'
    ], {
        I: MC('iron_ingot'),
        B: leather_backpack,
        D: MC('diamond'),
        P: MC('phantom_membrane')
    }).id('beansbackpacks:iron_backpack')

})

The part I refer to is the strongNBT() function being called. Somehow that is telling the recipe/EMI that it requires this item with this exact NBT data. I'm not sure how specifically that is working as I haven't looked through the KJS code, but I know that without strongNBT() the recipe will display a null texture square in place of the backpack and won't specify the NBT requirements when being used as an ingredient.

@BeansGalaxy
Copy link
Owner

Solved a LONG time ago and I guess I never closed it :) have a good day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Broken with another mod
Projects
None yet
Development

No branches or pull requests

3 participants