Fabric API

Fabric API

106M Downloads

ClientSidePacketRegistry.INSTANCE.register can be called on dedi server, resulting in crash

LemmaEOF opened this issue ยท 4 comments

commented

ClientSidePacketRegistry.INSTANCE.register() doesn't have an embedded environment check, so if the code gets called on a dedicated server, it will crash due to NoClassDefFoundError for MinecraftClient.

commented

It should only be called on the client side, though.

commented

Definitely, but I feel like it should either fail more quietly or have a specific crash, maybe WrongSideException or something, just so it's easier to instantly diagnose what's going on.

commented

Hmm, so @Boundarybreaker do you suggest marking @Environment on api methods exposed to mods?

commented

I think it'd definitely be helpful, but we should make some changes to Loader first. I've made an issue for it.