AppleSkin

AppleSkin

236M Downloads

[Fabric 1.18] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1792.method_19263()" because the return value of "net.minecraft.class_1799.method_7909()" is null

axelrindle opened this issue ยท 12 comments

commented

Minecraft Crash Report

---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 18.12.21, 23:28
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1792.method_19263()" because the return value of "net.minecraft.class_1799.method_7909()" is null
	at Not Enough Crashes deobfuscated stack trace.(1.18+build.1)
	at squeek.appleskin.helpers.FoodHelper.isFood(FoodHelper.java:19)
	at squeek.appleskin.helpers.FoodHelper.canConsume(FoodHelper.java:25)
	at squeek.appleskin.client.HUDOverlayHandler.onRender(HUDOverlayHandler.java:115)
	at net.minecraft.client.gui.hud.InGameHud.handler$zzd000$renderFoodPost(InGameHud:1521)
	at net.minecraft.client.gui.hud.InGameHud.renderStatusBars(InGameHud:918)
	at net.minecraft.client.gui.hud.InGameHud.render(InGameHud:247)
	at net.minecraft.client.render.GameRenderer.render(GameRenderer:855)
	at net.minecraft.client.MinecraftClient.render(MinecraftClient:1117)
	at net.minecraft.client.MinecraftClient.run(MinecraftClient:733)
	at net.minecraft.client.main.Main.main(Main:236)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:568)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:602)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at squeek.appleskin.helpers.FoodHelper.isFood(FoodHelper.java:19)
	at squeek.appleskin.helpers.FoodHelper.canConsume(FoodHelper.java:25)
	at squeek.appleskin.client.HUDOverlayHandler.onRender(HUDOverlayHandler.java:115)
	at net.minecraft.class_329.handler$zzd000$renderFoodPost(class_329.java:1521)
	at net.minecraft.class_329.method_1760(class_329.java:918)
	at net.minecraft.class_329.method_1753(class_329.java:247)

-- Affected level --
Details:
	All players: 1 total; [class_746['lalo5'/144, l='ClientLevel', x=-8.31, y=120.55, z=-136.10]]
	Chunk stats: 4096, 2012
	Level dimension: minecraft:the_nether
	Level spawn location: World: (0,120,0), Section: (at 0,8,0 in 0,7,0; chunk contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 3970115 game time, 5180696 day time
	Server brand: fabric
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.class_638.method_8538(class_638.java:408)
	at net.minecraft.class_310.method_1587(class_310.java:2402)
	at net.minecraft.class_310.method_1514(class_310.java:757)
	at net.minecraft.client.main.Main.main(Main.java:236)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:602)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

-- Last reload --
Details:
	Reload number: 1
	Reload reason: initial
	Finished: Yes
	Packs: Default, Fabric Mods, lambdabettergrass/default, NoMorePumpkinBlur-1.16.zip, cullleaves/smartleaves, continuity/default, continuity/glass_pane_culling_fix

