Architectury API (Fabric/Forge/NeoForge)

Architectury API (Fabric/Forge/NeoForge)

170M Downloads

1.21 Entities on Fabric server

ThexXTURBOXx opened this issue ยท 2 comments

commented

My mod is running on Architectury API 13.0.1 for Minecraft 1.21 server.

Everything is working fine on NeoForge - both client and server.
However, on Fabric, I receive lots of errors regarding networking.
In this specific case, it is the NetworkManagerImpl#createAddEntityPacket function somehow misbehaving.
I have seen similar errors with other packets also. So, this seems to be some internal problem with the packet handler itself (?)

Error log
[08:58:06] [Server thread/ERROR] (Minecraft) Failed to handle packet net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot@ebc1894, suppressing error
 java.lang.NullPointerException: Cannot invoke "net.minecraft.network.codec.StreamCodec.encode(Object, Object)" because "codec" is null
	at dev.architectury.impl.NetworkAggregator.collectPackets(NetworkAggregator.java:146) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.collectPackets(NetworkManager.java:137) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.toPacket(NetworkManager.java:121) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.SpawnEntityPacket.create(SpawnEntityPacket.java:56) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.fabric.NetworkManagerImpl.createAddEntityPacket(NetworkManagerImpl.java:137) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.createAddEntityPacket(NetworkManager.java) ~[architectury-fabric-13.0.1.jar:?]
	at ckathode.weaponmod.entity.EntityCannon.getAddEntityPacket(EntityCannon.java:95) ~[17825007881706304337.jar:?]
	at net.minecraft.server.level.ServerEntity.sendPairingData(ServerEntity.java:274) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ServerEntity.addPairing(ServerEntity.java:265) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ChunkMap$TrackedEntity.updatePlayer(ChunkMap.java:1316) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ChunkMap.move(ChunkMap.java:1019) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ServerChunkCache.move(ServerChunkCache.java:456) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:997) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:142) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot.handle(ServerboundMovePlayerPacket.java:18) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.PacketUtils.method_11072(PacketUtils.java:27) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:162) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:864) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:173) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:136) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:846) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:840) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:121) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:814) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:702) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:281) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Full log instead (if needed)
[Architectury Transformer] Architectury Runtime 5.2.83
[Architectury Transformer] Read classpath in 920.9 ms
[Architectury Transformer] Listening at F:\Minecraft\balkons-weaponmod-1.21\common\build\devlibs\weaponmod-common-1.21-1.20.0-dev.jar
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
[08:57:43] [main/INFO] (FabricLoader/GameProvider) Loading Minecraft 1.21 with Fabric Loader 0.15.11
[08:57:43] [main/INFO] (FabricLoader) Loading 46 mods:
	- architectury 13.0.1
	- cloth-basic-math 0.6.1
	- cloth-config 14.0.126
	- fabric-api 0.100.1+1.21
	- fabric-api-base 0.4.42+6573ed8c90
	- fabric-api-lookup-api-v1 1.6.65+b559734490
	- fabric-biome-api-v1 13.0.28+6fc22b9990
	- fabric-block-api-v1 1.0.22+0af3f5a790
	- fabric-block-view-api-v2 1.0.10+6573ed8c90
	- fabric-command-api-v1 1.2.48+f71b366f90
	- fabric-command-api-v2 2.2.27+6a6dfa1990
	- fabric-commands-v0 0.2.65+df3654b390
	- fabric-content-registries-v0 8.0.11+b559734490
	- fabric-convention-tags-v1 2.0.12+7f945d5b90
	- fabric-convention-tags-v2 2.2.1+d153f34490
	- fabric-crash-report-info-v1 0.2.29+0af3f5a790
	- fabric-data-attachment-api-v1 1.1.22+6a6dfa1990
	- fabric-data-generation-api-v1 20.2.6+16c4ae2590
	- fabric-dimensions-v1 4.0.0+6fc22b9990
	- fabric-entity-events-v1 1.6.12+6fc22b9990
	- fabric-events-interaction-v0 0.7.10+e633f88390
	- fabric-game-rule-api-v1 1.0.52+6573ed8c90
	- fabric-gametest-api-v1 2.0.0+6fc22b9990
	- fabric-item-api-v1 11.0.0+afdfc92190
	- fabric-item-group-api-v1 4.1.0+00ab0a6390
	- fabric-lifecycle-events-v1 2.3.9+98a7dbbb90
	- fabric-loot-api-v2 3.0.9+6573ed8c90
	- fabric-message-api-v1 6.0.13+6573ed8c90
	- fabric-networking-api-v1 4.1.0+686dcdce90
	- fabric-object-builder-api-v1 15.1.10+d132107690
	- fabric-particles-v1 4.0.2+6573ed8c90
	- fabric-recipe-api-v1 5.0.8+6573ed8c90
	- fabric-registry-sync-v0 5.0.21+b9828ba390
	- fabric-rendering-data-attachment-v1 0.3.48+73761d2e90
	- fabric-rendering-fluids-v1 3.1.6+b559734490
	- fabric-resource-conditions-api-v1 4.2.1+d153f34490
	- fabric-resource-loader-v0 1.1.3+b559734490
	- fabric-screen-handler-api-v1 1.3.78+b559734490
	- fabric-transfer-api-v1 5.1.12+b559734490
	- fabric-transitive-access-wideners-v1 6.0.12+6573ed8c90
	- fabricloader 0.15.11
	- generated_e3a93b0 1.0.0
	- java 21
	- minecraft 1.21
	- mixinextras 0.3.5
	- weaponmod 1.20.0
