The Bumblezone (Quilt/Fabric)

The Bumblezone (Quilt/Fabric)

12M Downloads

Game crashes if a Honey Block is inserted in the Electric Furnace from Tech Reborn or the Powered Furnace from Energized Power

JDDev0 opened this issue ยท 6 comments

commented

RecipeType.SMELTING requires recipes to extend from net.minecraft.world.item.crafting.SmeltingRecipe. The class com.telepathicgrunt.the_bumblezone.items.recipes.ItemStackSmeltingRecipe should extend SmeltingRecipe - You need to change the extends from AbstractCookingRecipe to SmeltingRecipe and remove RecipeType.SMELTING from the super constructor call, afterwards the crash should be fixed.

Currently the recipes using the the_bumblezone:itemstack_smelting_recipe recipe type are not shown in REI on Forge and cause crashes in Energized Power and Tech Reborn - See crash report after a Honey Block was inserted in the Electric Furnace from Tech Reborn: crash-2023-12-13_18.10.26-server.txt.

commented

Kinda surprising as AbstractCookingRecipe implements everything they need to know for the class and the recipe type being smelting for what it is for. Checking each derived class, I don't see anything special that would require casting at all. Just casting to AbstractCookingRecipe would be enough.

commented

In Tech Reborn and Energized Power SmeltingRecipe is explicitly used and not AbstractCookingRecipe:

commented

This line will try to cast the recipe to a SmeltingRecipe: Optional<SmeltingRecipe> testRecipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, inventory, world).map(RecipeEntry::value);

commented

But my question is, why the cast? Why cant you just check for the recipe type like you're doing and keep it as AbstractCookingRecipe? What necessitates the need to cast to SmeltingRecipe when it doesn't seem to prove any extra functionality?

I will fix my recipe to extend it but I'm feeling like this is an assumption that mods made that turned out to be weird and not always safe to do.

commented

OH. I see. Then I am definitely incorrect here as recipe type itself expects SmeltingRecipe
public static final RecipeType<SmeltingRecipe> SMELTING = RecipeType.register("smelting");

commented

Fixed now in v7.2.9