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

Check against the CT ingredient's internal object #1155

Merged
merged 6 commits into from
Aug 24, 2022

Conversation

Caedis
Copy link
Contributor

@Caedis Caedis commented Aug 23, 2022

What

See #1154

Implementation Details

Check if the internal object of the IIngredient parameter is of type IOreDictEntry

Outcome

Fixes #1154

Additional Information

java_t4VfgNnU6k.mp4

Testing scripts:
test_zenscripts.zip

@TechLord22 TechLord22 added the type: bug Something isn't working label Aug 23, 2022
@Exaxxion
Copy link
Contributor

Testing in the context of Nomi-CEu dev and I encountered an error (log at the end of the comment) which discussing on Discord we determined to be caused by a recipe attempting to use an empty ore dictionary as an ingredient.

While the solution in this case is likely going to be removing the offending recipe, it might be useful for pack devs to reject such a recipe with a more readable error message and continue, rather than erroring out with a vague exception.

[INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: Nuclearcraft.zs}: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:659)
    at java.util.ArrayList.get(ArrayList.java:435)
    at gregtech.api.recipes.crafttweaker.CTRecipeBuilder$CraftTweakerItemInputWrapper.<init>(CTRecipeBuilder.java:204)
    at gregtech.api.recipes.crafttweaker.CTRecipeBuilder.inputs(CTRecipeBuilder.java:55)
    at Nuclearcraft.__script__(Nuclearcraft.zs:593)
[...]

@TechLord22 TechLord22 merged commit 73aaea7 into GregTechCEu:master Aug 24, 2022
@Caedis Caedis deleted the fix-1154 branch March 25, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certain CT-added recipes don't accept oredict substitutions
4 participants