Jump to content

Recommended Posts

Posted

Hi there,

 

I'm having problems with sending packets between the Server (Container) and the Client (Gui). Each time a button is pressed in the GUI it sends a packet to the server so the container can alter the item in its slot accordingly. On the other side the container sends a message to the client, so the GUI can display the status of the item/ the changes made to the item.

 

The strange thing: In Singleplayer everything works just fine. If I open my world to LAN and somebody else is joining everything is ok for me, it still works. But as soon as he (the player who joined my world) opens the GUI and the first packet is exchanged he gets kicked. If he runs a world with my mod in Singleplayer on his own he has no problems.

 

The errors occuring are eiter like that:

[12:30:29] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)

 

or like that:

NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)

 

I have no idea, why the message should be to long... I'm sending one Integer and recieving one Integer.

I tried to add different MessageIds for server and client when registering the Message (doesn't work).

I searched the forums and via google but couldn't find anybody having the same problem or a solution that worked for me...

So help would really be appreciated :) Does anybody have an idea what the problem is?

 

His error log:

 

[12:30:29] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:246) ~[hd.class:?]
at net.minecraft.network.play.server.S3FPacketCustomPayload.func_148837_a(S3FPacketCustomPayload.java:33) ~[ji.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
[12:30:29] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.io.IOException: Packet 0/1 (S01PacketJoinGame) was larger than I expected, found 36 bytes extra whilst reading packet 1
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:257) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
Caused by: java.io.IOException: Packet 0/1 (S01PacketJoinGame) was larger than I expected, found 36 bytes extra whilst reading packet 1
at net.minecraft.util.MessageDeserializer.decode(SourceFile:42) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
... 22 more
[12:30:29] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.io.IOException: Packet 0/0 (S00PacketKeepAlive) was larger than I expected, found 34 bytes extra whilst reading packet 0
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:257) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:190) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelInactive(ReadTimeoutHandler.java:143) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:560) [AbstractChannel$AbstractUnsafe$5.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
Caused by: java.io.IOException: Packet 0/0 (S00PacketKeepAlive) was larger than I expected, found 34 bytes extra whilst reading packet 0
at net.minecraft.util.MessageDeserializer.decode(SourceFile:42) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
... 22 more
[12:30:29] [Client thread/INFO] [FML]: Applying holder lookups
[12:30:29] [Client thread/INFO] [FML]: Holder lookups applied
[12:30:36] [Client thread/INFO]: Connecting to 7.33.17.46, 62430
[12:30:38] [Netty Client IO #4/INFO] [FML]: Server protocol version 2
[12:30:38] [Netty Client IO #4/INFO] [FML]: Injecting existing block and item data into this client instance
[12:30:38] [Netty Client IO #4/INFO] [FML]: Applying holder lookups
[12:30:38] [Netty Client IO #4/INFO] [FML]: Holder lookups applied
[12:30:38] [Netty Client IO #4/INFO] [FML]: [Netty Client IO #4] Client side modded connection established

 

 

If I take out one of the messages he still gets kicked and I get this error:

 

[15:34:04] [Netty Server IO #4/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:246) ~[hd.class:?]
at net.minecraft.network.play.client.C17PacketCustomPayload.func_148837_a(C17PacketCustomPayload.java:34) ~[mc.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:34:04] [Netty Server IO #4/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:257) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:190) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelInactive(ReadTimeoutHandler.java:143) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:560) [AbstractChannel$AbstractUnsafe$5.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161) ~[AbstractByteBuf.class:4.0.15.Final]
at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:648) ~[AbstractByteBuf.class:4.0.15.Final]
at net.minecraft.network.PacketBuffer.readBytes(SourceFile:669) ~[hd.class:?]
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:243) ~[hd.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148837_a(SourceFile:27) ~[lu.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
... 22 more
[15:34:04] [server thread/INFO]: Kannaford lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[15:34:04] [server thread/INFO]: Kannaford left the game
[15:34:04] [Client thread/INFO]: [CHAT] Kannaford left the game
[15:34:13] [user Authenticator #2/INFO]: UUID of player Kannaford is 69f6021f-5be5-476f-ae0c-54c947d2f4d7
[15:34:14] [Netty Server IO #5/INFO] [FML]: Client protocol version 2
[15:34:14] [Netty Server IO #5/INFO] [FML]: Client attempting to join with 10 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[15:34:14] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[15:34:14] [server thread/INFO]: Kannaford[/7.110.114.159:64774] logged in with entity id 344699 at (-18.339559863819797, 64.0, -62.4992310973533)
[15:34:14] [server thread/INFO]: Kannaford joined the game
[15:34:14] [Client thread/INFO]: [CHAT] Kannaford joined the game
[15:34:30] [Netty Server IO #5/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:246) ~[hd.class:?]
at net.minecraft.network.play.client.C17PacketCustomPayload.func_148837_a(C17PacketCustomPayload.java:34) ~[mc.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:34:30] [Netty Server IO #5/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received encoded string buffer length is longer than maximum allowed (768 > 400)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:237) ~[hd.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148837_a(SourceFile:27) ~[lu.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:34:30] [server thread/INFO]: Kannaford lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[15:34:30] [server thread/INFO]: Kannaford left the game
[15:34:30] [Client thread/INFO]: [CHAT] Kannaford left the game
[15:34:40] [server thread/INFO]: [@: Changing to clear weather]
[15:34:52] [server thread/INFO]: [@: Changing to clear weather]
[15:35:03] [server thread/INFO]: [@: Changing to clear weather]
[15:35:14] [user Authenticator #3/INFO]: UUID of player Kannaford is 69f6021f-5be5-476f-ae0c-54c947d2f4d7
[15:35:14] [server thread/INFO]: [@: Changing to clear weather]
[15:35:15] [Netty Server IO #7/INFO] [FML]: Client protocol version 2
[15:35:15] [Netty Server IO #7/INFO] [FML]: Client attempting to join with 10 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[15:35:15] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[15:35:15] [server thread/INFO]: Kannaford[/7.110.114.159:64842] logged in with entity id 372159 at (-17.69999998807907, 64.0, -64.50735650134459)
[15:35:15] [server thread/INFO]: Kannaford joined the game
[15:35:15] [Client thread/INFO]: [CHAT] Kannaford joined the game
[15:35:20] [Netty Server IO #7/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:246) ~[hd.class:?]
at net.minecraft.network.play.client.C17PacketCustomPayload.func_148837_a(C17PacketCustomPayload.java:34) ~[mc.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:35:20] [Netty Server IO #7/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received encoded string buffer length is longer than maximum allowed (768 > 400)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:237) ~[hd.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148837_a(SourceFile:27) ~[lu.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:35:20] [server thread/INFO]: Kannaford lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[15:35:20] [server thread/INFO]: Kannaford left the game
[15:35:20] [Client thread/INFO]: [CHAT] Kannaford left the game
[15:36:08] [user Authenticator #4/INFO]: UUID of player Kannaford is 69f6021f-5be5-476f-ae0c-54c947d2f4d7
[15:36:09] [Netty Server IO #0/INFO] [FML]: Client protocol version 2
[15:36:09] [Netty Server IO #0/INFO] [FML]: Client attempting to join with 10 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[15:36:09] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[15:36:09] [server thread/INFO]: Kannaford[/7.110.114.159:64857] logged in with entity id 394425 at (-17.69999998807907, 64.0, -64.50735650134459)
[15:36:09] [server thread/INFO]: Kannaford joined the game
[15:36:09] [Client thread/INFO]: [CHAT] Kannaford joined the game
[15:36:52] [Netty Server IO #0/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:246) ~[hd.class:?]
at net.minecraft.network.play.client.C17PacketCustomPayload.func_148837_a(C17PacketCustomPayload.java:34) ~[mc.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:139) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
[15:36:52] [Netty Server IO #0/ERROR] [FML]: NetworkDispatcher exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:257) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:190) ~[byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:208) [byteToMessageDecoder.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:4.0.15.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelInactive(ReadTimeoutHandler.java:143) [ReadTimeoutHandler.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:238) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:224) [DefaultChannelHandlerContext.class:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [DefaultChannelPipeline.class:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:560) [AbstractChannel$AbstractUnsafe$5.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(28) + length(1) exceeds writerIndex(28): UnpooledHeapByteBuf(ridx: 28, widx: 28, cap: 28)
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161) ~[AbstractByteBuf.class:4.0.15.Final]
at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:648) ~[AbstractByteBuf.class:4.0.15.Final]
at net.minecraft.network.PacketBuffer.readBytes(SourceFile:669) ~[hd.class:?]
at net.minecraft.network.PacketBuffer.func_150789_c(SourceFile:243) ~[hd.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148837_a(SourceFile:27) ~[lu.class:?]
at net.minecraft.util.MessageDeserializer.decode(SourceFile:40) ~[he.class:?]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:226) ~[byteToMessageDecoder.class:4.0.15.Final]
... 22 more
[15:36:52] [server thread/INFO]: Kannaford lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (24 > 20)], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[15:36:52] [server thread/INFO]: Kannaford left the game
[15:36:52] [Client thread/INFO]: [CHAT] Kannaford left the game

 

 

This is my source code:

 

Main mod class:

 

package net.roxa.accessControl;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.block.model.ModelBlock;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod(modid = RoxaAccessControlMod.MODID, version = RoxaAccessControlMod.VERSION, name = RoxaAccessControlMod.MODNAME)
public class RoxaAccessControlMod
{
    public static final String MODID = "RoxaAccessControl";
    public static final String MODNAME = "Roxa's Access Control Mod";
    public static final String VERSION = "1.8.0v0.0.8";
    
    @Instance
    public static RoxaAccessControlMod instance = new RoxaAccessControlMod();
    
    public static Block accessPanel;
    public static Block accessAdministrator;
    public static TileEntityAccessAdministrator tileEntityAccessAdministrator;
    public static Item accessCard;
    
    public static SimpleNetworkWrapper network;
    
    public static int accessAdministratorGuiId;
    
    public static int accessAdministratorMessageId;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    	this.init();
    	this.register();
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	registerRenders();

    	registerHandlers();
    	
    	registerRecipes();
    }

@EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    	
    }
    
    public static void init() 
    {
    	accessPanel = new BlockAccessPanel();
    	accessAdministrator = new BlockAccessAdministrator();
    	tileEntityAccessAdministrator = new TileEntityAccessAdministrator();
    	accessCard = new ItemAccessCard();
    	
    	accessAdministratorGuiId = 1;
    	
    	accessAdministratorMessageId = 1;
    	//accessAdministratorMessageIdServer = 1;
    	//accessAdministratorMessageIdClient = 2;
    	
    	network = NetworkRegistry.INSTANCE.newSimpleChannel("RoxaAccessControlChannel");
    }

    @SideOnly(Side.CLIENT)
    public static void register() 
    {
    	GameRegistry.registerBlock(accessPanel, ItemAccessPanel.class, accessPanel.getUnlocalizedName().substring(5));
    	GameRegistry.registerBlock(accessAdministrator, accessAdministrator.getUnlocalizedName().substring(5));
    	GameRegistry.registerItem(accessCard, accessCard.getUnlocalizedName().substring(5));
    	
    	GameRegistry.registerTileEntity(TileEntityAccessAdministrator.class, tileEntityAccessAdministrator.getName());
    	
    	network.registerMessage(MessageAccessAdministrator.Handler.class, MessageAccessAdministrator.class, accessAdministratorMessageId, Side.SERVER);
    	network.registerMessage(MessageAccessAdministrator.Handler.class, MessageAccessAdministrator.class, accessAdministratorMessageId, Side.CLIENT);
        
    	ModelBakery.addVariantName(Item.getItemFromBlock(accessPanel), "RoxaAccessControl:accessPanel_white", "RoxaAccessControl:accessPanel_yellow", "RoxaAccessControl:accessPanel_orange", "RoxaAccessControl:accessPanel_red", "RoxaAccessControl:accessPanel_purple", "RoxaAccessControl:accessPanel_blue", "RoxaAccessControl:accessPanel_green", "RoxaAccessControl:accessPanel_black");
    }
    
    public static void registerRenders() 
    {
    	registerRender(accessAdministrator);
    	registerRender(accessPanel, 1, "accessPanel_white");
    	registerRender(accessPanel, 2, "accessPanel_yellow");
    	registerRender(accessPanel, 3, "accessPanel_orange");
    	registerRender(accessPanel, 4, "accessPanel_red");
    	registerRender(accessPanel, 5, "accessPanel_purple");
    	registerRender(accessPanel, 6, "accessPanel_blue");
    	registerRender(accessPanel, 7, "accessPanel_green");
    	registerRender(accessPanel, 0, "accessPanel_black");
    	registerRender(accessCard);
    }
    
    public void registerHandlers() 
    {
	NetworkRegistry.INSTANCE.registerGuiHandler(MODID, new GuiHandler());	
}
    
    public static void registerRender(Block block)
    {
    	Item item = Item.getItemFromBlock(block);
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }
    
    public static void registerRender(Block block, int meta, String file)
    {
    	Item item = Item.getItemFromBlock(block);
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(MODID + ":" + file, "inventory"));
    }
    
    public static void registerRender(Item item)
    {
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }
    
    private void registerRecipes()
{
    	ItemStack i = new ItemStack(accessCard, 4, 1); //Item: Access Card, Amount: 1, Damage 1
	GameRegistry.addRecipe(i, new Object [] {" # ", "#X#", " # ", Character.valueOf('#'), Items.paper, Character.valueOf('X'), Items.redstone});

	i = new ItemStack(accessPanel, 1, 1);
	GameRegistry.addRecipe(i, new Object [] {"###", "#X#", "###", Character.valueOf('#'), Items.iron_ingot, Character.valueOf('X'), Items.redstone});

	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 0)); //black
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 1)); //white
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 2)); //yellow
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 3)); //orange
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 4)); //red
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 5)); //purple
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 6)); //blue
	addaccessPanelRecipe(new ItemStack(accessPanel, 1, 7)); //green
}
    
    public void addaccessPanelRecipe(ItemStack input1)
    {
    	ItemStack input2;
    	ItemStack output;
    	
    	input2 = new ItemStack(Items.dye, 1, 0);
	output = new ItemStack(accessPanel, 1, 0);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 15);
	output = new ItemStack(accessPanel, 1, 1);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 11);
	output = new ItemStack(accessPanel, 1, 2);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 14);
	output = new ItemStack(accessPanel, 1, 3);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 1);
	output = new ItemStack(accessPanel, 1, 4);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 5);
	output = new ItemStack(accessPanel, 1, 5);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 4);
	output = new ItemStack(accessPanel, 1, 6);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.dye, 1, 2);
	output = new ItemStack(accessPanel, 1, 7);
	GameRegistry.addShapelessRecipe(output, new Object[] {input1, input2});

	input2 = new ItemStack(Items.redstone);
	output = new ItemStack(accessAdministrator);
	GameRegistry.addRecipe(output, new Object [] {"###", "#X#", "###", Character.valueOf('X'), input1, Character.valueOf('#'), input2});
    }
}

 

 

