#Networking issue

1 messages · Page 1 of 1 (latest)

alpine frost
#
GitHub

Contribute to Hunkarada/Nen development by creating an account on GitHub.

GitHub

Contribute to Hunkarada/Nen development by creating an account on GitHub.

GitHub

Contribute to Hunkarada/Nen development by creating an account on GitHub.

alpine frost
#

LOOOOOOOL

#

THE WHOLE ERROR WAS BECAUSE OF MY PATHS

#

Caused by: java.lang.ClassCastException: class hunkarada.nen.common.network.packets.SyncPacket cannot be cast to class net.minecraft.network.packet.UnknownCustomPayload (hunkarada.nen.common.network.packets.SyncPacket and net.minecraft.network.packet.UnknownCustomPayload are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @42e26948)

#

this part

#

I renamed hunkarada.nen.common.network.packet.SyncPacket to hunkarada.nen.common.networks.packets.SyncPacket and it WORKS

#

stupid name collision, caused by ???

#

maybe this is because of mixin?

alpine frost
#

and

#

it's not resolved

#

I still need help with that

#

and this should not be paths related

alpine frost
#

because error was like (Invalid player data)

#

and it reproduced only once

#

oh, if I reconnect to server, it throws invalid player data

#

fixed issue with invalid player data, now only fails at encoding (old error)

#

so, it can't cast my SyncPacket class to UnknownCustomPayload

#

my class implements CustomPayload interface

#

so, why it tries to do so?

#

I can't do this manually, it's different classes from different packages

#

OMG IT WAS MORE STUPID THAN I THROUGHT

#

But, you may ask, how do you get the decoder if it’s not in Id? Good question. **The answer: you need to register it in ModInitializer on both ends (sender and receiver). **In fact, Fabric API will happily crash if you don’t before calling registerGlobalReceiver.

#

from blog

#

so basicly, I fucked up in registring things