Ad Astra

Ad Astra

22M Downloads

[Bug]: The Nasa Workbench has issues when unconventional recipes are made with a Datapack

Witixin1512 opened this issue ยท 0 comments

commented

Bug Description

Creating a recipe with less than 14 items "works" but fails to display in JEI:

Found a broken recipe, failed to setRecipe with RecipeLayoutBuilder: CraftTweaker crafttweaker:crash class earth.terrarium.adastra.common.recipes.machines.NasaWorkbenchRecipe

java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1355) ~[guava-31.1-jre.jar%2374!/:?]
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1337) ~[guava-31.1-jre.jar%2374!/:?]
	at com.google.common.collect.SingletonImmutableList.get(SingletonImmutableList.java:44) ~[guava-31.1-jre.jar%2374!/:?]
	at earth.terrarium.adastra.common.compat.jei.categories.NasaWorkbenchCategory.setRecipe(NasaWorkbenchCategory.java:49) ~[ad_astra-forge-1.20.1-1.15.17.jar%23135!/:?]
	at earth.terrarium.adastra.common.compat.jei.categories.NasaWorkbenchCategory.setRecipe(NasaWorkbenchCategory.java:21) ~[ad_astra-forge-1.20.1-1.15.17.jar%23135!/:?]

As well as crashes the game with a similar stacktrace when attempting to craft said recipe in the Workbench itself.

Caused by: java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1355) ~[guava-31.1-jre.jar%2374!/:?]
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1337) ~[guava-31.1-jre.jar%2374!/:?]
	at com.google.common.collect.SingletonImmutableList.get(SingletonImmutableList.java:44) ~[guava-31.1-jre.jar%2374!/:?]
	at earth.terrarium.adastra.common.recipes.machines.NasaWorkbenchRecipe.m_5818_(NasaWorkbenchRecipe.java:47) ~[ad_astra-forge-1.20.1-1.15.17.jar%23135!/:?]
	at net.minecraft.world.item.crafting.RecipeManager.m_220242_(RecipeManager.java:108) ~[client-1.20.1-20230612.114412-srg.jar%23142!/:?]

How to Reproduce?

Create a new datapack recipe with the following structure:

            "type": "ad_astra:nasa_workbench",
            "ingredients": [
                {
                    "item": "minecraft:wheat_seeds"
                }
            ],
            "result": {
                "id": "minecraft:blast_furnace",
                "count": 1
            }

Expected Behavior

User defined Nasa Workbench recipes should be able to function with less than 14 items defined in their inputs, with or without air padding. Therefore, the Workbench should not crash when recipes with less than 14 items are defined.

JEI should show the recipe accordingly

Version

1.20.1-1.15.17

Mod Loader Version

1.20.1 - 47.1.3

Mod Loader

Forge

Logs or additional context

The latest.log with the issue is attached:

https://gist.github.com/Witixin1512/4eba2f701185a8fdbca56ad92616c2c6

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.