Reika_Mods_Issues icon indicating copy to clipboard operation
Reika_Mods_Issues copied to clipboard

[RotaryCraft] WorktableAPI broken

Open voidentente opened this issue 1 year ago • 0 comments

Reika.RotaryCraft.API.WorktableAPI is trying to access a method that doesn't exist:

ref = Class.forName("Reika.RotaryCraft.Auxiliary.RecipeManagers.WorktableRecipes");
Field i = ref.getDeclaredField("instance");
i.setAccessible(true);
instance = i.get(null);
add = ref.getMethod("addRecipe", IRecipe.class);

The only method with this signature in Reika.RotaryCraft.Auxiliary.RecipeManagers.WorktableRecipes is this:

public void addAPIRecipe(IRecipe recipe) {
        this.addRecipe(recipe, RecipeLevel.API);
}

Looks like the method was renamed at some point. A quick fix might look like this:

add = ref.getMethod("addAPIRecipe", IRecipe.class);

Workaround: WorktableRecipes.addAPIRecipe can be directly invoked, since it's public. If this is the intended way, WorktableAPI should be marked as deprecated.

voidentente avatar Dec 12 '23 07:12 voidentente