[08:57:44] [main/INFO] (FabricLoader/Mixin) SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/C:/Users/nicom/.gradle/caches/modules-2/files-2.1/net.fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/9527e6b0d2449408958fd1302594dc65ec5ade9c/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER
[08:57:44] [main/INFO] (FabricLoader/Mixin) Loaded Fabric development mappings for mixin remapper!
[08:57:44] [main/INFO] (FabricLoader/Mixin) Compatibility level set to JAVA_17
[08:57:44] [main/INFO] (FabricLoader/MixinExtras|Service) Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5).
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for spear
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for knife
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for flail
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for boomerang
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for javelin
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for bolt
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for dart
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for shot
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for dynamite
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for cannon
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for cannonball
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for dummy
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for bullet
[08:57:52] [main/ERROR] (Minecraft) No data fixer registered for shell
[08:57:52] [main/INFO] (NetworkManagerImpl) Registering C2S receiver with id weaponmod:cannon_fire
[08:57:52] [main/INFO] (Minecraft) Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[08:57:53] [main/WARN] (Minecraft) Missing data pack generated_93ba044
[08:57:53] [main/INFO] (Minecraft) Found new data pack generated_e3a93b0, loading it automatically
[08:57:54] [main/INFO] (Minecraft) Loaded 1376 recipes
[08:57:54] [main/INFO] (Minecraft) Loaded 1486 advancements
[08:57:54] [main/WARN] (Minecraft) Not all defined tags for registry ResourceKey[minecraft:root / minecraft:item] are present in data pack: c:diamonds, c:feathers, c:gems/diamonds, c:gold_ingots, c:grain, c:gravel, c:gravels, c:iron_ingots, c:wooden_rods, forge:crops/wheat, forge:feathers, forge:gems/diamond, forge:gravel, forge:gunpowder, forge:ingots/gold, forge:ingots/iron, forge:rods/wooden, forge:slimeballs, forge:string
[08:57:54] [main/INFO] (BiomeModificationImpl) Applied 0 biome modifications to 0 of 64 new biomes in 1.511 ms
[08:57:54] [Server thread/INFO] (Minecraft) Starting minecraft server version 1.21
[08:57:54] [Server thread/INFO] (Minecraft) Loading properties
[08:57:54] [Server thread/INFO] (Minecraft) Default game type: SURVIVAL
[08:57:54] [Server thread/INFO] (Minecraft) Generating keypair
[08:57:54] [Server thread/INFO] (Minecraft) Starting Minecraft server on *:25565
[08:57:55] [Server thread/INFO] (Minecraft) Using default channel type
[08:57:55] [Server thread/WARN] (Minecraft) **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[08:57:55] [Server thread/WARN] (Minecraft) The server will make no attempt to authenticate usernames. Beware.
[08:57:55] [Server thread/WARN] (Minecraft) While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[08:57:55] [Server thread/WARN] (Minecraft) To change this, set "online-mode" to "true" in the server.properties file.
[08:57:55] [Server thread/INFO] (Minecraft) Preparing level "world"
[08:57:55] [Server thread/INFO] (Minecraft) Preparing start region for dimension minecraft:overworld
[08:57:56] [Worker-Main-15/INFO] (Minecraft) Preparing spawn area: 0%
[08:57:56] [Server thread/INFO] (Minecraft) Time elapsed: 523 ms
[08:57:56] [Server thread/INFO] (Minecraft) Done (1.158s)! For help, type "help"
[08:57:56] [Server thread/WARN] (TranslationConventionLogWarnings) 
	Dev warning - Untranslated Item Tags detected. Please translate your item tags so other mods such as recipe viewers can properly display your tag's name.
	The format desired is tag.item.<namespace>.<path> for the translation key with slashes in path turned into periods.
	To disable this message, set this system property in your runs: `-Dfabric-tag-conventions-v2.missingTagTranslationWarning=SILENCED`.
	To see individual untranslated item tags found, set the system property to `-Dfabric-tag-conventions-v2.missingTagTranslationWarning=VERBOSE`.
	Default is `SHORT`.

