Patchouli

Patchouli

168M Downloads

Referencing missing recipes causes crashes

KAfable opened this issue ยท 18 comments

commented

What entry causes this issue to occur? Please post its json file.

commented

In the issue posted to my repo, IRSmoh said "the first entry", so assuming both of these crashes were due to the same, probably this one:

// introduction.json
{
	"name": "Introduction",
	"icon": "minecraft:writable_book",
	"category": "fossils_and_essence",
	"sortnum": 10101,
	"pages": [
		{
			"type": "text",
			"text": "If you're reading this, it means the world has become devoid of Animalia. This was intentional, so don't worry. We'll discuss why it happened later.$(p)For now, survival is the most important thing. You are the very last link; the very last chance for Animalia to return to the world."
		},
		{
			"type": "text",
			"text": "This guide is soulbound to you and was rigged to appear the moment you discovered your first fossil. These fossils will be the key to returning life to the world, and this guide will walk you through the process.$(p)This guide will update with new content as you progress in your restoration of Animalia.$(p)$(l:fossils_and_essence/extracting_essence)Learn how to put your fossils to use.$()"
		}
	]
}

I should note that my Patchouli support is pretty basic, this page type is my only fancy Patchouli thing. But it looks like this crash didn't even get to the part of the book that uses it.

commented

Are there any other Patchouli-related exceptions in the console at all when this issue occurs? Any pages/entries failing to load, stuff like that?

commented

Each time I open up the book I do get this entry:
https://gist.github.com/Vyraal1/47fba666882468eb1f6f4f57fc489c2a

The pack is heavily modified, we have also removed some jei categories entirely as well.

commented

Maybe you should fix those issues first, they'll probably also fix the book. It looks like you're giving a bunch of broken or missing information to the book.

commented

Sorry, what issues did you mean? The only issues that came up so far by removing those JEI categories were from Patchouli. Is the best course of action to ask the EIO devs to not link Patchouli and JEI categories?

commented

..what? The gist that you posted last has nothing to do with Patchouli, it's not even mentioned in it. It's an EnderIO and JEI only issue.

commented

Try updating JEI to the beta versions, I think this version of EIO has the dark steel upgrades improvements in JEI and needs a newer version

commented

Huh.
@Vyraal1, please try to figure out what recipe/category/etc. changes you made are the ones that cause this issue to occur, because @Yuudaari already confirmed that it doesn't happen with just the mod itself. So it has to be some sort of issue with removing recipes.

commented

@EpicSquid Still happens on the beta versions of JEI, also on EIO 5.0.40
So went back and tried a couple instances with various scripts and category recipe removals were commented out. Nothing has worked so far, any other ideas?

Also as for EIO/JEI, I'm guessing it could be a red herring as I don't see how they are related.
Just posting the crash: https://gist.github.com/Vyraal1/7984aa1fce387246ed029b81c76275fc
And this time with the log: https://gist.github.com/Vyraal1/02758aa483bd75e828a7f08e9d6cc36b

commented

Narrowed it down.
Soulus + Patchouli + CraftTweaker

recipes.remove(<minecraft:iron_ingot>);

is the only script you need, causes the aforementioned crashes.

Removing iron ingot by

recipes.removeByRecipeName("minecraft:iron_ingot_from_nuggets");
recipes.removeByRecipeName("minecraft:iron_ingot_from_block");

works just fine without crashing. The pack offers other ways of block -> ingot compression/decompression.

commented

Are there any recipes in Soulus that create iron ingots by default?

commented

Yes, and they're of my custom recipe type, and they appear in the book, so I'm back to thinking that it actually is something related to my custom patchouli page type. (Even though other pages crash besides the pages of that type)

I'll do some debugging and see if I can figure out what's happening.

commented

For some reason I can't get this to happen in a dev environment :thonk:

It looks like one of the pages having an error when loading due to the recipe not existing causes any random page in the book to crash, for some reason. It was intentional for this to error, though, and print the warning message in Patchouli's front page. I didn't think it would cause all pages to crash.

What do you think our next steps should be @Ellpeck ? Should I have fallbacks in this so that the front-page warnings never happen, even though the page is made invalid by the recipe removal? I would personally prefer the warnings to still be shown on the front page, but no crashing to happen. Otherwise there's no way to know that the page is broken unless you happen to go to it. I believe that would require more fallbacks in Patchouli though.

I would make a PR if I could repro in a dev environment; as is I'm not familiar enough with the Patchouli code to know how this is causing the entry crashes.

commented

I talked to Vazkii about the intended behavior and we're gonna make a change on our side to stop crashes like this from happening.

commented

Has there been any update on this?

Also noticed that a resource reload can cause this issue as well.
https://gist.github.com/Vyraal1/2dcb05cddc7d40075c8b36e71ba2b101

commented

Not yet. Currently it's not intended for recipes that are referenced to be missing, so the best solution right now is to replace the recipe that you removed by adding a new one with the same name, or just not removing the recipe in the first place.

commented

This issue is stale because it has been open for a while with no activity. Please bump if this is still an issue, or this ticket will be closed soon.