Connexion automatique à un serveur



  • Bonjour,
    Je cherche à faire un bouton de connexion automatique à un serveur , en 1.6 je n'avais aucun problème mais lorsque j'essaye en 1.7 cela bug
    J'ai essayé avec :

    this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData("Local", "localhost:25565")));
    

    et

    mc.displayGuiScreen(new GuiConnecting(this, mc, "localhost", 25565));
    

    J'ai cherché dans les logs mais je ne vois pas comment arranger ça

    [18:52:40] [Client thread/INFO]: Connecting to localhost, 25565
    [18:52:40] [Netty Client IO #3/ERROR] [FML]: HandshakeMessageHandler exception
    java.lang.NullPointerException
    at cpw.mods.fml.client.FMLClientHandler.waitForPlayClient(FMLClientHandler.java:757) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.waitForPlayClient(FMLCommonHandler.java:499) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientListenForServerHandshake(NetworkDispatcher.java:153) ~[NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:32) ~[FMLHandshakeClientState$1.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:26) ~[FMLHandshakeClientState$1.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.userEventTriggered(HandshakeMessageHandler.java:40) ~[HandshakeMessageHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) [ChannelInboundHandlerAdapter.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) [ChannelInboundHandlerAdapter.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireUserEventTriggered(DefaultChannelPipeline.java:779) [DefaultChannelPipeline.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handlerAdded(NetworkDispatcher.java:131) [NetworkDispatcher.class:?]
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:484) [DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded(DefaultChannelPipeline.java:479) [DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore0(DefaultChannelPipeline.java:178) [DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:163) [DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:153) [DefaultChannelPipeline.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.insertIntoChannel(NetworkDispatcher.java:118) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientToServerHandshake(NetworkDispatcher.java:123) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(FMLNetworkHandler.java:66) [FMLNetworkHandler.class:?]
    at net.minecraft.client.network.NetHandlerLoginClient.handleLoginSuccess(NetHandlerLoginClient.java:96) [NetHandlerLoginClient.class:?]
    at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:46) [S02PacketLoginSuccess.class:?]
    at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:63) [S02PacketLoginSuccess.class:?]
    at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:125) [NetworkManager.class:?]
    at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:379) [NetworkManager.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]
    [18:52:40] [Netty Client IO #3/ERROR] [FML]: ChannelRegistrationHandler exception
    java.lang.ClassCastException: Cannot cast net.minecraft.client.network.NetHandlerLoginClient to net.minecraft.client.network.NetHandlerPlayClient
    at java.lang.Class.cast(Unknown Source) ~[?:1.7.0_25]
    at cpw.mods.fml.common.network.FMLNetworkEvent$CustomPacketRegistrationEvent.<init>(FMLNetworkEvent.java:93) ~[FMLNetworkEvent$CustomPacketRegistrationEvent.class:?]
    at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:772) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:504) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28) ~[ChannelRegistrationHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) ~[ChannelRegistrationHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:249) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:184) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:42) [NetworkDispatcher.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]
    [18:52:40] [Netty Client IO #3/ERROR] [FML]: FMLIndexedMessageCodec exception caught
    java.lang.ClassCastException: Cannot cast net.minecraft.client.network.NetHandlerLoginClient to net.minecraft.client.network.NetHandlerPlayClient
    at java.lang.Class.cast(Unknown Source) ~[?:1.7.0_25]
    at cpw.mods.fml.common.network.FMLNetworkEvent$CustomPacketRegistrationEvent.<init>(FMLNetworkEvent.java:93) ~[FMLNetworkEvent$CustomPacketRegistrationEvent.class:?]
    at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:772) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:504) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28) ~[ChannelRegistrationHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) ~[ChannelRegistrationHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:249) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:184) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:42) [NetworkDispatcher.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]
    [18:52:40] [Netty Client IO #3/ERROR] [FML]: HandshakeMessageHandler exception
    java.lang.ClassCastException: Cannot cast net.minecraft.client.network.NetHandlerLoginClient to net.minecraft.client.network.NetHandlerPlayClient
    at java.lang.Class.cast(Unknown Source) ~[?:1.7.0_25]
    at cpw.mods.fml.common.network.FMLNetworkEvent$CustomPacketRegistrationEvent.<init>(FMLNetworkEvent.java:93) ~[FMLNetworkEvent$CustomPacketRegistrationEvent.class:?]
    at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:772) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:504) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28) ~[ChannelRegistrationHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) ~[ChannelRegistrationHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:249) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:184) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:42) [NetworkDispatcher.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]
    avr. 08, 2014 6:52:40 PM io.netty.channel.embedded.EmbeddedChannel recordException
    WARNING: More than one exception was raised. Will report only the first one and log others.
    java.lang.ClassCastException: Cannot cast net.minecraft.client.network.NetHandlerLoginClient to net.minecraft.client.network.NetHandlerPlayClient
    at java.lang.Class.cast(Unknown Source)
    at cpw.mods.fml.common.network.FMLNetworkEvent$CustomPacketRegistrationEvent.<init>(FMLNetworkEvent.java:93)
    at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:772)
    at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:504)
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28)
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169)
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:249)
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:184)
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:42)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Unknown Source)
    
    [18:52:40] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
    java.lang.NullPointerException
    at cpw.mods.fml.client.FMLClientHandler.waitForPlayClient(FMLClientHandler.java:757) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.waitForPlayClient(FMLCommonHandler.java:499) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientListenForServerHandshake(NetworkDispatcher.java:153) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:32) ~[FMLHandshakeClientState$1.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:26) ~[FMLHandshakeClientState$1.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.userEventTriggered(HandshakeMessageHandler.java:40) ~[HandshakeMessageHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) ~[ChannelInboundHandlerAdapter.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) ~[ChannelInboundHandlerAdapter.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:308) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:294) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireUserEventTriggered(DefaultChannelPipeline.java:779) ~[DefaultChannelPipeline.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handlerAdded(NetworkDispatcher.java:131) ~[NetworkDispatcher.class:?]
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:484) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded(DefaultChannelPipeline.java:479) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore0(DefaultChannelPipeline.java:178) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:163) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:153) ~[DefaultChannelPipeline.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.insertIntoChannel(NetworkDispatcher.java:118) ~[NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientToServerHandshake(NetworkDispatcher.java:123) ~[NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(FMLNetworkHandler.java:66) ~[FMLNetworkHandler.class:?]
    at net.minecraft.client.network.NetHandlerLoginClient.handleLoginSuccess(NetHandlerLoginClient.java:96) ~[NetHandlerLoginClient.class:?]
    at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:46) ~[S02PacketLoginSuccess.class:?]
    at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:63) ~[S02PacketLoginSuccess.class:?]
    at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:125) ~[NetworkManager.class:?]
    at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:379) ~[NetworkManager.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[SimpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [ByteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]
    

    Si vous avez une idée ce serait d'une grande aide 😕
    Merci d'avance


  • Moddeurs confirmés Modérateurs

    Tu n'as qu'à regarder la méthode dans GuiMainMenu



  • Nul part dans GuiMainMenu il n'y a de bouton de connexion automatique ._.
    De plus j'ai cherché avec de demander de l'aide ^^'


  • Moddeurs confirmés Modérateurs

    car c'est pas comme ca qu'il faut faire:
    dans

    private void addSingleplayerMultiplayerButtons(int par1, int par2)
    {
    }
    

    met:

    this.buttonList.add(new GuiButton(id_du_bouton, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("Nom_du_serveur")));
    this.width / 2 - 100, par1 + par2 * 1 // permet de mettre le bouton au dessus de celui pour multiplayer
    

    et enfin dans ```java

    protected void actionPerformed(GuiButton button)
    {
    }

    tu met:```java
    
    if (button.id == id_du_bouton)
    {
    this.mc.displayGuiScreen(new GuiConnecting(this, mc, "ton_ip", 25565));
    }
    


  • ^^' c'est ce que j'ai fait
    Le problème ne viens pas du bouton mais de ce qu'il effectue , je ne sais pas pourquoi cela ne marche pas ….

    car c'est pas comme ca qu'il faut faire:

    Je ne comprends vraiment pas de quoi tu parles ^^'


  • Moddeurs confirmés Modérateurs

    dans ta classe customGuiMainMenu il te faut ajouter les fonction/condition où je te le dit


  • Moddeurs confirmés Rédacteurs Administrateurs

    Je crois que la méthode pour se connecté a changé en 1.7 avec le nouveau système de forge, je vais jeter un coup d’œil.



  • @'isador34':

    dans ta classe customGuiMainMenu il te faut ajouter les fonction/condition où je te le dit

    Là n'est pas le problème
    Le bouton marche très bien et mes fonctions/conditions y sont
    Lorsque le serveur est éteint je n'ai aucun problème

    @'robin4002':

    Je crois que la méthode pour se connecté a changé en 1.7 avec le nouveau système de forge, je vais jeter un coup d’œil.

    Merci 🙂


  • Moddeurs confirmés Modérateurs

    Ok autant pour moi



  • Perso moi j'ai fait sa et sa bug pas, tout fonctionne très bien !

    Premièrement dans le private void addSingleplayerMultiplayerButtons, j'ai fait sa
    Cette fonction sert a créer ton bouton et de la déplacer etc..Bref, je crois tu sais !

    
    private void addSingleplayerMultiplayerButtons(int par1, int par2)
    {
    this.buttonList.add(new GuiButton(2, this.width / 2 - 100, par1 + par2 * 1, ("NOM TON SERVER")));
    fmlModButton = new GuiButton(1, this.width / 2 - 100, par1 + par2 * 0, "Jouer solo");
    this.buttonList.add(fmlModButton);
    }
    
    

    et après j'ai fait sa dans le protected void actionPerformed
    Cette fonction est ton bouton qui se connecte a ton serveur !

    
    protected void actionPerformed(GuiButton button)
    {
    if (button.id == 2)
    {
    this.mc.displayGuiScreen(new GuiConnecting(this, mc, "IP_TON_SERVER", PORT_TON_SERVER));
    
    }
    }
    
    

    Perso moi sa marche sa j'ai aucun problème !



  • J'ai marqué que j'ai déjà essayé en haut ^^'
    Le truc c'est que le bouton marche bien , mais quand le serveur et allumé cela bug et affiche une erreur


  • Moddeurs confirmés Modérateurs

    tu as un nom de domaine pour ton serv?



  • non mais j'ai essayé avec plusieurs ip :
    un petit serveur en localhost
    mon serveur
    et Hypixel , ça reviens à la même chose



  • Bonsoir,
    J'ai exactement le même problème, impossible que le bouton marche, voici mon crash report (j'ai les mêmes messages que l'auteur dans ma console) :

    
    if (p_146284_1_.id == 5)
    {
    this.mc.displayGuiScreen(new GuiConnecting(this, mc, "37.59.2.220", 2));
    }
    
    –-- Minecraft Crash Report ----
    // Don't be sad. I'll do better next time, I promise!
    
    Time: 13/04/14 20:29
    Description: Ticking screen
    
    java.lang.NullPointerException: Ticking screen
    at cpw.mods.fml.client.FMLClientHandler.setPlayClient(FMLClientHandler.java:747)
    at net.minecraft.client.network.NetHandlerPlayClient.<init>(NetHandlerPlayClient.java:230)
    at net.minecraft.client.network.NetHandlerLoginClient.func_147232_a(NetHandlerLoginClient.java:112)
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:200)
    at net.minecraft.client.multiplayer.GuiConnecting.func_73876_c(SourceFile:76)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1646)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:953)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:870)
    at net.minecraft.client.main.Main.main(SourceFile:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    
    ```</init>

  • Moddeurs confirmés Rédacteurs Administrateurs

    if(p_146284_1_.id == id voulu)
    {
        FMLClientHandler.instance().setupServerList();
        FMLClientHandler.instance().connectToServer(this, new ServerData("Nom du serveur", "ip:port"));
    }
    


  • Niquel, sa marche pour moi, merci infiniment robin4002 😄 !



  • Effectivement ,
    Merci beaucoup ^^


Log in to reply