Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JADE crashes clients if getCloneItemStack errors #391

Closed
1 task done
robotgryphon opened this issue Apr 7, 2024 · 1 comment
Closed
1 task done

JADE crashes clients if getCloneItemStack errors #391

robotgryphon opened this issue Apr 7, 2024 · 1 comment

Comments

@robotgryphon
Copy link

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}
@Snownee
Copy link
Owner

Snownee commented Apr 7, 2024

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.

@Snownee Snownee closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants