Drathonix / LoadMyChunks

A server friendly chunk loading mod
MIT License
5 stars 0 forks source link

Crash in multiplayer #17

Closed vico93 closed 2 months ago

vico93 commented 2 months ago

Tried for the fist time your mod on multiplayer.

Randomly got this crash that said it was related to your mod.

Drathonix commented 2 months ago

Already figured it out:

issue is caused by a lack of the line:

NetworkManager.registerS2CPayloadType(LagReadingPacket.TYPE,LagReadingPacket.STREAM_CODEC);

Seems this doesn't affect the client side for whatever reason.

I was not aware that this was required in 1.20.6+, I'll release a hotfix in a few mins.

Drathonix commented 2 months ago

Hotfix published on modrinth (under review on curseforge) closing.

vico93 commented 2 months ago

@Drathonix now it crashes when starting the game (singleplayer):

Description: Initializing game

java.lang.RuntimeException: Could not execute entrypoint stage 'client' due to errors, provided by 'loadmychunks'!
    at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388)
    at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386)
    at net.fabricmc.loader.impl.game.minecraft.Hooks.startClient(Hooks.java:53)
    at net.minecraft.class_310.<init>(class_310.java:477)
    at net.minecraft.client.main.Main.main(Main.java:239)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Caused by: java.lang.IllegalArgumentException: Packet type class_9154[id=loadmychunks:lag] is already registered!
    at net.fabricmc.fabric.impl.networking.PayloadTypeRegistryImpl.register(PayloadTypeRegistryImpl.java:58)
    at dev.architectury.networking.fabric.NetworkManagerImpl$1.registerS2C(NetworkManagerImpl.java:66)
    at dev.architectury.impl.NetworkAggregator.registerS2CReceiver(NetworkAggregator.java:119)
    at dev.architectury.impl.NetworkAggregator.registerReceiver(NetworkAggregator.java:91)
    at dev.architectury.networking.NetworkManager.registerReceiver(NetworkManager.java:102)
    at dev.architectury.networking.NetworkManager.registerReceiver(NetworkManager.java:97)
    at com.vicious.loadmychunks.client.LoadMyChunksClient.init(LoadMyChunksClient.java:66)
    at com.vicious.loadmychunks.unified.LMCCLIENTRY.onInitializeClient(LMCCLIENTRY.java:22)
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384)
    ... 6 more
Drathonix commented 2 months ago

Ah yes, the I code needs to not run on the serverside otherwise it conflicts with the client, sorry about that.

Literally the only line of code in the project that has to be kept serversided, that's just ridiculous.

Drathonix commented 2 months ago

Ironically this is now a crash in singleplayer. I'll thoroughly test both sides this time rather than being irresponsible.

Drathonix commented 2 months ago

Actually fixed it this time, shouldn't crash on either side now.

vico93 commented 2 months ago

Thanks a lot!