retrooper / packetevents

Precision meets performance—a powerful tool for mastering Minecraft packet manipulation with speed and finesse.
GNU General Public License v3.0
557 stars 151 forks source link

ArrayIndexOutOfBoundsException Velocity 1.21.1 #985

Closed HydrolienF closed 2 months ago

HydrolienF commented 2 months ago

Describe the bug Console display an ArrayIndexOutOfBoundsException from this plugin.

Software brand It's on Velocity 3.3.0 (424) and I'm joining with a vanilla client 1.21.1

Plugins

How To Reproduce Steps to reproduce the behavior: Example:

  1. Join with the 1.21.1 vanilla minecraft client.
  2. Wait long enoth (I haven't find what cause it exactly)
  3. See error

Expected behavior I don't think it fail to do something important, but it would be better not to have unhandled exception

Screenshots

Additional context Full exception log

[20:30:44 WARN] [com.github.retrooper.packetevents.PacketEventsAPI]: PacketEvents caught an unhandled exception while calling your listener.
java.lang.ArrayIndexOutOfBoundsException: Index 107 out of bounds for length 3
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readEnum(PacketWrapper.java:1471) ~[?:?]
        at com.github.retrooper.packetevents.protocol.component.builtin.item.ItemAttributeModifiers$Modifier.read(ItemAttributeModifiers.java:187) ~[?:?]
        at com.github.retrooper.packetevents.protocol.component.builtin.item.ItemAttributeModifiers$ModifierEntry.read(ItemAttributeModifiers.java:113) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readCollection(PacketWrapper.java:1426) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readList(PacketWrapper.java:1439) ~[?:?]
        at com.github.retrooper.packetevents.protocol.component.builtin.item.ItemAttributeModifiers.read(ItemAttributeModifiers.java:50) ~[?:?]
        at com.github.retrooper.packetevents.protocol.component.ComponentTypes$1.read(ComponentTypes.java:88) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readItemStackModern(PacketWrapper.java:477) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readItemStack(PacketWrapper.java:496) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readEntityMetadata(PacketWrapper.java:956) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata.read(WrapperPlayServerEntityMetadata.java:52) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.readEvent(PacketWrapper.java:270) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.<init>(PacketWrapper.java:175) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.PacketWrapper.<init>(PacketWrapper.java:165) ~[?:?]
        at com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata.<init>(WrapperPlayServerEntityMetadata.java:36) ~[?:?]
        at com.deathmotion.antihealthindicator.packetlisteners.spoofers.EntityMetadataListener.onPacketSend(EntityMetadataListener.java:74) ~[?:?]
        at com.github.retrooper.packetevents.event.PacketSendEvent.call(PacketSendEvent.java:51) ~[?:?]
        at com.github.retrooper.packetevents.event.EventManager.callEvent(EventManager.java:52) ~[?:?]
        at io.github.retrooper.packetevents.handlers.PacketEventsEncoder.read(PacketEventsEncoder.java:46) ~[?:?]
        at io.github.retrooper.packetevents.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:70) ~[?:?]
        at io.github.retrooper.packetevents.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:32) ~[?:?]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannel.write(AbstractChannel.java:301) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.connection.MinecraftConnection.delayedWrite(MinecraftConnection.java:248) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler.handleUnknown(BackendPlaySessionHandler.java:458) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.connection.MinecraftConnection.channelRead(MinecraftConnection.java:160) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.protocol.netty.AutoReadHolderHandler.channelRead(AutoReadHolderHandler.java:57) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:77) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:60) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.3.0-SNAPSHOT-424.jar:3.3.0-SNAPSHOT (git-862036d4-b424)]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
HydrolienF commented 2 months ago

I find when it happens, I have custom projectiles on the server. The Exception is throw if a player throw a custom projectil and again when a player pick up the projectil. The custom projectil is an arrow with a custom texture.

Bram1903 commented 2 months ago

@HydrolienF, just to be sure, could you install the latest development build, and see if the error still occurs?

https://ci.codemc.io/job/retrooper/job/packetevents/lastSuccessfulBuild/artifact/velocity/build/libs/packetevents-velocity-2.5.0-SNAPSHOT.jar

booky10 commented 2 months ago

this is fixed in the latest builds, see comment above

HydrolienF commented 2 months ago

Ok thanks

HydrolienF commented 2 months ago

@Bram1903 I don't have the error anymore with this build. Thanks