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

Occultism recipes not showing for many rituals #90

Closed
calog3no opened this issue Aug 19, 2024 · 30 comments
Closed

Occultism recipes not showing for many rituals #90

calog3no opened this issue Aug 19, 2024 · 30 comments
Labels
Bug Something isn't working fixed in next release Fixed in the next release. If the issue this is on is closed, the fix is already released

Comments

@calog3no
Copy link

Modpack Version

1.9

Describe your issue.

Many of the rituals in occultism are not showing in the occultism book or EMI.
2024-08-19_10 08 12

Crash Report

No response

Latest Log

No response

Have you modified the modpack?

No

User Modifications

No response

Did the issue happen in singleplayer or on a server?

Singleplayer

Discord Username

calog3no

@calog3no calog3no added the Bug Something isn't working label Aug 19, 2024
@NielsPilgaard
Copy link
Collaborator

I expect that this is because we're not on the latest jei/Occultism versions, because the latest jei is marked as 1.21.1 only.
@klikli-dev is that a reasonable assumption?

@theboo
Copy link

theboo commented Aug 19, 2024

Occultism should have native EMI support now so jei should be irrelevant as far as function, but since it also works with jei, and we need jei under emi for other mods it has to match with the version occultism is asking for(even tho marked optional)... Curious if this issue has something to do with the emi compat vs jei version

I don't quite understand how the "version range" in the new neo mods.toml works tho...

https://github.com/klikli-dev/occultism/blob/5900e7bfa315925cec068469653e42f86132a564/src/main/resources/META-INF/neoforge.mods.toml#L87

GitHub
A magic mod inspired by the world of Jonathan Stroud's Bartimaeus. With the help of occult rituals players can summon entities from the "Other Side" to perform magic. - klikli-dev/occ...

@theboo
Copy link

theboo commented Aug 19, 2024

Just realized you meant it might be fixed in latest occultism which we can't use because of the available jei versions on 1.21... ignore me lol

@klikli-dev
Copy link

klikli-dev commented Aug 20, 2024

Mea culpa - I will release a version today that accepts older JEI. I missed that JEI restricted its latest versions to 1.21.1

See also klikli-dev/modonomicon#240

@klikli-dev
Copy link

I expect that this is because we're not on the latest jei/Occultism versions, because the latest jei is marked as 1.21.1 only. @klikli-dev is that a reasonable assumption?

I am actually not sure, I fixed so many 1.21 bugs that I lost track. If the issue remains after updating to latest occultism (which should now be possible, the last holdback was modonomicon requiring a JEI alpha version, which I just fixed in v1.100 of modonomicon), please ping me and I will look into it again.

I expect it should be fixed though as I recently tested something in ATM 10 which ditched JEI and is on latest occultism and there I did see the recipes in the book

@NielsPilgaard
Copy link
Collaborator

Alright I've updated to the latest version of Modonomicon and Occultism, and the issue remains:
image

@klikli-dev
Copy link

klikli-dev commented Aug 21, 2024

Hmm I will have to try with E10, in my local install I see the recipes "

EDIT: I need to debug further but I get a lot of [21Aug2024 11:26:16.112] [Render thread/WARN] [Modonomicon/]: Recipe occultism:ritual/possess_warden (of type occultism:ritual) not found. in the E10 instance, that would explain why nothing shows here, but not sure why the recipe is not found

@klikli-dev
Copy link

klikli-dev commented Aug 21, 2024

@NielsPilgaard it looks like the recipes are not loaded (neither modonomicon nor jei find them).
In an occultism only instance, and in ATM10 with .. a lot of stuff (but no occultism ritual recipe modification that I am aware of, besides replacing the multiblocks for the pentacles in modonomicon) this does not happen.

Is it possible that e.g. your kubejs script has an issue causing recipes not to be re-added after modification?
Kube had a lot of changes in 1.21(.1) so maybe something is missing?