Container:

 

package net.roxa.accessControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;

public class ContainerAccessAdministrator extends Container
{
public IInventory cardSlot;
protected TileEntityAccessAdministrator tileEntity;

    private World worldObj;
    private BlockPos pos;
    private EntityPlayer player;

    public ContainerAccessAdministrator(EntityPlayer playerIn, InventoryPlayer playerInventory, World worldIn, BlockPos posIn, TileEntityAccessAdministrator te)
    {
        this.worldObj = worldIn;
        this.pos = posIn;
        this.player = playerIn;
        this.tileEntity = te;
        cardSlot = te;
        int i;
        int j;
        
        this.addSlotToContainer(new Slot(this.cardSlot, 0, 22, 25)); //Slot 0 of custom "Inventory"
        
        for (i = 0; i < 3; ++i)
        {
            for (j = 0; j < 9; ++j)
            {
                this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 48 + j * 18, 121 + i * 18)); //Slot (9 to 35) or (10 to 36)
            }
        }
        
        for (i = 0; i < 9; ++i)
        {
            this.addSlotToContainer(new Slot(playerInventory, i, 48 + i * 18, 179)); //Slot (0 to  or (1 to 9)
        }
        
        ItemStack stack = playerInventory.getCurrentItem();
        if (stack != null && stack.getItem() == RoxaAccessControlMod.accessCard)
        {
        	this.mergeItemStack(stack, 0, 0+1, false);
        }
        
        EntityPlayer player = playerInventory.player;
        if (!worldIn.isRemote)
        {
        	if (RoxaAccessControlMod.network != null) RoxaAccessControlMod.network.sendTo(new MessageAccessAdministrator(cardSlot.getStackInSlot(0).getItemDamage()), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
        }
    }
   
    @Override
    public void onContainerClosed(EntityPlayer playerIn)
    {
        super.onContainerClosed(playerIn);
        
        if (!this.worldObj.isRemote)
        {
            ItemStack itemstack = this.cardSlot.getStackInSlotOnClosing(0);

            if (itemstack != null) playerIn.dropPlayerItemWithRandomChoice(itemstack, false);
        }
    }
    
    @Override
    public boolean canInteractWith(EntityPlayer playerIn)
    {
        return playerIn.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D;
    }
    
    @Override
    public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
    {
    	ItemStack itemstack = null;
    	Slot slot = (Slot)this.inventorySlots.get(index);
    	if (slot != null && slot.getHasStack())
    	{
    		ItemStack itemstack1 = slot.getStack();
    		itemstack = itemstack1.copy();
    		// If itemstack is in Output stack
    		if (index == 0)
    		{
    			// try to place in player inventory / action bar; add 36+1 because mergeItemStack uses < index,
    			// so the last slot in the inventory won't get checked if you don't add 1
    			if (!this.mergeItemStack(itemstack1, 0+1, 0+36+1, true))
    			{
    				return null;
    			}
    			slot.onSlotChange(itemstack1, itemstack);
    		}
    		// itemstack is in player inventory, try to place in appropriate furnace slot
    		else if (index != 0)
    		{
    			//if it is an access Card, place it in the access card slot
    			if (itemstack1.getItem() == RoxaAccessControlMod.accessCard)
    			{
    				if (!this.mergeItemStack(itemstack1, 0, 0+1, false))
    				{
    					return null;
    				}
    			}
    			//item in player's inventory, but not in action bar
    			else if (index >= 0+1 && index < 0+28)
    			{
    				//place in action bar
    				if (!this.mergeItemStack(itemstack1, 0+28, 0+37, false))
    				{
    					return null;
    				}
    			}
    			//item in action bar - place in player inventory
    			else if (index >= 0+28 && index < 0+37 && !this.mergeItemStack(itemstack1, 0+1, 0+28, false))
    			{
    				return null;
    			}
    		}
    		//In one of the infuser slots; try to place in player inventory / action bar
    		else if (!this.mergeItemStack(itemstack1, 0+1, 0+37, false))
    		{
    			return null;
    		}
    		
    		if (itemstack1.stackSize == 0)
    		{
    			slot.putStack((ItemStack)null);
    		}
    		else
    		{
    			slot.onSlotChanged();
    		}
    		
    		if (itemstack1.stackSize == itemstack.stackSize)
    		{
    			return null;
    		}
    		
    		slot.onPickupFromSlot(playerIn, itemstack1);
    	}
    	return itemstack;
   	}
    
    @Override
    public void detectAndSendChanges()
    {
    	for (int i = 0; i < this.inventorySlots.size(); ++i)
        {
            ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack();
            ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i);

            if (!ItemStack.areItemStacksEqual(itemstack1, itemstack))
            {
                itemstack1 = itemstack == null ? null : itemstack.copy();
                this.inventoryItemStacks.set(i, itemstack1);

                for (int j = 0; j < this.crafters.size(); ++j)
                {
                    ((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1);
                }
            }
            if (!worldObj.isRemote)
            {
            	if (cardSlot.getStackInSlot(0) != null) RoxaAccessControlMod.network.sendTo(new MessageAccessAdministrator(cardSlot.getStackInSlot(0).getItemDamage()), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
            	else RoxaAccessControlMod.network.sendTo(new MessageAccessAdministrator(0), (EntityPlayerMP) player);
            }
        }
    }
}

 

 

