SilentChaos512 / Silent-Gear

Modular tool/armor mod (formerly part of Silent's Gems)
https://www.curseforge.com/minecraft/mc-mods/silent-gear
MIT License
83 stars 37 forks source link

NullPointerException from recalculating stats #441

Open jeremiahwinsley opened 3 years ago

jeremiahwinsley commented 3 years ago

Versions

Expected Behavior

The server connection should not fail.

Actual Behavior

When joining a server under certain circumstances, possibly to do with specific tools, the connection will fail with a NullPointerException. This happens without Curious Elytra, but I was only able to consistently reproduce it with Curious Elytra installed.

The issue appears to be with the RecalculateStatsPacket. In this case, the packet attempts to send another recalculate packet for the max durability, and fails because net.minecraft.client.Minecraft.getConnection() returns null.

Links/Images

Steps to Reproduce the Problem

  1. Create server and client instance with Forge 36.2.8, install Silent Gear, Curious Elytra, and their dependencies.
  2. Add -Dforge.logging.mojang.level=debug to client java args, so that the full stack trace shows up in the logs.
  3. Create a Silent Gear elytra (tested with phantom membrane and fine silk), and wear it in the Curio back slot.
  4. Log out of the server, then attempt to log back in.
jeremiahwinsley commented 2 years ago

Issue still exists on 1.18.1. Silent Gear: 2.8.2 Silent Lib: 6.0.0 Forge 39.0.9

Curious Elytra: 5.0.0.1 Curios: 5.0.4.2 Caelus: 3.0.0.1

2021-12-31 11_05_16-Minecraft_ 1 18 1

MoonMoonShark commented 1 year ago

still having this problem in 1.18.2

Forge: 40.1.84 Silent Gear: silent-gear-1.18.2-2.10.16.jar Silent Lib: silent-lib-1.18.2-6.2.0.jar