univrsal / JustEnoughButtons

Adds utility buttons to the inventory screen
Mozilla Public License 2.0
6 stars 5 forks source link

Exception with client class used server side #24

Closed LemADEC closed 7 years ago

LemADEC commented 7 years ago

As observed in justenoughbuttons-1.10.2-1.7.2 when a player disconnected:

[19:40:41] [Netty Epoll Server IO #4/ERROR] [FML]: There was a critical exception handling a packet on channel justenoughbuttons
java.lang.NoClassDefFoundError: net/minecraft/client/resources/I18n
>.stopwrat de.universallp.justenoughbuttons.core.network.MessageMagnetMode.onMessage(MessageMagnetMode.java:47) ~[MessageMagnetMode.class:?]
>.stopwrat de.universallp.justenoughbuttons.core.network.MessageMagnetMode.onMessage(MessageMagnetMode.java:22) ~[MessageMagnetMode.class:?]
>.stopwrat net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[SimpleChannelHandlerWrapper.class:?]
>.stopwrat net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[SimpleChannelHandlerWrapper.class:?]
>.stopwrat io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[SimpleChannelInboundHandler.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]
>.stopwrat io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:?]
>.stopwrat io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
>.stopwrat net.minecraftforge.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:100) [FMLProxyPacket.class:?]
>.stopwrat net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:149) [eo.class:?]
>.stopwrat net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [eo.class:?]
>.stopwrat io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:?]
>.stopwrat net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:446) [NetworkDispatcher.class:?]
>.stopwrat net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:269) [NetworkDispatcher.class:?]
>.stopwrat net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
>.stopwrat io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:?]
>.stopwrat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:?]

Looks like a client class is used server side.

univrsal commented 7 years ago

I was trying to send a localized message about the player not having permissions. Well I guess just an english message'll do.

LemADEC commented 7 years ago

I thought you could use TextComponentTranslation() from server to tell client to do the translation?

univrsal commented 7 years ago

Never used it but yeah seems like that'd work. I'll add it once I have a reason to make a new build