Gui:

 

package net.roxa.accessControl;

import java.io.IOException;

import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class GuiAccessAdministrator extends GuiContainer
{
public static ResourceLocation texture = new ResourceLocation(RoxaAccessControlMod.MODID.toLowerCase(), "textures/gui/GuiAccessCardAdministration.png");

private final int buttonIdAdministrator = 0;
private final int buttonIdWhite = 1;
private final int buttonIdYellow = 2;
private final int buttonIdOrange = 3;
private final int buttonIdRed = 4;
private final int buttonIdPurple = 5;
private final int buttonIdBlue = 6;
private final int buttonIdGreen = 7;
private final int buttonIdBlack = 8;

private BlockPos pos;
TileEntityAccessAdministrator tileEntity;

boolean administrator = false;
boolean white = false;
boolean yellow = false;
boolean orange = false;
boolean red = false;
boolean purple = false;
boolean blue = false;
boolean green = false;
boolean black = false;

public GuiAccessAdministrator(EntityPlayer player, InventoryPlayer playerInv, World worldIn, BlockPos blockPos, TileEntityAccessAdministrator tileEntity)//, ContainerBla containerBla)
{
	super(new ContainerAccessAdministrator(player, playerInv, worldIn, blockPos, tileEntity));
	this.tileEntity = tileEntity;
	this.xSize = 256;
	this.ySize = 203;
	this.pos = blockPos;
}

protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
	ItemStack stack = this.tileEntity.getStackInSlot(0);
	if (stack != null && stack.getItem() == RoxaAccessControlMod.accessCard) this.dataToCanAccess(stack.getItemDamage());
	else this.dataToCanAccess(256);
	this.fontRendererObj.drawString(I18n.format("gui.accessAdministraton", new Object[0]), this.xSize - 187, this.ySize - 190, 4210752);

	int buttonId;
	int left = this.xSize - 174;
	int right = left + 11;
	int top = this.ySize - 172;
	int bottom = top + 20 - 9;

	drawRect(left, top, right, bottom, -0xA0A0A0);
	if(isActivated(0)) fontRendererObj.drawString("O", left + 3, top + 2, 0x00FF00);
	else fontRendererObj.drawString("X", left + 3, top + 2, 0xFF0000);
	drawHorizontalLine(right + 3, right + 82, bottom, -0xFFFFFF);
	drawHorizontalLine(right + 4, right + 81, bottom-1, -0xA8A8A8);

	left = this.xSize - 237;
	right = left + 11;
	for(int i = 0; i <= 3; i++)
	{
		buttonId = i + 1;
		top = this.ySize + i * 15 - 151;
		bottom = top + 11;
		drawRect(left, top, right, bottom, -0xA0A0A0);

		if(isActivated(buttonId)) fontRendererObj.drawString("O", left + 3, top + 2, 0x00FF00);
		else fontRendererObj.drawString("X", left + 3, top + 2, 0xFF0000);
		drawHorizontalLine(right + 3, right + 82, bottom, -0xFFFFFF);
		drawHorizontalLine(right + 4, right + 81, bottom-1, -0xA8A8A8);
	}

	left = this.xSize - 112;
	right = left + 11;
	for(int i = 0; i <= 3; i++)
	{
		buttonId = i + 5;
		top = this.ySize + i * 15 - 151;
		bottom = top + 11;
		drawRect(left, top, right, bottom, -0xA0A0A0);
		if(isActivated(buttonId)) fontRendererObj.drawString("O", left + 3, top + 2, 0x00FF00);
		else fontRendererObj.drawString("X", left + 3, top + 2, 0xFF0000);
		drawHorizontalLine(right + 3, right + 82, bottom, -0xFFFFFF);
		drawHorizontalLine(right + 4, right + 81, bottom-1, -0xA8A8A8);
	}

	//System.out.println("Working with: " + canAccessToData());
    }

