Farmer's Delight

Farmer's Delight

121M Downloads

Dough Recipe added to JEI manually

xbxbxb123 opened this issue ยท 10 comments

commented

Minecraft version

1.20.1

Farmer's Delight version

1.2.8

NeoForge version

Forge 47.4.0

Description

The recipe for wheat dough from wheat and a bucket of water is added to JEI manually, meaning that if the recipe is removed, it still shows up there.

Bug is here on line 51 according to a friend:
https://github.com/vectorwing/FarmersDelight/blob/1.20/src%2Fmain%2Fjava%2Fvectorwing%2Ffarmersdelight%2Fintegration%2Fjei%2FJEIPlugin.java

Steps to reproduce

Open JEI and view Wheat Dough recipe

Mod list

Farmers Delight and JEI

Logs

this is entirely unnecessary because I already found the exact line causing the bug

Minimal instance

  • I have tested this on a minimal instance

Performance and shader mods

  • I am using performance or shader mods
commented

This line is required for this recipe to even show up in JEI, unfortunately.

I'm not sure how this could be done in a way that makes it disappear if the recipe is disabled; if anyone has some insight on this, please let me know.

commented

When adding recipes to JEI you have the context of what recipes exist (else how would JEI add vanilla recipes??), I'm not sure how this is exposed though.

commented

You can remove recipes, even with just a data pack. Just make an identically placed recipe in your data pack, put inside it, instead of a recipe, put {}, this will cause it to error out (silently of course, only showing up in the logs and such) and just not have the recipe.

commented

The recipe is not impossible to remove. JEI is not the source of truth for recipes, it can lie sometimes like its doing here because Farmers Delight tells it to.

To remove the recipe from being craftable you need to use its true id, minecraft:dough (yes for some reason Farmers Delight uses the minecraft namespace. This is why you check your datagen folks!!!). This will not remove it from JEI though.

commented

Oh. I suppose that works too... if you like clean, and educated solutions instead of hacky solutions.

commented

instead of a recipe, put {}, this will cause it to error out (silently of course, only showing up in the logs and such) and just not have the recipe.

Please NEVER reccomend this to anyone anymore. It is an old way of doing it that is never required anymore.

These days you should either use load conditions or a pack.mcmeta block filter.
Load conditions depend on the loader, for forge use the json {"conditions": [{"type": "forge:false"}]}. Fabric has an equivalent for the key fabric:load_conditions but i don't know what their always false value is.
Neo has {"neoforge:conditions":[{"type":"neoforge:never"}]}.
The other way is a block filter in a pack.mcmeta, like so:

{
  "pack": {
    "description": "change me",
    "pack_format": 10
  },
  "filter": {
    "block": [
      {
        "namespace": "minecraft",
        "path": "recipe/dough"
      }
    ]
  }
}

Of course mods like KubeJS and CraftTweaker also have much cleaner methods of doing this.

commented

Alright folks, I figured out what I did wrong: when manually teaching JEI how to display the recipe, I forgot to check in the recipe manager if the recipe exists. Commit b09fff5 fixes that. ๐Ÿ‘

To remove the recipe from being craftable you need to use its true id, minecraft:dough (yes for some reason Farmers Delight uses the minecraft namespace. This is why you check your datagen folks!!!). This will not remove it from JEI though.

Thanks for spotting that. I forgot to give the builder a modded namespace. Fixed on commit ddb01ae. Both fixes should be out in the next patch.

commented

In reply to @ChiefArug
Oh, okay, I've never actually seen it used anywhere. Just figured it out in a particularly messy mod of mine.

commented

The recipe with a water bucket and a wheat seems impossible to remove btw, even with CraftTweaker. It seems like its namespace is minecraft: as well for some reason? Something is up with that recipe so maybe this is related.

commented

I have the opposite issue, I can't craft dough with a water bucket in multiplayer, guess its not applied correctly? the recipe is shown in jei but just can't be made