@NielsPilgaard
Copy link
Collaborator

@MuteTiefling please see above, what do you think?

@MuteTiefling
Copy link
Contributor

Certainly possible. I don't have easy access to a pc for testing, however.

@NielsPilgaard
Copy link
Collaborator

Alright, I'll give it a go if I can find time for it 👍

@MuteTiefling
Copy link
Contributor

If not, I'll be able to in a couple days

@MuteTiefling
Copy link
Contributor

Testing with everything updated to 1.21.1.

With our kubejs scripts as they exist in release, the issue persists.
Without our occultism specific scripts, the issue persists.
Without any kubejs scripts, the issue is resolved.

@MuteTiefling
Copy link
Contributor

More specifically, I need to remove all recipe scripts for the issue to go away. The non recipe scripts are having no impact.

@klikli-dev
Copy link

@MuteTiefling is OccultismKubeJS present?
I am not sure if it actually does anything in your use case, but according to the KubeJS Authors, the recipe definitions contained in the addon give Kube some addtional info that prevents it from running some code that was problematic e.g. with tags (basically it tries to get recipe information by analyzing the recipe result), which may also cause issues here

@MuteTiefling
Copy link
Contributor

@klikli-dev We do have occultism kubejs, yes

We're also updated to 1.21.1 now and I'm still seeing the issue.

@MuteTiefling
Copy link
Contributor

What gets me is the seemingly random nature of affected recipes. It's very specific ones that don't show, but I don't see any correlation. Most of them are possession recipes. But then the silverfish horde and endermite recipes are fine.

@MuteTiefling
Copy link
Contributor

Although, those two do have an item_to_use and the rest do not. Looking through the book, every single recipe in the possession chapter is broken aside from the two that use this.

@klikli-dev
Copy link

@MuteTiefling can you point me to where / how you modify the recipes?
Maybe I can re-create that locally and deploy a fix via the kubejs addon

@MuteTiefling
Copy link
Contributor

MuteTiefling commented Aug 29, 2024

@klikli-dev our occultism specific recipes are here https://github.com/EnigmaticaModpacks/Enigmatica10/tree/master/kubejs/server_scripts/recipes/occultism

But, removing them does not resolve the issue. I have to remove every single recipe altering script for your recipes to re-appear. Even if those scripts are unrelated to Occultism.

GitHub
The official repository and issue-tracker for Enigmatica 10 for Minecraft 1.21 - EnigmaticaModpacks/Enigmatica10

@klikli-dev
Copy link

klikli-dev commented Aug 29, 2024

ok it reproduces if I put just your recipe script into my kubejs addon workspace. Maybe I can find out more!

EDIT: No logs or similar. The only thing I found so far is that the recipes get "lost" pretty early in kubejs processing, because kube never even attempts to transform the json into a recipe object.

klikli-dev added a commit to klikli-dev/occultism-kubejs that referenced this issue Aug 29, 2024
@klikli-dev
Copy link

I posted about the issue in the kubejs discord and asked them to give me directions on how to further diagnose this!

@pietro-lopes
Copy link

I tested in a clean instance (Kubejs and Occulstim only) and this worked for me.

ServerEvents.recipes((event) => {
    event.forEachRecipe({ type: 'occultism:ritual' }, (r) => {
        let recipe = r.json.asMap();
        let recipe_id = r.getId();
        if (recipe.spirit_max_age) {
            if (recipe_id.includes('_trader')) {
                // Remove decay from Traders
                delete recipe.spirit_max_age;
            } else {
                // Reduce delay for all other spirits (weather/daytime rituals)
                recipe.spirit_max_age = 10;
            }
        }

        // Override default craft time for all recipes
        recipe.duration = 20;
    });
});

@MuteTiefling
Copy link
Contributor

Found the common trace here:

Tried re-adding the recipe myself as an interim solution and it doesn't like Invalid component 'entity_to_sacrifice' ({tag: entity_type_tag, display_name: string})

