lucaargolo / kibe

A miscellaneous mod for Minecraft that adds a bunch of random, and mostly unoriginal things.
Mozilla Public License 2.0
46 stars 29 forks source link

Stack overflow when ticking Cobblestone generator #234

Open NickAcPT opened 6 months ago

NickAcPT commented 6 months ago

It seems that Kibe is calling its own tick method in one of the block generator ticking code, which causes a StackOverflow exception when using Tweakeroo: https://github.com/lucaargolo/kibe/blob/a4ba6fab55119d9fcf972ee402f11b74fdc2cd9a/src/main/kotlin/io/github/lucaargolo/kibe/blocks/miscellaneous/BlockGeneratorBlockEntity.kt#L118

Although Tweakeroo is in the call stack, I believe that it's working as intended and instead the issue is that the tick method for the cobblestone generator is recursing onto itself without any stop conditions.

Stacktrace ``` [23:03:38] [Render thread/ERROR]: Reported exception thrown! net.minecraft.util.crash.CrashException: Ticking block entity at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk.java:676) ~[client-intermediary.jar:?] at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk.java:716) ~[client-intermediary.jar:?] at net.minecraft.world.World.tickBlockEntities(World.java:470) ~[client-intermediary.jar:?] at net.minecraft.client.world.ClientWorld.tickEntities(ClientWorld.java:259) ~[client-intermediary.jar:?] at net.minecraft.client.MinecraftClient.tick(MinecraftClient.java:1901) ~[client-intermediary.jar:?] at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1181) ~[client-intermediary.jar:?] at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:802) ~[client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:250) ~[minecraft-1.20.1-client.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.10.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.10.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.10.jar:?] at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) ~[NewLaunch.jar:?] at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) ~[NewLaunch.jar:?] at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[NewLaunch.jar:?] Caused by: java.lang.StackOverflowError at net.minecraft.item.ItemStack.handler$jjh000$tweakeroo$getMaxStackSizeStackSensitive(ItemStack.java:1595) ~[client-intermediary.jar:?] at net.minecraft.item.ItemStack.getMaxCount(ItemStack.java) ~[client-intermediary.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:94) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] at io.github.lucaargolo.kibe.blocks.miscellaneous.BlockGeneratorBlockEntity$Companion.tick(BlockGeneratorBlockEntity.kt:118) ~[kibe-1.10.1-BETA 1.20.jar:?] // ... ```