-- System Details --
Details:
	Minecraft Version: 1.18
	Minecraft Version ID: 1.18
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 17.0.1, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 4128027592 bytes (3936 MiB) / 6375342080 bytes (6080 MiB) up to 6442450944 bytes (6144 MiB)
	CPUs: 12
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 5 3600XT 6-Core Processor            
	Identifier: AuthenticAMD Family 23 Model 113 Stepping 0
	Microarchitecture: Zen 2
	Frequency (GHz): 3,80
	Number of physical packages: 1
	Number of physical CPUs: 6
	Number of logical CPUs: 12
	Graphics card #0 name: Radeon RX 5500 XT
	Graphics card #0 vendor: Advanced Micro Devices, Inc. (0x1002)
	Graphics card #0 VRAM (MB): 4095,00
	Graphics card #0 deviceId: 0x7340
	Graphics card #0 versionInfo: DriverVersion=30.0.14011.3017
	Memory slot #0 capacity (MB): 8192,00
	Memory slot #0 clockSpeed (GHz): 3,20
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 8192,00
	Memory slot #1 clockSpeed (GHz): 3,20
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 29620,54
	Virtual memory used (MB): 19316,65
	Swap memory total (MB): 13312,00
	Swap memory used (MB): 168,69
	JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx6G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Fabric Mods: 
		advanced_runtime_resource_pack: Runtime Resource Pack 0.5.4
		appleskin: AppleSkin mc1.18-2.2.0
		architectury: Architectury 3.2.49
		armor-stand-editor: Armor Stand Editor 1.3.1+1.18-rc3
		bedrockify: BedrockIfy 1.3.0+mc1.18
		blue_endless_jankson: jankson 1.2.1
		clickthrough: ClickThrough 1.18-fabric0.43.1-0.4
		cloth-basic-math: cloth-basic-math 0.6.0
		cloth-config: Cloth Config v6 6.0.42
		continuity: Continuity 1.0.3+1.18
		cosmetica: Cosmetica 0.3.2
		crowdin-translate: CrowdinTranslate 1.4+1.18
		cullleaves: Cull Leaves 2.3.2
		editsign: EditSign 2.2.6
		enhancedblockentities: Enhanced Block Entities 0.5+1.18
		fabric: Fabric API 0.44.0+1.18
		fabric-api-base: Fabric API Base 0.4.1+b4f4f6cdc8
		fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.4.0+16d92c47c8
		fabric-biome-api-v1: Fabric Biome API (v1) 6.0.1+ded849a9c8
		fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.9+3ac43d95c8
		fabric-command-api-v1: Fabric Command API (v1) 1.1.6+3ac43d95c8
		fabric-commands-v0: Fabric Commands (v0) 0.2.5+b4f4f6cdc8
		fabric-containers-v0: Fabric Containers (v0) 0.1.18+d154e2c6c8
		fabric-content-registries-v0: Fabric Content Registries (v0) 0.4.5+6f53a73dc8
		fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.8+3ac43d95c8
		fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.7+43d29571c8
		fabric-entity-events-v1: Fabric Entity Events (v1) 1.4.5+6b21378ac8
		fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.16+bfa23f17c8
		fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.6+b4f4f6cdc8
		fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.10+3ac43d95c8
		fabric-item-api-v1: Fabric Item API (v1) 1.3.0+691a79b5c8
		fabric-item-groups-v0: Fabric Item Groups (v0) 0.3.3+3ac43d95c8
		fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.8+c8aba2f3c8
		fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.6+b4f4f6cdc8
		fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.4.10+c15ca335c8
		fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.8+3ac43d95c8
		fabric-mining-level-api-v1: Fabric Mining Level API (v1) 1.0.3+3ac43d95c8
		fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.7+b4f4f6cdc8
		fabric-models-v0: Fabric Models (v0) 0.3.3+3ac43d95c8
		fabric-networking-api-v1: Fabric Networking API (v1) 1.0.18+3ac43d95c8
		fabric-networking-v0: Fabric Networking (v0) 0.3.5+b4f4f6cdc8
		fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.11.0+3b82842ec8
		fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.8+3ac43d95c8
		fabric-particles-v1: Fabric Particles (v1) 0.2.9+526dc1acc8
		fabric-permissions-api-v0: fabric-permissions-api 0.1-SNAPSHOT
		fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.8.5+3ac43d95c8
		fabric-renderer-api-v1: Fabric Renderer API (v1) 0.4.9+3ac43d95c8
		fabric-renderer-indigo: Fabric Renderer - Indigo 0.4.12+3ac43d95c8
		fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.7+b4f4f6cdc8
		fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.4+7242e9d7c8
		fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.18+3ac43d95c8
		fabric-rendering-v0: Fabric Rendering (v0) 1.1.9+b4f4f6cdc8
		fabric-rendering-v1: Fabric Rendering (v1) 1.10.3+6b21378ac8
		fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.4.11+3ac43d95c8
		fabric-screen-api-v1: Fabric Screen API (v1) 1.0.7+3ac43d95c8
		fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.11+3ac43d95c8
		fabric-structure-api-v1: Fabric Structure API (v1) 2.0.8+295197a7c8
		fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.2.5+3ac43d95c8
		fabric-textures-v0: Fabric Textures (v0) 1.0.9+3ac43d95c8
		fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.3.4+7de09f55c8
		fabric-transfer-api-v1: Fabric Transfer API (v1) 1.5.5+b4f4f6cdc8
		fabricloader: Fabric Loader 0.12.11
		fallingleaves: Falling Leaves 1.8.0+1.18
		ferritecore: FerriteCore 4.0.0
		gbfabrictools: GBfabrictools 1.3.4+1.18
		goosik-config: goosik-config 0.2.0
		indium: Indium 1.0.2-alpha1+mc1.18
		inventoryprofilesnext: Inventory Profiles Next 1.2.1
		iris: Iris 1.1.3
		jankson: Jankson 4.0.0+j1.2.0
		java: OpenJDK 64-Bit Server VM 17
		kirin: Kirin UI 1.10.0-beta.2
		lambdabettergrass: LambdaBetterGrass 1.2.1+1.17
		lambdynlights: LambDynamicLights 2.1.0+1.17
		lazydfu: LazyDFU 0.1.2
		libgui: LibGui 5.0.0-beta.2+1.18-rc1
		libninepatch: LibNinePatch 1.1.0
		lithium: Lithium 0.7.6-rc1
		midnightlib: MidnightLib 0.2.9
		minecraft: Minecraft 1.18
		modmenu: Mod Menu 3.0.0
		notenoughcrashes: Not Enough Crashes 4.1.3+1.18
		org_anarres_jcpp: jcpp 1.4.14
		org_aperlambda_lambdajcommon: lambdajcommon 1.8.1
		org_joml_joml: joml 1.10.2
		org_slf4j_slf4j-api: slf4j-api 1.7.12
		packet_tweaker: Packet Tweaker 0.2.0+1.18-pre1
		presencefootsteps: Presence Footsteps 1.4.0
		pride: Pride Lib 1.1.0+1.17
		rebind_all_the_keys: RebindAllTheKeys 1.1.1+1.18
		server_translations_api: Server Translations API 1.4.8+1.18-pre1
		sgui: sgui 1.0.0-rc6+1.18-pre5
		sodium: Sodium 0.4.0-alpha5+build.9
		sodium-extra: Sodium Extra 0.3.7
		spruceui: SpruceUI 3.3.0+1.17
		starlight: Starlight 1.0.0+fabric.d0a3220
		stendhal: Stendhal 1.2.0-1.18
		visuality: Visuality 0.3.3
		waterdripsound: Drip Sounds 1.18-0.3.0
		wthit: wthit 4.3.1
		xaerominimap: Xaero's Minimap 21.22.3.1
		xaeroworldmap: Xaero's World Map 1.18.6.1
	Launched Version: fabric-loader-0.12.11-1.18
	Backend library: LWJGL version 3.2.2 build 10
	Backend API: Radeon RX 5500 XT GL version 3.2.14802 Core Profile Forward-Compatible Context 21.12.1 30.0.14011.3017, ATI Technologies Inc.
	Window size: 1920x1017
	GL Caps: Using framebuffer using OpenGL 3.2
	GL debug messages: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fabric'; Server brand changed to 'fabric'
	Type: Integrated Server (map_client.txt)
	Graphics mode: fancy
	Resource Packs: vanilla, Fabric Mods, lambdabettergrass/default (incompatible), file/NoMorePumpkinBlur-1.16.zip (incompatible), cullleaves/smartleaves (incompatible), continuity/default, continuity/glass_pane_culling_fix
	Current Language: Deutsch (Deutschland)
	CPU: 12x AMD Ryzen 5 3600XT 6-Core Processor 
	Server Running: true
	Player Count: 1 / 8; [class_3222['lalo5'/144, l='ServerLevel[Neue Welt]', x=-8.31, y=120.55, z=-136.10]]
	Data Packs: vanilla, Fabric Mods
	Client Crashes Since Restart: 1
	Integrated Server Crashes Since Restart: 0
	Suspected Mods: Minecraft (minecraft), AppleSkin (appleskin), Fabric Loader (fabricloader)

