mrshmllow / BetterRecipeBook

Adds brewing, smithing, and QOL changes to the vanilla recipe book!
https://curseforge.com/minecraft/mc-mods/brb
MIT License
21 stars 8 forks source link

[Bug]: Crash when brewing stand finish brewing when UI open #121

Closed Jemy191 closed 3 months ago

Jemy191 commented 5 months ago

What happened?

The game crash when brewing stand finish brewing and the UI is open

full log

I'll downgrade to 1.8.2 for 1.20.0-1 for now

Modloader

Fabric (Default)

Minecraft Version

1.20.1

Mod Version

1.10.0-rc3+1.20.0-1

Relevant log output

---- Minecraft Crash Report ----
// Who set us up the TNT?

Time: 2024-01-26 19:43:28
Description: Rendering screen

java.lang.ArithmeticException: / by zero
    at marsh.town.brb.generic.GenericRecipeButton.method_48579(GenericRecipeButton.java:52)
    at net.minecraft.class_339.method_25394(class_339.java:78)
    at marsh.town.brb.generic.GenericRecipePage.render(GenericRecipePage.java:147)
    at marsh.town.brb.generic.GenericRecipeBookComponent.method_25394(GenericRecipeBookComponent.java:174)
    at net.minecraft.class_472.handler$bdo000$brb$render(class_472.java:577)
    at net.minecraft.class_472.method_25394(class_472.java:32)
    at net.minecraft.class_437.method_47413(class_437.java:110)
    at net.minecraft.class_757.method_3192(class_757.java:945)
    at net.minecraft.class_310.method_1523(class_310.java:1219)
    at net.minecraft.class_310.method_1514(class_310.java:802)
    at net.minecraft.client.main.Main.main(Main.java:250)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
    at marsh.town.brb.generic.GenericRecipeButton.method_48579(GenericRecipeButton.java:52)
    at net.minecraft.class_339.method_25394(class_339.java:78)
    at marsh.town.brb.generic.GenericRecipePage.render(GenericRecipePage.java:147)
    at marsh.town.brb.generic.GenericRecipeBookComponent.method_25394(GenericRecipeBookComponent.java:174)
    at net.minecraft.class_472.handler$bdo000$brb$render(class_472.java:577)
    at net.minecraft.class_472.method_25394(class_472.java:32)
    at net.minecraft.class_437.method_47413(class_437.java:110)

-- Screen render details --
Details:
    Screen name: net.minecraft.class_472
    Mouse location: Scaled: (336, 98). Absolute: (1346.000000, 394.000000)
    Screen size: Scaled: (480, 270). Absolute: (1920, 1080). Scale factor of 4.000000
Stacktrace:
    at net.minecraft.class_757.method_3192(class_757.java:945)
    at net.minecraft.class_310.method_1523(class_310.java:1219)
    at net.minecraft.class_310.method_1514(class_310.java:802)
    at net.minecraft.client.main.Main.main(Main.java:250)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

-- Affected level --
Details:
    All players: 1 total; [class_746['Jemy191'/103, l='ClientLevel', x=-2061.96, y=73.00, z=3532.97]]
    Chunk stats: 16384, 3653
    Level dimension: minecraft:overworld
    Level spawn location: World: (-64,80,0), Section: (at 0,0,0 in -4,5,0; chunk contains blocks -64,-64,0 to -49,319,15), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)
    Level time: 3760071 game time, 43433 day time
    Server brand: fabric
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.class_638.method_8538(class_638.java:458)
    at net.minecraft.class_310.method_1587(class_310.java:2406)
    at net.minecraft.class_310.method_1514(class_310.java:821)
    at net.minecraft.client.main.Main.main(Main.java:250)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

-- Last reload --
Details:
    Reload number: 1
    Reload reason: initial
    Finished: Yes
    Packs: vanilla, fabric, presencefootsteps:default_sound_pack, distinguishedpotions:potion_overrides, continuity:default, continuity:glass_pane_culling_fix

-- System Details --
##### Omithed see full log in description
mrshmllow commented 5 months ago

Believe this happens when the list of filtered craft-able reaches 0 unexpectedly

RashidFTW commented 4 months ago

I just got a crash for the same error while using a smithing table.

Steps to reproduce (4 out of 4 times):

  1. Open smithing table
  2. Fill all slots (as if adding a trim): Any armor piece, any smithing template, any material
  3. Click the crafting book
  4. Tick to show only smithable recipes
  5. Remove the smithing template from the smithing table
  6. Crash...

crash-2024-02-18_12.59.22-client.txt

mrshmllow commented 4 months ago

@RashidFTW Please open a new issue for new bugs, and reproduce without 10000000000000000000000000 mods installed

RashidFTW commented 4 months ago

@RashidFTW Please open a new issue for new bugs, and reproduce without 10000000000000000000000000 mods installed

Just opened a new issue . But, the mods aren't the problem, I reproduced it without the rest of the mods (Didn't take long...).

FYI: Better to bring up no results in this use-case than to not safe-check divide by zero and resort to a silly crash that leads to players loosing their progress... Then you won't need to go through 10000000000000000000000000 mods either.

mrshmllow commented 4 months ago

Better to bring up no results in this use-case than to not safe-check divide by zero and resort to a silly crash that leads to players loosing their progress...

Pull requests welcome

mrshmllow commented 3 months ago

I cannot seem to reproduce this bug. But it may of been fixed by closing #128.. If it happens again please reopen this