Allow mod missing on client
BrainStone opened this issue ยท 12 comments
It would be very useful if the Forge version of this mod would allow the client not to have it.
Over on this closed issue he stated that only clients that want to show the boxes need the mod. But then when attempting to join the server with it I get rejected.
I don't want my regular players to need this to play on my servers, but I also know Sponge isn't @irtimaled 's strength. Do you know what they need to add/remove to make it side independent, @BrainStone ?
I'm surprised that the server rejects players without the mod - it could be something about how the server tries to open a communication link to the client. I'll have to look into this
I can recommend looking at mods like NEI (their main class). Because they don't require the mod on the client.
Thanks - it may just be something as simple as exception wrapping the comms channel.
Let me know if you guys have issues with this. I've done very limited testing and appears to work okay but don't have the setup to test it more thoroughly
@irtimaled It appears to work like halfway.
I get a different error now: (Note: I connected with a vanilla client!)
[23:48:04] [Server thread/WARN]: Failed to handle packet for /x.x.x.x:x
java.util.NoSuchElementException: packet_handler
at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1080) ~[DefaultChannelPipeline.class:?]
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:251) ~[DefaultChannelPipeline.class:?]
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:240) ~[DefaultChannelPipeline.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.insertIntoChannel(NetworkDispatcher.java:176) ~[NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.serverToClientHandshake(NetworkDispatcher.java:163) ~[NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(FMLNetworkHandler.java:72) ~[FMLNetworkHandler.class:?]
at net.minecraft.server.network.NetHandlerLoginServer.func_147326_c(NetHandlerLoginServer.java:135) ~[pa.class:?]
at net.minecraft.server.network.NetHandlerLoginServer.func_73660_a(NetHandlerLoginServer.java:63) ~[pa.class:?]
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) ~[gw.class:?]
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:179) [ox.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:784) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:391) [nx.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:665) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:523) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
[23:48:04] [Server thread/INFO]: The_BrainStone lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet
Also a setup is pretty easy tbh. If you use gradle you can use ./gradlew runServer
or start a server out of your IDE. Connections with vanilla clients should work and with Forge clients too (Set up a simple profile for each in your launcher) and you can also start the corresponding client with ./gradlew runClient
or through the IDE again.
I guess the issue is that you send packets which the client doesn't know. So a check if the client supports the mod before you open the channel should sove it.
I'm not gonna be able to look at this today - if you are interested I accept pull requests :-)
I would but I have to do a lot of stuff myself.
Maybe I'll ask the guys from JourneyMap. As I have a good connection to them and they did it right.