[08:57:56] [Server thread/WARN] (ConventionLogWarnings) 
	Dev warning - Legacy Tags detected. Please migrate your old tags to our new format that follows better conventions!
	See classes under net.fabricmc.fabric.api.tag.convention.v2 package for all tags.

	NOTE: Many tags have been moved around or renamed. Some new ones were added so please review the new tags.
	And make sure you follow tag conventions for new tags! The convention is `c` with nouns generally being plural and adjectives being singular.
	You can disable this message by this system property to your runs: `-Dfabric-tag-conventions-v1.legacyTagWarning=SILENCED`.
	To see individual legacy tags found, set the system property to `-Dfabric-tag-conventions-v1.legacyTagWarning=DEV_VERBOSE` instead. Default is `DEV_SHORT`.

[08:58:06] [Server thread/INFO] (Minecraft) Player980[/127.0.0.1:50340] logged in with entity id 70 at (-8.5, 91.0, -1.5)
[08:58:06] [Server thread/INFO] (Minecraft) Player980 joined the game
[08:58:06] [Server thread/ERROR] (Minecraft) Failed to handle packet net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot@ebc1894, suppressing error
 java.lang.NullPointerException: Cannot invoke "net.minecraft.network.codec.StreamCodec.encode(Object, Object)" because "codec" is null
	at dev.architectury.impl.NetworkAggregator.collectPackets(NetworkAggregator.java:146) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.collectPackets(NetworkManager.java:137) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.toPacket(NetworkManager.java:121) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.SpawnEntityPacket.create(SpawnEntityPacket.java:56) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.fabric.NetworkManagerImpl.createAddEntityPacket(NetworkManagerImpl.java:137) ~[architectury-fabric-13.0.1.jar:?]
	at dev.architectury.networking.NetworkManager.createAddEntityPacket(NetworkManager.java) ~[architectury-fabric-13.0.1.jar:?]
	at ckathode.weaponmod.entity.EntityCannon.getAddEntityPacket(EntityCannon.java:95) ~[17825007881706304337.jar:?]
	at net.minecraft.server.level.ServerEntity.sendPairingData(ServerEntity.java:274) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ServerEntity.addPairing(ServerEntity.java:265) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ChunkMap$TrackedEntity.updatePlayer(ChunkMap.java:1316) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ChunkMap.move(ChunkMap.java:1019) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.level.ServerChunkCache.move(ServerChunkCache.java:456) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:997) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:142) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot.handle(ServerboundMovePlayerPacket.java:18) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.network.protocol.PacketUtils.method_11072(PacketUtils.java:27) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:162) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:864) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:173) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:136) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:846) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:840) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:121) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:814) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:702) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:281) ~[minecraft-merged-d5baa6d844-1.21-loom.mappings.1_21.layered+hash.1012131631-v2.jar:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[08:58:58] [Server thread/INFO] (Minecraft) Player980 lost connection: Disconnected
[08:58:58] [Server thread/INFO] (Minecraft) Player980 left the game
commented

I can also confirm that this is an issue on 1.20.6 - NeoForge works fine, but Fabric has problems with servers.
In 1.20.1 at least, everything is working fine - both on Forge and Fabric, client and server!
Have not tested anything in between like 1.20.5!

commented

Fixed in the newest releases!