1.19 - Field index out of bounds error
JoshHeng opened this issue ยท 4 comments
Describe the bug
When using the latest development build of ProtocolLib on PaperSpigot 1.19, I receive the following error:
20.06 22:25:15 [Server] INFO Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 6, Size: 5)
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:371) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:347) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.packets.WrapperPlayServerSpawnEntity.setObjectData(WrapperPlayServerSpawnEntity.java:358) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.block.BlockController.showPacketBlock(BlockController.java:308) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.block.BlockController.showAllPacketBlocks(BlockController.java:286) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.editor.EditorCommands.toggleEditor(EditorCommands.java:117) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.editor.EditorCommands.onCommand(EditorCommands.java:42) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO ... 17 more
Expected behavior
This should not error, as with previous versions of ProtocolLib in 1.18
Error Log
20.06 22:25:15 [Server] ERROR null
20.06 22:25:15 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'bh' in plugin BlockHunt v1.0
20.06 22:25:15 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:900) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2376) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$18(ServerGamePacketListenerImpl.java:2147) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1358) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:183) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1335) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1328) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1462) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]
20.06 22:25:15 [Server] INFO Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 6, Size: 5)
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:371) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:347) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.packets.WrapperPlayServerSpawnEntity.setObjectData(WrapperPlayServerSpawnEntity.java:358) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.block.BlockController.showPacketBlock(BlockController.java:308) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.block.BlockController.showAllPacketBlocks(BlockController.java:286) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.editor.EditorCommands.toggleEditor(EditorCommands.java:117) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at com.shockbyte.events.blockhunt.editor.EditorCommands.onCommand(EditorCommands.java:42) ~[block-hunt-1.0-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
20.06 22:25:15 [Server] INFO ... 17 more
20.06 22:25:15 [Server] ERROR Packet encoding of packet ID 48 threw (skippable? true)
20.06 22:25:15 [Server] INFO java.lang.NullPointerException: Cannot invoke "java.time.Instant.toEpochMilli()" because "instant" is null
20.06 22:25:15 [Server] INFO at net.minecraft.network.FriendlyByteBuf.writeInstant(FriendlyByteBuf.java:697) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.network.protocol.game.ClientboundPlayerChatPacket.write(ClientboundPlayerChatPacket.java:49) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:41) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:14) ~[paper-1.19.jar:git-Paper-28]
20.06 22:25:15 [Server] INFO at jdk.internal.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
20.06 22:25:15 [Server] INFO at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
20.06 22:25:15 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
20.06 22:25:15 [Server] INFO at com.viaversion.viaversion.util.PipelineUtil.callEncode(PipelineUtil.java:93) ~[ViaVersion-4.3.1.jar:?]
20.06 22:25:15 [Server] INFO at com.viaversion.viaversion.bukkit.handlers.BukkitEncodeHandler.encode(BukkitEncodeHandler.java:71) ~[ViaVersion-4.3.1.jar:?]
20.06 22:25:15 [Server] INFO at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at me.neznamy.tab.bridge.bukkit.BukkitBridge$CustomChannelDuplexHandler.write(BukkitBridge.java:177) ~[TAB-Bridge.v2.0.3.jar:?]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at com.interactiveboard.utility.nms.map.MapPacket_1_19_R1$1.write(MapPacket_1_19_R1.java:41) ~[InteractiveBoard.jar:?]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1020) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:311) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:227) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:233) ~[ProtocolLib.jar:?]
20.06 22:25:15 [Server] INFO at net.minecraft.network.Connection.doSendPacket(Connection.java:463) ~[?:?]
20.06 22:25:15 [Server] INFO at net.minecraft.network.Connection.lambda$writePacket$11(Connection.java:437) ~[?:?]
20.06 22:25:15 [Server] INFO at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391) ~[netty-transport-classes-epoll-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
20.06 22:25:15 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]
Version Info
The latest successful artifact from https://ci.dmulloy2.net/job/ProtocolLib/
Seems like the packet wrapper you're using is outdated (the official one is currently not receiving any updates). You need to update the wrapper yourself, according to the new field types in the packet.
If you need more information about field types you can take a look at https://protocol.derklaro.dev ;)