SuperMartijn642 / WirelessChargers

3 stars 0 forks source link

[Crash] Crash When Opening Creative Menu on page containing Wireless Chargers Mod #29

Closed ZuidVolt closed 2 weeks ago

ZuidVolt commented 2 weeks ago

Description: The game crashes when opening the creative menu and navigating to the page containing items from the wirelesschargers mod. The crash report suggests a NullPointerException during block entity rendering, specifically when trying to access a bakedModel object that appears to be null.

Steps to Reproduce:

  1. Install the wirelesschargers mod with Fabric.
  2. Start Minecraft and open a creative world.
  3. Open the creative menu and navigate to the modded page in the item selection screen (the page where wirelesschargers items are located).
  4. The game crashes with a rendering-related error.

Crash Report (~/logs/latest.log):

// Surprise! Haha. Well, this is awkward.
Time: 2024-11-10 14:14:03
Description: Rendering Block Entity
java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1087.method_4707(net.minecraft.class_2680, net.minecraft.class_2350, net.minecraft.class_5819)" because "bakedModel" is null
    at net.minecraft.class_778.handler$lgl000$sodium$renderFast(class_778.java:2577)
    at net.minecraft.class_778.method_3367(class_778.java)
    at com.supermartijn642.wirelesschargers.ChargerRenderer.render(ChargerRenderer.java:29)
    at com.supermartijn642.wirelesschargers.ChargerRenderer.render(ChargerRenderer.java:18)
    ... (additional lines truncated for brevity)

Installed Mods:

SuperMartijn642 commented 2 weeks ago

Welp, seems this broke from 1.20.6 to 1.21 and I didn't notice. I did fix it in 1.21.2 already, but didn't make the same change for 1.21 🙃 Should be fixed now in version 1.0.9a of Wireless Chargers for Fabric on 1.21. Thank you for reporting the issue!