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

Recipes that differ only in block below (or block below and output) do not work #24

Open
MelodyCube opened this issue Jan 18, 2024 · 3 comments

Comments

@MelodyCube
Copy link

MelodyCube commented Jan 18, 2024

Version

summoningrituals-forge-1.20.1-2.0.7

Describe the bug!

When creating recipes that differ only in block below (or block below and output) only one of the recipes works while all others say "The Altar does not have the correct block below it". All recipes show up properly in JEI.
E.g.

ServerEvents.recipes(event => {
    event.recipes.summoningrituals.altar('minecraft:dirt')
    .itemOutput('minecraft:coarse_dirt')
    .blockBelow('minecraft:gravel')
    // this recipe works

    event.recipes.summoningrituals.altar('minecraft:dirt')
    .itemOutput('minecraft:andesite')
    .blockBelow('minecraft:dirt')
    // this recipe does not work

    event.recipes.summoningrituals.altar('minecraft:dirt')
    .itemOutput('minecraft:stone')
    .input('minecraft:stick')
    .blockBelow('minecraft:gravel')
    // this recipe does not work

    event.recipes.summoningrituals.altar('minecraft:dirt')
    .itemOutput('minecraft:cobblestone')
    .input('minecraft:stick')
    .blockBelow('minecraft:dirt')
    // this recipe works
})

It'd be really great if this could also be fixed on 1.19 because that is where I found the issue.

Crash Report

No response

Log

No response

Additional Context

No

Modifications

Just KubeJS, JEI, and necessary libraries

Did the issue happen in singleplayer or on a server?

Singleplayer

@rlnt
Copy link
Member

rlnt commented Jan 19, 2024

Hmm, that's a bit tricky to solve.

Right now, the recipe lookup is only considering the inputs. So the set of input items has to be unique. This ensures that I can post specific error messages to the chat when something is wrong e.g. "Not the right block below the altar."

If I include the block below in the recipe check, the mod could never tell you what's wrong because it wouldn't find a recipe in the first place if you are missing the block below. Not sure how to solve this yet but I am open for suggestions.

@MelodyCube
Copy link
Author

Could you do something like if (blockbelow is part of a recipe with x inputs) { check blockbelow }? You might have to loop through all the recipes with x inputs, though, and I don't know how feasible that is.
Also I guess this would be more of a feature addition but just throwing it out there in case it might make it easier somehow: could you read blockbelow as an array of blockstates and/or block tags instead of a single block?

@rlnt
Copy link
Member

rlnt commented Jan 19, 2024

No, the mod would lose the ability to tell if it's the right block either way. It's a bit hard to communicate the challenge around this in the most transparent way when someone doesn't know the internals. Please give me a bit of time to figure this out. I have a few ideas, let's see if I can make this work without changing too much of the actual player experience. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants