You're in Grave Danger

You're in Grave Danger

17M Downloads

[MINOR ISSUE] Recipe removal on scroll item not being disabled by default

Shibva opened this issue ยท 13 comments

commented

Describe the bug
Should be self explanitory from the pic

image
the recipe is not disabled when the teleport/info scroll is not disabled; so it leaves a broken recipe that persist
(Details on image: image of recipe displayed by REI)

commented

this is still broken btw, at least on 1.19.2 fabric

commented

Yeah I've kinda moved away from 1.19.2 for the time being due to me rewriting the mod for 1.20, and I feel like moving between two different sets of code doing essentially the same thing would be kinda annoying. Might backport the 1.20 version when I consider it stable, although it would reset every active grave in world loaded when switching to this new version when still on 1.19.2, so I'm not quite decided yet what the best way of updating would be.
Thanks for the update though!

commented

So to recap... The recipe works as intended, meaning you can see what it should craft when the scroll item is enabled.
But when it's disabled, there's still a recipe crafting "air", and that is what you'd like to be fixed?

commented

well, yeah; what im saying is that the recipe should not pop up like its non existent if the item being used to make it is not in the registry based on the config option setting DISSABLED.

theres a few ways; you could do it like I described here or take advantaged at the API to hide the recipe (but that would require integration wtih the other recipe systems API (ie, REI, JEI, EMI, etc)

commented

basicaly easiest option is to have the recipe file used to be skiped over as if it was not there

commented

Ok there's actually an explanation to this
When I first introduced the scroll item, it was togglable if it would be registered or not as an item. By default not. As it still is to this day.
However when the recipe tried to find this item that did not exist, the game threw an error. This would happen every time when the game started. Someone noticed this and disliked it, so I tried removing the error message. What I did was I replaced the result of the recipe (the scroll) with air. That was the easiest way for me to remove the error in the game log. So it's because someone else didn't like that an error popped up in their log, which wouldn't even crash the game, only look bad or something. So that's why this has happened. Not sure if I'll try to fix it. Could always go back to printing that error instead, since it really wouldn't change anything except a few red lines when the game starts, but be fine after that. I'll see what I'll do

commented

hmm, well its its possible I would have it based on an internal config wtih the file; I think ive seen it done but its a bit IFFY at best

if its possible id do it based on reading an external IF ELSE statement; since the config setting itself requires a game restart to take effect

commented

Wait do you mean that this happens when the scroll item is enabled? Because that is not supposed to happen

commented

I mean have the recipe appear when its enabled; the recipe is there when its disable thats the issue; sorry

commented

(also fast respond time holy shit)

commented

image

commented

There are ways to add recipes dynamically / conditionally through code. See here for an example:
https://fabricmc.net/wiki/tutorial:dynamic_recipe_generation

(ignore the bit about the "Fabric Data Generation API tutorials"; they don't cover this afaik)

commented

I might look into it. The thing is that I want the recipe to be configurable with datapacks, which I'm not sure they will be with the example in this link. I will try to do something that works based on this though