JADE crashes clients if getCloneItemStack errors
robotgryphon opened this issue ยท 1 comments
Mod loader
NeoForge
Minecraft version
1.20.4
Mod version
13.3.1
Modloader version
Neoforge 20.4.223
Modpack info
No response
If bug:
- Can you reproduce this issue with relevant mods only?
If bug: The latest.log file
No response
Issue description
Currently working on overhauling Compact Machines. Hit a consistent crash while adding JADE support, because I accidentally introduced a NPE in my own code.
Problem is, JADE should probably be error handling this and showing a missing block texture in its UI, rather than allowing the error to bubble up and crash the game...
java.lang.NullPointerException: Cannot invoke "net.minecraft.resources.ResourceLocation.toString()" because "templateId" is null
at dev.compactmods.machines.api.machine.item.IUnboundCompactMachineItem.setTemplate(IUnboundCompactMachineItem.java:15) ~[%23228!/:?] {re:classloading}
at dev.compactmods.machines.neoforge.machine.item.UnboundCompactMachineItem.forTemplate(UnboundCompactMachineItem.java:88) ~[%23226!/:?] {re:classloading}
at dev.compactmods.machines.neoforge.machine.block.UnboundCompactMachineBlock.getCloneItemStack(UnboundCompactMachineBlock.java:42) ~[%23226!/:?] {re:classloading}
at net.neoforged.neoforge.common.extensions.IBlockStateExtension.getCloneItemStack(IBlockStateExtension.java:229) ~[neoforge-20.4.223.jar%23222%23229!/:?] {re:classloading}
at snownee.jade.util.CommonProxy.getBlockPickedResult(CommonProxy.java:308) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.impl.BlockAccessorImpl.getPickedResult(BlockAccessorImpl.java:120) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.addon.core.ObjectNameProvider.appendTooltip(ObjectNameProvider.java:79) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.impl.BlockAccessorClientHandler.gatherComponents(BlockAccessorClientHandler.java:87) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.impl.BlockAccessorClientHandler.gatherComponents(BlockAccessorClientHandler.java:25) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.overlay.WailaTickHandler.tickClient(WailaTickHandler.java:190) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
at snownee.jade.util.ClientProxy.onClientTick(ClientProxy.java:172) ~[Jade-1.20.4-neoforge-13.3.1.jar%23211!/:13.3.1] {re:classloading}
If I remember correctly, it only crashes in the development environment. Otherwise, Jade's UI will disappear in the production environment and users will think this is a Jade's problem and report it to me.