Additional information

All entities in the used world are invisible now...

Edit: A game restart fixed the invisibility issue.

commented

The relevant code line seems to be the following:

return itemStack.getItem().isFood();

commented

so you just throw it under a try-catch?

commented
return itemStack.getItem() != null && itemStack.getItem().isFood();

should work

commented

By the way, this seems like something that should also be reported to (presumably) whatever mod is causing the ItemStack's getItem function to return null, as it seems very likely that it will cause other problems (e.g. there are many places in vanilla code that do not null-check their ItemStack.getItem calls: in ItemStack alone there's use, finishUsing, getMiningSpeedMultiplier, isDamageable, and tons more).

So, somehow an ItemStack both:

  • Is not empty, as getItem() is implemented as return this.empty ? Items.AIR : this.item;, so if it was empty getItem would not return null
  • Has its item field set to null

This is likely a bug, as it's not really a state that a valid ItemStack should be in AFAICT.

commented

@axelrindle Is it possible for you to zip up your mods folder and host it somewhere temporarily? I'd like to try to track down the root cause to understand this better.

commented
commented

I can't seem to reproduce the crash, unfortunately.

If you can still reproduce it, does the crash go away if you remove AppleSkin? Is there something specific that causes the crash when you hold it?

commented

I will try to reproduce it, but the crash only occurred once and I can not remember if there was something specific I did at that point.

commented

No worries, since you don't have any mods installed that add new items that I can see, it seems somewhat more likely that this is a state that vanilla Minecraft can get itself into. Could still be a bug on someone's end, but might not be another mod that's causing it like I was thinking.

commented

Hey there. Just a heads-up that it also happens with the 1.17-fabric (probably 1.16-fabric too) version of the mod. First encountered on v2.1.3, still occurs on release v2.2.0. Sadly, couldn't reproduce the crash consistently, it occured seemingly at random. Adding the proposed fix and re-compiling seems to help, no crashes so far.
Modpack: Euphoric Curiosity v2.8

Quick edit: thanks for your work!

commented

Should be fixed in v2.3.0.