[1.16] Using NetworkManager.createAddEntityPacket causes NoClassDefFoundError on dedicated server
itsmeow opened this issue ยท 6 comments
Making a non-living entity and overriding getAddEntityPacket
to return NetworkManager.createAddEntityPacket(this);
causes a crash when this entity is spawned on a dedicated server.
I've looked into said code and I am a bit confused considering ClientLevel (class_638) isn't referenced, but maybe it could be blamed on this line containing a client referenece without @Environment
. It seems to take place within NetworkManager
, so that's confusing. It's not something in my source either, no client references in EntityModEgg
.
I tested it with another projectile using a different parent class, the issue remains.
---- Minecraft Crash Report ----
// There are four lights!
Time: 12/23/21, 3:47 AM
Description: Exception in server tick loop
java.lang.NoClassDefFoundError: net/minecraft/class_638
at me.shedaniel.architectury.networking.fabric.NetworkManagerImpl.createAddEntityPacket(NetworkManagerImpl.java:139)
at me.shedaniel.architectury.networking.NetworkManager.createAddEntityPacket(NetworkManager.java)
at dev.itsmeow.betteranimalsplus.common.entity.projectile.EntityModEgg.method_18002(EntityModEgg.java:73)
at net.minecraft.class_3231.method_18757(class_3231.java:224)
at net.minecraft.class_3231.method_18760(class_3231.java:214)
at net.minecraft.class_3898$class_3208.method_18736(class_3898.java:1238)
at net.minecraft.class_3898$class_3208.method_18729(class_3898.java:1265)
at net.minecraft.class_3898.method_18701(class_3898.java:1020)
at net.minecraft.class_3215.method_18755(class_3215.java:477)
at net.minecraft.class_3218.method_18778(class_3218.java:933)
at net.minecraft.class_3218.method_14175(class_3218.java:835)
at net.minecraft.class_3218.method_8649(class_3218.java:765)
at dev.itsmeow.betteranimalsplus.common.item.ItemThrowableCustomEgg.method_7836(ItemThrowableCustomEgg.java:68)
at net.minecraft.class_1799.method_7913(class_1799.java:239)
at net.minecraft.class_3225.method_14256(class_3225.java:283)
at net.minecraft.class_3244.method_12065(class_3244.java:1076)
at net.minecraft.class_2886.method_12550(class_2886.java:31)
at net.minecraft.class_2886.method_11054(class_2886.java:9)
at net.minecraft.class_2600.method_11072(class_2600.java:21)
at net.minecraft.class_3738.run(class_3738.java:18)
at net.minecraft.class_1255.method_18859(class_1255.java:144)
at net.minecraft.class_4093.method_18859(class_4093.java:23)
at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:761)
at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:155)
at net.minecraft.class_1255.method_16075(class_1255.java:118)
at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:743)
at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:737)
at net.minecraft.class_1255.method_18857(class_1255.java:127)
at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:722)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:674)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: net.minecraft.class_638
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:158)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 32 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.16.5
Minecraft Version ID: 1.16.5
Operating System: Windows 10 (amd64) version 10.0
Java Version: 11.0.11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 376255976 bytes (358 MB) / 1236271104 bytes (1179 MB) up to 2147483648 bytes (2048 MB)
CPUs: 12
JVM Flags: 1 total; -Xmx2G
Fabric Mods:
architectury: Architectury 1.26.40
betteranimalsplus: Better Animals Plus 1.16.5-10.2.0
fabric: Fabric API 0.42.0+1.16
fabric-api-base: Fabric API Base 0.4.0+3cc0f0907d
fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.3.1+3cc0f0907d
fabric-biome-api-v1: Fabric Biome API (v1) 3.1.13+3cc0f0907d
fabric-command-api-v1: Fabric Command API (v1) 1.1.3+3cc0f0907d
fabric-commands-v0: Fabric Commands (v0) 0.2.3+3cc0f0907d
fabric-containers-v0: Fabric Containers (v0) 0.1.12+3cc0f0907d
fabric-content-registries-v0: Fabric Content Registries (v0) 0.2.5+3cc0f0907d
fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.4+3cc0f0907d
fabric-dimensions-v1: Fabric Dimensions API (v1) 2.0.8+3cc0f0907d
fabric-entity-events-v1: Fabric Entity Events (v1) 1.2.4+3cc0f0907d
fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.5+3cc0f0907d
fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.2+3cc0f0907d
fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.7+3cc0f0907d
fabric-item-api-v1: Fabric Item API (v1) 1.2.2+3cc0f0907d
fabric-item-groups-v0: Fabric Item Groups (v0) 0.3.1+3cc0f0907d
fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.2.2+3cc0f0907d
fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.3+3cc0f0907d
fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.4+3cc0f0907d
fabric-networking-api-v1: Fabric Networking API (v1) 1.0.5+3cc0f0907d
fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.9+3cc0f0907d
fabric-networking-v0: Fabric Networking (v0) 0.3.3+3cc0f0907d
fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.9.6+3cc0f0907d
fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.3+3cc0f0907d
fabric-particles-v1: Fabric Particles (v1) 0.2.5+3cc0f0907d
fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.7.6+3cc0f0907d
fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.6+3cc0f0907d
fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.15+3cc0f0907d
fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.4.8+3cc0f0907d
fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.6+3cc0f0907d
fabric-structure-api-v1: Fabric Structure API (v1) 1.1.12+3cc0f0907d
fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.1.2+3cc0f0907d
fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.2.8+3cc0f0907d
fabric-transfer-api-v1: Fabric Transfer API (v1) 1.5.0+3cc0f0907d
fabricloader: Fabric Loader 0.12.12
java: Java HotSpot(TM) 64-Bit Server VM 11
minecraft: Minecraft 1.16.5
Player Count: 1 / 20; [class_3222['its_meow'/201, l='ServerLevel[world]', x=-193.88, y=73.51, z=-172.11]]
Data Packs: vanilla, Fabric Mods
Is Modded: Definitely; Server brand changed to 'fabric'
Type: Dedicated Server (map_server.txt)
Here's another example
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!
Time: 12/23/21, 3:59 AM
Description: Exception in server tick loop
java.lang.NoClassDefFoundError: net/minecraft/class_638
at me.shedaniel.architectury.networking.fabric.NetworkManagerImpl.createAddEntityPacket(NetworkManagerImpl.java:139)
at me.shedaniel.architectury.networking.NetworkManager.createAddEntityPacket(NetworkManager.java)
at dev.itsmeow.betteranimalsplus.common.entity.projectile.EntityBadgerDirt.method_18002(EntityBadgerDirt.java:84)
at net.minecraft.class_3231.method_18757(class_3231.java:224)
at net.minecraft.class_3231.method_18760(class_3231.java:214)
at net.minecraft.class_3898$class_3208.method_18736(class_3898.java:1238)
at net.minecraft.class_3898$class_3208.method_18729(class_3898.java:1265)
at net.minecraft.class_3898.method_18701(class_3898.java:1020)
at net.minecraft.class_3215.method_18755(class_3215.java:477)
at net.minecraft.class_3218.method_18778(class_3218.java:933)
at net.minecraft.class_3218.method_14175(class_3218.java:835)
at net.minecraft.class_3218.method_8649(class_3218.java:765)
at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at net.minecraft.class_5425.method_30771(class_5425.java:11)
at net.minecraft.class_3218.method_30736(class_3218.java:884)
at net.minecraft.class_3138.method_13694(class_3138.java:77)
at net.minecraft.class_3138.method_13691(class_3138.java:42)
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262)
at net.minecraft.class_2170.redirect$zzm000$performCommand(class_2170.java:549)
at net.minecraft.class_2170.method_9249(class_2170.java:249)
at net.minecraft.class_3244.method_14370(class_3244.java:1211)
at net.minecraft.class_3244.method_31286(class_3244.java:1198)
at net.minecraft.class_3244.method_12048(class_3244.java:1177)
at net.minecraft.class_2797.method_12115(class_2797.java:36)
at net.minecraft.class_2797.method_11054(class_2797.java:9)
at net.minecraft.class_2600.method_11072(class_2600.java:21)
at net.minecraft.class_3738.run(class_3738.java:18)
at net.minecraft.class_1255.method_18859(class_1255.java:144)
at net.minecraft.class_4093.method_18859(class_4093.java:23)
at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:761)
at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:155)
at net.minecraft.class_1255.method_16075(class_1255.java:118)
at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:743)
at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:737)
at net.minecraft.class_1255.method_5383(class_1255.java:103)
at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:721)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:674)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: net.minecraft.class_638
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:158)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 41 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.16.5
Minecraft Version ID: 1.16.5
Operating System: Windows 10 (amd64) version 10.0
Java Version: 11.0.11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 561629960 bytes (535 MB) / 1625292800 bytes (1550 MB) up to 2147483648 bytes (2048 MB)
CPUs: 12
JVM Flags: 1 total; -Xmx2G
Fabric Mods:
architectury: Architectury 1.26.40
betteranimalsplus: Better Animals Plus 1.16.5-10.2.0
cardinal-components: Cardinal Components API 2.8.3
cardinal-components-base: Cardinal Components API (base) 2.8.3
cardinal-components-block: Cardinal Components API (blocks) 2.8.3
cardinal-components-chunk: Cardinal Components API (chunks) 2.8.3
cardinal-components-entity: Cardinal Components API (entities) 2.8.3
cardinal-components-item: Cardinal Components API (items) 2.8.3
cardinal-components-level: Cardinal Components API (world saves) 2.8.3
cardinal-components-scoreboard: Cardinal Components API (scoreboard) 2.8.3
cardinal-components-util: Cardinal Components API (utilities) 2.8.3
cardinal-components-world: Cardinal Components API (worlds) 2.8.3
fabric: Fabric API 0.42.0+1.16
fabric-api-base: Fabric API Base 0.4.0+3cc0f0907d
fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.3.1+3cc0f0907d
fabric-biome-api-v1: Fabric Biome API (v1) 3.1.13+3cc0f0907d
fabric-command-api-v1: Fabric Command API (v1) 1.1.3+3cc0f0907d
fabric-commands-v0: Fabric Commands (v0) 0.2.3+3cc0f0907d
fabric-containers-v0: Fabric Containers (v0) 0.1.12+3cc0f0907d
fabric-content-registries-v0: Fabric Content Registries (v0) 0.2.5+3cc0f0907d
fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.4+3cc0f0907d
fabric-dimensions-v1: Fabric Dimensions API (v1) 2.0.8+3cc0f0907d
fabric-entity-events-v1: Fabric Entity Events (v1) 1.2.4+3cc0f0907d
fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.5+3cc0f0907d
fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.2+3cc0f0907d
fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.7+3cc0f0907d
fabric-item-api-v1: Fabric Item API (v1) 1.2.2+3cc0f0907d
fabric-item-groups-v0: Fabric Item Groups (v0) 0.3.1+3cc0f0907d
fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.2.2+3cc0f0907d
fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.3+3cc0f0907d
fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.4+3cc0f0907d
fabric-networking-api-v1: Fabric Networking API (v1) 1.0.5+3cc0f0907d
fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.9+3cc0f0907d
fabric-networking-v0: Fabric Networking (v0) 0.3.3+3cc0f0907d
fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.9.6+3cc0f0907d
fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.3+3cc0f0907d
fabric-particles-v1: Fabric Particles (v1) 0.2.5+3cc0f0907d
fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.7.6+3cc0f0907d
fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.6+3cc0f0907d
fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.15+3cc0f0907d
fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.4.8+3cc0f0907d
fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.6+3cc0f0907d
fabric-structure-api-v1: Fabric Structure API (v1) 1.1.12+3cc0f0907d
fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.1.2+3cc0f0907d
fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.2.8+3cc0f0907d
fabric-transfer-api-v1: Fabric Transfer API (v1) 1.5.0+3cc0f0907d
fabricloader: Fabric Loader 0.12.12
java: Java HotSpot(TM) 64-Bit Server VM 11
minecraft: Minecraft 1.16.5
trinkets: Trinkets 2.6.7
Player Count: 1 / 20; [class_3222['its_meow'/203, l='ServerLevel[world]', x=-193.16, y=73.89, z=-171.22]]
Data Packs: vanilla, Fabric Mods
Is Modded: Definitely; Server brand changed to 'fabric'
Type: Dedicated Server (map_server.txt)
Can confirm for 1.18, though only on Fabric servers. Forge seems to work as expected.
Appears to be fixed, although my entity doesn't render... Probably something on my side, but could be packet issue.
Can verify client is not adding/receiving entity, as shown by lack of hitbox appearing.