Thornack Posted April 19, 2016 Posted April 19, 2016 This happens when I run a dedicated server, join the world, then store an entity inside my itemstack using my item and pick up the resultant item containing the nbt data for my entity "too fast" it seems (although it doesnt happen every time which is odd) Anyone know why this would occur? [13:57:03] [Netty IO #2/ERROR] [FML]: NetworkDispatcher exception io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:129) ~[MessageToByteEncoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637) ~[DefaultChannelHandlerContext.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:423) ~[NetworkDispatcher.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:688) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:717) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:893) ~[DefaultChannelPipeline.class:?] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:239) ~[AbstractChannel.class:?] at net.minecraft.network.NetworkManager$1.run(NetworkManager.java:197) [NetworkManager$1.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) [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] Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) ~[?:1.7.0_25] at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.7.0_25] at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:33) ~[NBTTagCompound.class:?] at net.minecraft.nbt.CompressedStreamTools.func_150663_a(CompressedStreamTools.java:158) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.write(CompressedStreamTools.java:148) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.compress(CompressedStreamTools.java:88) ~[CompressedStreamTools.class:?] at net.minecraft.network.PacketBuffer.writeNBTTagCompoundToBuffer(PacketBuffer.java:94) ~[PacketBuffer.class:?] at net.minecraft.network.PacketBuffer.writeItemStackToBuffer(PacketBuffer.java:140) ~[PacketBuffer.class:?] at net.minecraft.entity.DataWatcher.writeWatchableObjectToPacketBuffer(DataWatcher.java:289) ~[DataWatcher.class:?] at net.minecraft.entity.DataWatcher.writeWatchedListToPacketBuffer(DataWatcher.java:186) ~[DataWatcher.class:?] at net.minecraft.network.play.server.S1CPacketEntityMetadata.writePacketData(S1CPacketEntityMetadata.java:50) ~[s1CPacketEntityMetadata.class:?] at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:46) ~[MessageSerializer.class:?] at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:53) ~[MessageSerializer.class:?] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111) ~[MessageToByteEncoder.class:?] ... 15 more [13:57:03] [server thread/INFO]: Player14 lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}} [13:57:03] [server thread/INFO]: Player14 left the game Quote
Ernio Posted April 19, 2016 Posted April 19, 2016 You are fking with threads. Something from somewhere (thread) is editing something it is not supposed to. What did you do... (this time) ? (code) Quote 1.7.10 is no longer supported by forge, you are on your own.
Thornack Posted April 19, 2016 Author Posted April 19, 2016 I think I can bandaid the solution by setting the delayBeforeCanPickup variable for the entity item (somehow) but i think id rather know what the real issue is so i can fix it Quote
Thornack Posted April 19, 2016 Author Posted April 19, 2016 any idea where to start debugging this? Quote
Thornack Posted April 19, 2016 Author Posted April 19, 2016 I have no idea where to even look the error only happens once in a while it seems so Im not sure what code to provide Quote
Ernio Posted April 19, 2016 Posted April 19, 2016 How about update to 1.9 (finally) and rewrite stuff to proper main<->network thread handling. 1.7.10 is ancient and networking changed enough for most of us to simply not be able to help. Anywaya: No, I have no idea and you must be doing something REALLY weird. If you are not using any of your own packets, it must be some kind of return you do or something else. For one I'd be interested in "and pick up the resultant item" - what do you mean? Do you use item, catch entity and then pick it up or what? Again: code (and yeah, I know it is big and super messy, so only github is accepted in this case). I have no idea where to even look the error only happens once in a while it seems so Im not sure what code to provide Because that is what messing with threads do. Quote 1.7.10 is no longer supported by forge, you are on your own.
Thornack Posted April 19, 2016 Author Posted April 19, 2016 kk ill get my code to github and post a link asap Quote
Recommended Posts
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.