Tool Belt

Tool Belt

51M Downloads

[1.16] Crash when moving toolbelt item

lunofe opened this issue · 2 comments

commented

Hi, I've found a way to crash both the server and client with the toolbelt mod.

Tested with:

  • Minecraft 1.16.5
  • Forge 36.2.31 (Client & Server)
  • Toolbelt 1.16.0
  • No other mods

Showcase:

Animation

Reproduce:

  1. Get a toolbelt
  2. Open it by shift + right-click
  3. Try to move it to another slot by pressing a number on your keyboard while hovering over another slot
  4. Crashes both the server & client

Server log

[15Mär2022 22:06:12.896] [Server thread/FATAL] [net.minecraft.util.concurrent.ThreadTaskExecutor/]: Error executing task on Server
java.lang.RuntimeException: No inventory!
	at dev.gigaherz.toolbelt.common.BeltSlot$1.lambda$findStack$0(BeltSlot.java:33) ~[toolbelt:1.16.0]
	at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:296) ~[forge:?]
	at dev.gigaherz.toolbelt.common.BeltSlot$1.findStack(BeltSlot.java:33) ~[toolbelt:1.16.0]
	at dev.gigaherz.toolbelt.common.BeltSlot$1.func_70301_a(BeltSlot.java:54) ~[toolbelt:1.16.0]
	at net.minecraft.inventory.container.Slot.func_75211_c(Slot.java:53) ~[?:?]
	at net.minecraft.inventory.container.Container.func_75142_b(Container.java:120) ~[?:?]
	at dev.gigaherz.toolbelt.common.BeltContainer.func_75142_b(BeltContainer.java:82) ~[toolbelt:1.16.0]
	at net.minecraft.network.play.ServerPlayNetHandler.func_147351_a(ServerPlayNetHandler.java:1269) ~[?:?]
	at net.minecraft.network.play.client.CClickWindowPacket.func_148833_a(CClickWindowPacket.java:34) ~[?:?]
	at net.minecraft.network.play.client.CClickWindowPacket.func_148833_a(CClickWindowPacket.java:12) ~[?:?]
	at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) ~[?:?]
	at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) ~[?:?]
	at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:734) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:159) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:717) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:711) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:696) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:646) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_321]
[15Mär2022 22:06:12.946] [Server thread/FATAL] [net.minecraftforge.common.ForgeMod/]: Preparing crash report with UUID f633b152-240f-46f8-8143-cc47061010de
[15Mär2022 22:06:12.949] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Ticking entity
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:855) ~[?:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_321]
Caused by: java.lang.RuntimeException: No inventory!
	at dev.gigaherz.toolbelt.common.BeltSlot$1.lambda$findStack$0(BeltSlot.java:33) ~[toolbelt:1.16.0]
	at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:296) ~[forge:?]
	at dev.gigaherz.toolbelt.common.BeltSlot$1.findStack(BeltSlot.java:33) ~[toolbelt:1.16.0]
	at dev.gigaherz.toolbelt.common.BeltSlot$1.func_70301_a(BeltSlot.java:54) ~[toolbelt:1.16.0]
	at net.minecraft.inventory.container.Slot.func_75211_c(Slot.java:53) ~[?:?]
	at net.minecraft.inventory.container.Container.func_75142_b(Container.java:120) ~[?:?]
	at dev.gigaherz.toolbelt.common.BeltContainer.func_75142_b(BeltContainer.java:82) ~[toolbelt:1.16.0]
	at net.minecraft.entity.player.ServerPlayerEntity.func_70071_h_(ServerPlayerEntity.java:360) ~[?:?]
	at net.minecraft.world.server.ServerWorld.func_217479_a(ServerWorld.java:611) ~[?:?]
	at net.minecraft.world.World.func_217390_a(World.java:554) ~[?:?]
	at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:404) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:851) ~[?:?]
	... 5 more

Client log

[21:06:13] [Render thread/FATAL] [minecraft/Minecraft]: Reported exception thrown!
net.minecraft.crash.ReportedException: Rendering screen
	at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:505) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:977) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:184) ~[minecraft-1.16.5-client.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.2.31-launcher.jar:36.2] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:57) [ForgeWrapper-mmc3.jar:mmc3] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210) [NewLaunch.jar:?] {}
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?] {}
	at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?] {}
Caused by: java.lang.RuntimeException: No inventory!
	at dev.gigaherz.toolbelt.common.BeltSlot$1.lambda$findStack$0(BeltSlot.java:33) ~[toolbelt:1.16.0] {re:classloading}
	at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:296) ~[forge:?] {re:classloading}
	at dev.gigaherz.toolbelt.common.BeltSlot$1.findStack(BeltSlot.java:33) ~[toolbelt:1.16.0] {re:classloading}
	at dev.gigaherz.toolbelt.common.BeltSlot$1.func_70301_a(BeltSlot.java:54) ~[toolbelt:1.16.0] {re:classloading}
	at net.minecraft.inventory.container.Slot.func_75211_c(Slot.java:53) ~[?:?] {re:classloading}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.func_238746_a_(ContainerScreen.java:191) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.func_230430_a_(ContainerScreen.java:106) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at dev.gigaherz.toolbelt.common.BeltScreen.func_230430_a_(BeltScreen.java:29) ~[toolbelt:1.16.0] {re:classloading}
	at net.minecraftforge.client.ForgeHooksClient.drawScreenInternal(ForgeHooksClient.java:377) ~[forge:?] {re:classloading}
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:370) ~[forge:?] {re:classloading}
	at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:492) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	... 26 more
commented

Huh... I'll look into it.

(I have never once in my life used the number keys to move slots... except by mistake, so it's not something I would ever think of testing.)

commented

It should be fixed in the latest releases for 1.16.5 and 1.18.2.