Ad Astra

Ad Astra

22M Downloads

[Bug]: Capacitor switching modes causes player to exit

9m113konkurs opened this issue · 2 comments

commented

Bug Description

Player is kicked out when switching capacitor mode with shift+right click.
Displays "Internal Server Error".
Server is not crashed, but the player will always instant-kicked with the same message.
This persists even after the player loses the capacitor item; I did this by killing the problematic player the instant they joined. Upon further connection attempts, the exit screen simply says "Disconnected".

How to Reproduce?

  1. Grab a fully charged capacitor from JEI cheat mode;
  2. Shift+right click with capacitor in hand;
  3. Player is kicked out, screen says "Internal Server Error".
  4. Kill player (make sure keepInventory is false) when the player joins (and before he is kicked);
  5. Afterwards player still is instant-kicked, screen says "Disconnected".

Expected Behavior

Mode is switched without errors or exits.

Version

1.15.8

Mod Loader Version

47.2.19

Mod Loader

No response

Logs or additional context

LOG BEFORE KILLING PLAYER (STILL HAS CAPACITOR IN INVENTORY)
[12:08:56] [Server thread/WARN] [minecraft/ServerConnectionListener]: Failed to handle packet for /127.0.0.1:52202
net.minecraft.ReportedException: Ticking player
at net.minecraft.server.level.ServerPlayer.m_9240_(ServerPlayer.java:530) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_9933_(ServerGamePacketListenerImpl.java:262) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.network.Connection.m_129483_(Connection.java:263) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:142) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:907) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ArithmeticException: / by zero
at earth.terrarium.adastra.common.items.EtrionicCapacitorItem.distributeRoundRobin(EtrionicCapacitorItem.java:154) ~[ad_astra-forge-1.20.1-1.15.8.jar%23156!/:?]
at earth.terrarium.adastra.common.items.EtrionicCapacitorItem.m_6883_(EtrionicCapacitorItem.java:125) ~[ad_astra-forge-1.20.1-1.15.8.jar%23156!/:?]
at net.minecraft.world.item.ItemStack.m_41666_(ItemStack.java:481) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Inventory.m_36068_(Inventory.java:229) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Player.m_8107_(Player.java:499) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.LivingEntity.m_8119_(LivingEntity.java:2298) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Player.m_8119_(Player.java:241) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.level.ServerPlayer.m_9240_(ServerPlayer.java:467) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
... 9 more
[12:18:24] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: 9M113_Konkurs lost connection: Internal server error

LOG AFTER CAPACITOR IS REMOVED FROM INVENTORY VIA KILLING PLAYER
[12:15:05] [Server thread/INFO] [minecraft/MinecraftServer]: 9M113 joined the game
[12:15:05] [Server thread/ERROR] [recruits/]: Villager recruits could not check for updates!
[12:15:06] [Server thread/WARN] [minecraft/ServerConnectionListener]: Failed to handle packet for /127.0.0.1:52205
net.minecraft.ReportedException: Ticking player
at net.minecraft.server.level.ServerPlayer.m_9240_(ServerPlayer.java:530) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_9933_(ServerGamePacketListenerImpl.java:262) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.network.Connection.m_129483_(Connection.java:263) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:142) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:907) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ArithmeticException: / by zero
at earth.terrarium.adastra.common.items.EtrionicCapacitorItem.distributeRoundRobin(EtrionicCapacitorItem.java:154) ~[ad_astra-forge-1.20.1-1.15.8.jar%23156!/:?]
at earth.terrarium.adastra.common.items.EtrionicCapacitorItem.m_6883_(EtrionicCapacitorItem.java:125) ~[ad_astra-forge-1.20.1-1.15.8.jar%23156!/:?]
at net.minecraft.world.item.ItemStack.m_41666_(ItemStack.java:481) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Inventory.m_36068_(Inventory.java:229) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Player.m_8107_(Player.java:499) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.LivingEntity.m_8119_(LivingEntity.java:2298) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.world.entity.player.Player.m_8119_(Player.java:241) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
at net.minecraft.server.level.ServerPlayer.m_9240_(ServerPlayer.java:467) ~[server-1.20.1-20230612.114412-srg.jar%23211!/:?]
... 9 more
[12:18:24] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: 9M113_Konkurs lost connection: Internal server error

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.
commented

The same issue persists even after killing the drop by /kill @e[type=item].

commented

Has already been fixed in 208c8ea. Will release an update soon