[15:14:22] [ERROR] ! server_scripts:recipes/occultism/ritual.js#58: Failed to create custom recipe from json {"activation_item":{"item":"occultism:book_of_binding_bound_afrit"},"duration":20,"entity_to_sacrifice":{"display_name":"ritual.occultism.sacrifice.fish","tag":"c:fish"},"entity_to_summon":"occultism:possessed_elder_guardian","ingredients":[{"item":"minecraft:oxidized_copper"},{"item":"minecraft:prismarine"},{"item":"minecraft:prismarine_bricks"},{"item":"minecraft:dark_prismarine"},{"item":"minecraft:wet_sponge"},{"item":"minecraft:sea_lantern"},{"item":"minecraft:water_bucket"},{"item":"minecraft:water_bucket"},{"item":"minecraft:water_bucket"},{"tag":"c:gems/emerald"}],"pentacle_id":"occultism:possess_afrit","result":{"components":{"minecraft:item_name":"{\"translate\":\"item.occultism.ritual_dummy.possess_elder_guardian\"}","minecraft:lore":["{\"translate\":\"item.occultism.ritual_dummy.possess_elder_guardian.tooltip\"}"]},"count":1,"id":"minecraft:heart_of_the_sea"},"ritual_dummy":{"count":1,"id":"occultism:ritual_dummy/possess_elder_guardian"},"ritual_type":"occultism:summon","id":"occultism:ritual/possess_elder_guardian","type":"occultism:ritual"}: Invalid component 'entity_to_sacrifice' ({tag: entity_type_tag, display_name: string}) - java.lang.ClassCastException: class com.mojang.serialization.DataResult$Success cannot be cast to class java.lang.String (com.mojang.serialization.DataResult$Success is in module [email protected] of loader 'MC-BOOTSTRAP' @63440df3; java.lang.String is in module java.base of loader 'bootstrap')

@MuteTiefling
Copy link
Contributor

And if I remove that value, the recipe loads without issue.

@klikli-dev
Copy link

That is a great find, although I am not sure why it happens, as the KubeJS people helped me set up that part. I will investigate, maybe it is outdated or we overlooked something

@klikli-dev
Copy link

klikli-dev commented Sep 3, 2024

I am not 100% sure but I think it might be fixed:
image

I will push my changes for you to test @MuteTiefling

Basically what I did was write a custom wrapper for the entity to sacrifice (THANK YOU for tracking that down as the common issue!). Weirdly someone in the Kube discord initially told me to remove my custom wrapper and use their component builder, but apparently it is somehow not compatible (any more?). But that is fine, if it works we keep it !

EDIT: release/v1.21.1-1.3.0 is building, once it is out it should maybe hopefully possibly fix it

klikli-dev added a commit to klikli-dev/occultism-kubejs that referenced this issue Sep 3, 2024
the component builder seems not to work the way we want

This may fix EnigmaticaModpacks/Enigmatica10#90

Closes #5 because the server run now has an example for the entity to sacrifice
@MuteTiefling
Copy link
Contributor

Awesome! I'll pop it in my test instance as soon as I can, thanks for your efforts!

@MuteTiefling MuteTiefling added the fixed in next release Fixed in the next release. If the issue this is on is closed, the fix is already released label Sep 4, 2024
@MuteTiefling
Copy link
Contributor

Woot! Working great! Thanks for the fix @klikli-dev, you're the best :D

@klikli-dev
Copy link

Thanks a lot for your help in this, this would sooner or later trip up a lot of mod pack devs and you did the legwork in tracing it down.
Kube now also knows about the specifics of the issue and maybe they can fix things on their end too, but for mod devs the option I took is always a possibility: replace recipe component builders (or their equivalent json snippets in the json schemata) with explicit code-defined components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working fixed in next release Fixed in the next release. If the issue this is on is closed, the fix is already released
Projects
None yet
Development

No branches or pull requests

6 participants