@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
	mc.getTextureManager().bindTexture(texture);
	this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);

}

@Override
public void initGui()
{
	int buttonWidth = 80;
	int buttonHeight = 12;
	int buttonX = width/2 - 95;

	this.buttonList.add(new GuiButton(buttonIdAdministrator	, buttonX+63, height/2 - 75 + 4 , buttonWidth, buttonHeight, I18n.format("gui.button.administrator", new Object[0])));

	this.buttonList.add(new GuiButton(buttonIdWhite			, buttonX, height/2 - 50, buttonWidth, buttonHeight, I18n.format("gui.button.white", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdYellow		, buttonX, height/2 - 35, buttonWidth, buttonHeight, I18n.format("gui.button.yellow", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdOrange		, buttonX, height/2 - 20, buttonWidth, buttonHeight, I18n.format("gui.button.orange", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdRed			, buttonX, height/2 - 5 , buttonWidth, buttonHeight, I18n.format("gui.button.red", new Object[0])));

	buttonX = width/2 + 30;
	this.buttonList.add(new GuiButton(buttonIdPurple		, buttonX, height/2 - 50, buttonWidth, buttonHeight, I18n.format("gui.button.purple", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdBlue			, buttonX, height/2 - 35, buttonWidth, buttonHeight, I18n.format("gui.button.blue", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdGreen			, buttonX, height/2 - 20, buttonWidth, buttonHeight, I18n.format("gui.button.green", new Object[0])));
	this.buttonList.add(new GuiButton(buttonIdBlack			, buttonX, height/2 - 5 , buttonWidth, buttonHeight, I18n.format("gui.button.black", new Object[0])));

	super.initGui();
}

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
	if (keyCode == mc.gameSettings.keyBindInventory.getKeyCode())
	{
		mc.thePlayer.closeScreen();
	}

	super.keyTyped(typedChar, keyCode);
}

@Override
protected void actionPerformed(GuiButton button) throws IOException
{
	switch (button.id)
	{
	case buttonIdAdministrator:
		toggleButton(button.id);
		//System.out.println("Administrator");
		break;
	case buttonIdWhite:
		toggleButton(button.id);
		break;
	case buttonIdYellow:
		toggleButton(button.id);
		break;
	case buttonIdOrange:
		toggleButton(button.id);
		break;
	case buttonIdRed:
		toggleButton(button.id);
		break;
	case buttonIdPurple:
		toggleButton(button.id);
		break;
	case buttonIdBlue:
		toggleButton(button.id);
		break;
	case buttonIdGreen:
		toggleButton(button.id);
		break;
	case buttonIdBlack:
		toggleButton(button.id);
		break;
	default:
		break;
	}
	RoxaAccessControlMod.network.sendToServer(new MessageAccessAdministrator(this.canAccessToData()));
	super.actionPerformed(button);
}

private int canAccessToData()
{
	int data = 0;
	if (white) data |= 1;
	if (yellow) data |= 2;
	if (orange) data |= 4;
	if (red) data |= 8;
	if (purple) data |= 16;
	if (blue) data |= 32;
	if (green) data |= 64;
	if (black) data |= 128;
	if (data == 0) data = 256;
	if (administrator) data |= 512;
	return data;
}

public void dataToCanAccess(int dataIn)
{
	if ((dataIn & 1) != 0) white = true;
	else white = false;
	if ((dataIn & 2) != 0) yellow = true;
	else yellow = false;
	if ((dataIn & 4) != 0) orange = true;
	else orange = false;
	if ((dataIn &  != 0) red = true;
	else red = false;
	if ((dataIn & 16) != 0) purple = true;
	else purple = false;
	if ((dataIn & 32) != 0) blue = true;
	else blue = false;
	if ((dataIn & 64) != 0) green = true;
	else green = false;
	if ((dataIn & 128) != 0) black = true;
	else black = false;
	if ((dataIn & 512) != 0) administrator = true;
	else administrator = false;
}

public boolean isActivated(int buttonID)
{
	boolean activated = false;
	switch (buttonID)
	{
	case buttonIdAdministrator:
		activated = administrator;
		break;
	case buttonIdWhite:
		activated = white;
		break;
	case buttonIdYellow:
		activated = yellow;
		break;
	case buttonIdOrange:
		activated = orange;
		break;
	case buttonIdRed:
		activated = red;
		break;
	case buttonIdPurple:
		activated = purple;
		break;
	case buttonIdBlue:
		activated = blue;
		break;
	case buttonIdGreen:
		activated = green;
		break;
	case buttonIdBlack:
		activated = black;
		break;
	default:
		break;
	}
	return activated;
}

public boolean toggleButton(int buttonID)
{
	boolean activated = isActivated(buttonID);
	activated =! activated;
	switch (buttonID)
	{
	case buttonIdAdministrator:
		administrator = activated;
		break;
	case buttonIdWhite:
		white = activated;
		break;
	case buttonIdYellow:
		yellow = activated;
		break;
	case buttonIdOrange:
		orange = activated;
		break;
	case buttonIdRed:
		red = activated;
		break;
	case buttonIdPurple:
		purple = activated;
		break;
	case buttonIdBlue:
		blue = activated;
		break;
	case buttonIdGreen:
		green = activated;
		break;
	case buttonIdBlack:
		black = activated;
		break;
	default:
		break;
	}
	return activated;
}
}

 

 

Message and MessageHandler:

 

package net.roxa.accessControl;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.fml.relauncher.Side;

public class MessageAccessAdministrator implements IMessage
{
private int data;

public MessageAccessAdministrator()
{

}

public MessageAccessAdministrator(int dataIn)
{
	this.data = dataIn;
}

@Override
    public void fromBytes(ByteBuf buf) {
	data = ByteBufUtils.readVarInt(buf, 5);
    }

    @Override
    public void toBytes(ByteBuf buf) {
    	ByteBufUtils.writeVarInt(buf, data, 5);
    }
    
    public static class Handler implements IMessageHandler<MessageAccessAdministrator, IMessage> 
    {
        
    	@Override
        public IMessage onMessage(final MessageAccessAdministrator message, final MessageContext ctx) 
        {
        	IThreadListener mainThread;
            Side side = ctx.side;
        	if (side == Side.SERVER) mainThread = (WorldServer) ctx.getServerHandler().playerEntity.worldObj; // or Minecraft.getMinecraft() on the client
        	else mainThread = Minecraft.getMinecraft();
            mainThread.addScheduledTask(new Runnable() 
            {
                @Override
                public void run() 
                {
                	//System.out.println(String.format("Received %d from %s", message.data, ctx.getServerHandler().playerEntity.getDisplayName()));
                	Side side = ctx.side;
                	if (side == Side.SERVER)
                	{
                    	handleServerSide(ctx, message.data);//, message.x, message.y, message.z);
                    	//System.out.println("ServerSide");
                    }
                    else
                    {
                    	handleClientSide(ctx, message.data);
                    	//System.out.println("ClientSide");
                    }
                    //else System.out.println("No Side");
                }
            });
            return null; // no response in this case
        }
        
        public void handleClientSide(MessageContext ctx, int dataIn)//, int xIn, int yIn, int zIn)
        {
        	Gui gui = Minecraft.getMinecraft().currentScreen;
        	if (gui instanceof GuiAccessAdministrator)
        	{
        		GuiAccessAdministrator gaa = (GuiAccessAdministrator)gui;
        		gaa.dataToCanAccess(dataIn);
        		//System.out.println("Sent to Gui: " + dataIn);
        	}
        }
        
        public void handleServerSide(MessageContext ctx, int dataIn)//, int xIn, int yIn, int zIn)
        {
        	Container container;
        	container = ctx.getServerHandler().playerEntity.openContainer;
        	
        	if (container instanceof ContainerAccessAdministrator)
        	{
        		ContainerAccessAdministrator caa;
        		caa = (ContainerAccessAdministrator) container;
        		ItemStack stack = caa.cardSlot.getStackInSlot(0);
        		if (stack != null && stack.getItem() == RoxaAccessControlMod.accessCard) stack.setItemDamage(dataIn);
        	}
        }
    }
}

 

 

Block:

 

package net.roxa.accessControl;

import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class BlockAccessAdministrator extends BlockContainer
{

public static final PropertyBool CARDINSERTED = PropertyBool.create("cardInserted");

public BlockAccessAdministrator()
{
	super(Material.circuits);
	this.setDefaultState(this.blockState.getBaseState().withProperty(CARDINSERTED, Boolean.valueOf(false)));
	this.setUnlocalizedName("accessAdministrator");
	this.setCreativeTab(CreativeTabs.tabRedstone);
	this.setStepSound(Block.soundTypeStone);
}

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
	boolean activated = false;
	ItemStack itemStackHold = playerIn.getHeldItem();
	Item item;
	if (itemStackHold != null) item = itemStackHold.getItem();
	else item = null;
	{
		TileEntity tileEntity = worldIn.getTileEntity(pos);
		if (tileEntity == null || playerIn.isSneaking())
		{
			return false;
		}

		playerIn.openGui(RoxaAccessControlMod.instance, RoxaAccessControlMod.accessAdministratorGuiId, worldIn, pos.getX(), pos.getY(), pos.getZ());
		activated = true;
	}
	return activated;
}

public IBlockState getStateFromMeta(int meta)
{
	IBlockState state = this.getDefaultState();
	state.withProperty(CARDINSERTED, Boolean.valueOf((meta &  != 0));
	return state;
}

public int getMetaFromState(IBlockState state)
{
	int i = 0;
	if (((Boolean) state.getValue(CARDINSERTED)).booleanValue()) i |= 8;
	return i;
}

protected BlockState createBlockState()
{
	return new BlockState(this, new IProperty[] { CARDINSERTED });
}

@Override
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
{
	dropItems(worldIn, pos);
	super.breakBlock(worldIn, pos, state);
}

private void dropItems(World world, BlockPos pos)
{
	Random rand = new Random();

	TileEntity tileEntity = world.getTileEntity(pos);
	if (!(tileEntity instanceof IInventory))
	{
		return;
	}
	IInventory inventory = (IInventory) tileEntity;

	for (int i = 0; i < inventory.getSizeInventory(); i++)
	{
		ItemStack item = inventory.getStackInSlot(i);

		if (item != null && item.stackSize > 0)
		{
			float rx = rand.nextFloat() * 0.8F + 0.1F;
			float ry = rand.nextFloat() * 0.8F + 0.1F;
			float rz = rand.nextFloat() * 0.8F + 0.1F;

			EntityItem entityItem = new EntityItem(world, pos.getX() + rx, pos.getY() + ry, pos.getZ() + rz, item);

			if (item.hasTagCompound())
			{
				entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
			}

			float factor = 0.05F;
			entityItem.motionX = rand.nextGaussian() * factor;
			entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
			entityItem.motionZ = rand.nextGaussian() * factor;
			world.spawnEntityInWorld(entityItem);
			item.stackSize = 0;
		}
	}
}

@Override
public int getRenderType()
{
	return 3;
}

@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
	return new TileEntityAccessAdministrator();
}
}

 

 

TileEntity:

 

package net.roxa.accessControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IChatComponent;

public class TileEntityAccessAdministrator extends TileEntity implements IInventory
{
private ItemStack inv;

public TileEntityAccessAdministrator()
{
	// inv = new ItemStack[1];
}

@Override
public String getName()
{
	return "tileEntity.AccessAdminsitrator";
}

@Override
public boolean hasCustomName()
{
	return false;
}

@Override
public IChatComponent getDisplayName()
{
	// Auto-generated method stub
	return null;
}

@Override
public int getSizeInventory()
{
	// return inv.length;
	return 1;
}

@Override
public ItemStack getStackInSlot(int index)
{
	// return inv[index];
	return inv;
}

@Override
public ItemStack decrStackSize(int index, int amt)
{
	ItemStack stack = getStackInSlot(index);
	if (stack != null)
	{
		if (stack.stackSize <= amt)
		{
			setInventorySlotContents(index, null);
		} else
		{
			stack = stack.splitStack(amt);
			if (stack.stackSize == 0)
			{
				setInventorySlotContents(index, null);
			}
		}
	}
	return stack;
}

@Override
public ItemStack getStackInSlotOnClosing(int index)
{
	ItemStack stack = getStackInSlot(index);
	if (stack != null)
	{
		setInventorySlotContents(index, null);
	}
	return stack;
}

@Override
public void setInventorySlotContents(int index, ItemStack stack)
{
	// inv[index] = stack;
	inv = stack;
	if (stack != null && stack.stackSize > getInventoryStackLimit())
	{
		stack.stackSize = getInventoryStackLimit();
	}
}

@Override
public int getInventoryStackLimit()
{
	return 64;
}

@Override
public boolean isUseableByPlayer(EntityPlayer player)
{
	return player.getDistanceSq(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5) < 64;
	// return false;
}

@Override
public void openInventory(EntityPlayer player)
{
	// Auto-generated method stub

}

@Override
public void closeInventory(EntityPlayer player)
{
	// Auto-generated method stub

}

@Override
public boolean isItemValidForSlot(int index, ItemStack stack)
{
	// Auto-generated method stub
	return false;
}

@Override
public int getField(int id)
{
	// Auto-generated method stub
	return 0;
}

@Override
public void setField(int id, int value)
{
	// Auto-generated method stub

}

@Override
public int getFieldCount()
{
	// Auto-generated method stub
	return 0;
}

@Override
public void clear()
{
	// Auto-generated method stub

}

@Override
public void readFromNBT(NBTTagCompound tagCompound)
{
	super.readFromNBT(tagCompound);

	NBTTagCompound tag = tagCompound.getCompoundTag("Inventory");
	inv = ItemStack.loadItemStackFromNBT(tag);
}

@Override
public void writeToNBT(NBTTagCompound tagCompound)
{
	super.writeToNBT(tagCompound);

	ItemStack stack = inv;
	if (stack != null)
	{
		//System.out.println("Started  Write to NBT");
		NBTTagCompound tag = new NBTTagCompound();
		stack.writeToNBT(tag);
		tagCompound.setTag("Inventory", tag);
		//System.out.println("Finished Write to NBT");
	}
}

public void setData(int dataIn)
{
	inv.setItemDamage(dataIn);
}
}

 

 

The Item I'm trying to change in the gui/container:

 

package net.roxa.accessControl;

import java.util.List;
import java.math.*;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.command.ICommandManager;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/*
Item Damage stores Access Data:

If you take the absolute value:
&1 		!= 0: Access Card with Access to "1, White"
&2 		!= 0: Access Card with Access to "2, Yellow"
&4 		!= 0: Access Card with Access to "3, Orange"
&8 		!= 0: Access Card with Access to "4, Red"
&16 	!= 0: Access Card with Access to "5, Purple"
&32		!= 0: Access Card with Access to "6, Blue"
&64 	!= 0: Access Card with Access to "7, Green"
&128	!= 0: Access Card with Access to "8, Black"
&256	!= 0: No Access
&512	!= 0: Administrator
&1024	!= 0:
&2048	!= 0:
&4096	!= 0:
&8192	!= 0:
&16384	!= 0:
*/
public class ItemAccessCard extends Item {

public ItemAccessCard() {
    super();
    this.setCreativeTab(CreativeTabs.tabRedstone);
    this.setUnlocalizedName("accessCard");
    this.setMaxDamage(512);
    this.setHasSubtypes(true);
}

@SideOnly(Side.CLIENT)
    public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
    {
        subItems.add(new ItemStack(itemIn, 1, 512));
    }

public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List descriptionList, boolean par4) 
{
	if(isAdmin(itemStack)) descriptionList.add(I18n.format("item.accessCard.description.administrator", new Object[0]));
	if((itemStack.getItemDamage() & 255) != 0) descriptionList.add(I18n.format("item.accessCard.description.accessTo", new Object[0]));
	{
		if((itemStack.getItemDamage() & 255) == 255) descriptionList.add(I18n.format("item.accessCard.description.all", new Object[0]));
		else
		{
			if (canAccess(itemStack, 1)) descriptionList.add(I18n.format("item.accessCard.description.white", new Object[0]));
		    if (canAccess(itemStack, 2)) descriptionList.add(I18n.format("item.accessCard.description.yellow", new Object[0]));
		    if (canAccess(itemStack, 3)) descriptionList.add(I18n.format("item.accessCard.description.orange", new Object[0]));
		    if (canAccess(itemStack, 4)) descriptionList.add(I18n.format("item.accessCard.description.red", new Object[0]));
		    if (canAccess(itemStack, 5)) descriptionList.add(I18n.format("item.accessCard.description.purple", new Object[0]));
		    if (canAccess(itemStack, 6)) descriptionList.add(I18n.format("item.accessCard.description.blue", new Object[0]));
		    if (canAccess(itemStack, 7)) descriptionList.add(I18n.format("item.accessCard.description.green", new Object[0]));
		    if (canAccess(itemStack, ) descriptionList.add(I18n.format("item.accessCard.description.black", new Object[0]));
		}
	}
}

public boolean canAccess(ItemStack itemStack, int blockNumber)
{
 	return this.canAccess(itemStack.getItemDamage(), blockNumber);
}
  
public boolean canAccess(int damage, int blockNumber)
{
  	boolean canAccess = false;
  	if (((damage & (int)Math.pow(2, blockNumber-1)) != 0)) canAccess = true;
  	return canAccess;
}

public boolean isAdmin(ItemStack itemstack)
{
	int damage = itemstack.getItemDamage();
  	boolean canAccess = false;
  	if ((damage & 512) != 0) canAccess = true;
  	return canAccess;
}

public Item getItem(ItemStack itemStack)
{
	return RoxaAccessControlMod.accessCard;
}

  	public boolean showDurabilityBar(ItemStack stack)
  	{
  		return false;
  	}
}

 

 

GuiHandler:

 

package net.roxa.accessControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler
{

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	BlockPos pos = new BlockPos(x, y, z);
	TileEntity tileEntity = world.getTileEntity(pos);
	if(ID == RoxaAccessControlMod.accessAdministratorGuiId && tileEntity instanceof TileEntityAccessAdministrator)
	{
		return new ContainerAccessAdministrator(player, player.inventory, world, pos, (TileEntityAccessAdministrator)tileEntity);
	}
	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	BlockPos pos = new BlockPos(x, y, z);
	TileEntity tileEntity = world.getTileEntity(pos);
	if(ID == RoxaAccessControlMod.accessAdministratorGuiId && tileEntity instanceof TileEntityAccessAdministrator)
	{
		return new GuiAccessAdministrator(player, player.inventory, world, pos, (TileEntityAccessAdministrator)tileEntity);
	}
	return null;
}

}

 

Posted

I'm pretty sure the error is because your SimpleNetworkWrapper channel name exceeds the maximum length of 20.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.