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

Velocity - Multiple errors with client on version 1.16.1 #1020

Closed Elikill58 closed 3 weeks ago

Elikill58 commented 1 month ago

Describe the bug Trying to read EntityMetadata packet with version 1.16.1 create bug

Software brand Using Velocity 3.3.0-SNAPSHOT

Plugins

How To Reproduce Listen for packet Events, and try to read packet WrapperPlayServerEntityMetadata. One error appear on join, the other when reading this packet.

Globally, this code:

@Subscribe(order = PostOrder.LATE)
public void onProxyInitialize(ProxyInitializeEvent event) {
    PacketEvents.setAPI(VelocityPacketEventsBuilder.build(getServer(), getContainer(), getLogger(), dataDirectory));
    PacketEvents.getAPI().load();
    PacketEvents.getAPI().getEventManager().registerListener(new MyListener());
}

My listener:

public class MyListener extends PacketListenerAbstract {

    @Override
    public void onPacketSend(PacketSendEvent e) {
        PacketTypeCommon packetType = e.getPacketType();
        if (packetType.equals(Server.ENTITY_METADATA)) {
            WrapperPlayServerEntityMetadata wrapper = new WrapperPlayServerEntityMetadata(e);
        }
    }
}

THEN login with 1.16/1.16.1 client and you will see below errors.

Expected behavior No error.

Logs Error on join:

PacketEvents caught an unhandled exception while calling your listener.
java.lang.ClassCastException: class com.elikill58.deps.packetevents.api.protocol.nbt.NBTList cannot be cast to class com.elikill58.deps.packetevents.api.protocol.nbt.NBTCompound (com.elikill58.deps.packetevents.api.protocol.nbt.NBTList and com.elikill58.deps.packetevents.api.protocol.nbt.NBTCompound are in unnamed module of loader com.velocitypowered.proxy.plugin.PluginClassLoader @78e89bfe)
    at com.elikill58.deps.packetevents.api.util.mappings.SynchronizedRegistriesHandler.handleLegacyRegistries(SynchronizedRegistriesHandler.java:124) ~[?:?]
    at com.elikill58.deps.packetevents.api.manager.InternalPacketListener.onPacketSend(InternalPacketListener.java:105) ~[?:?]
    at com.elikill58.deps.packetevents.api.event.PacketSendEvent.call(PacketSendEvent.java:51) ~[?:?]
    at com.elikill58.deps.packetevents.api.event.EventManager.callEvent(EventManager.java:84) ~[?:?]
    at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.read(PacketEventsEncoder.java:46) ~[?:?]
    at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:70) ~[?:?]
    at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:32) ~[?:?]
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:113) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.AbstractChannel.write(AbstractChannel.java:301) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at com.velocitypowered.proxy.connection.MinecraftConnection.delayedWrite(MinecraftConnection.java:248) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler.handleBackendJoinGame(ClientPlaySessionHandler.java:552) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at com.velocitypowered.proxy.connection.backend.TransitionSessionHandler.lambda$handle$0(TransitionSessionHandler.java:133) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:787) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
    at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

Error when using WrapperPlayServerEntityMetadata wrapper = new WrapperPlayServerEntityMetadata(event):

PacketEvents caught an unhandled exception while calling your listener.
java.lang.IllegalStateException: Unknown entity metadata type id: 102 version V_1_16_1
        at com.elikill58.deps.packetevents.api.wrapper.PacketWrapper.readEntityMetadata(PacketWrapper.java:968) ~[?:?]
        at com.elikill58.deps.packetevents.api.wrapper.play.server.WrapperPlayServerEntityMetadata.read(WrapperPlayServerEntityMetadata.java:52) ~[?:?]
        at com.elikill58.deps.packetevents.api.wrapper.PacketWrapper.readEvent(PacketWrapper.java:276) ~[?:?]
        at com.elikill58.deps.packetevents.api.wrapper.PacketWrapper.<init>(PacketWrapper.java:181) ~[?:?]
        at com.elikill58.deps.packetevents.api.wrapper.PacketWrapper.<init>(PacketWrapper.java:171) ~[?:?]
        at com.elikill58.deps.packetevents.api.wrapper.play.server.WrapperPlayServerEntityMetadata.<init>(WrapperPlayServerEntityMetadata.java:36) ~[?:?]
        at fr.arkemis.api.velocity.listeners.HologramPacketListener.onPacketSend(HologramPacketListener.java:49) ~[?:?]
        at com.elikill58.deps.packetevents.api.event.PacketSendEvent.call(PacketSendEvent.java:51) ~[?:?]
        at com.elikill58.deps.packetevents.api.event.EventManager.callEvent(EventManager.java:84) ~[?:?]
        at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.read(PacketEventsEncoder.java:46) ~[?:?]
        at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:70) ~[?:?]
        at com.elikill58.deps.packetevents.impl.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:32) ~[?:?]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannel.write(AbstractChannel.java:301) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.connection.MinecraftConnection.delayedWrite(MinecraftConnection.java:248) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.connection.backend.BackendPlaySessionHandler.handleUnknown(BackendPlaySessionHandler.java:458) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.connection.MinecraftConnection.channelRead(MinecraftConnection.java:160) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.protocol.netty.AutoReadHolderHandler.channelRead(AutoReadHolderHandler.java:57) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:77) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:60) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.3.0-SNAPSHOT-416.jar:3.3.0-SNAPSHOT (git-6100e675-b416)]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
MemencioPerez commented 1 month ago

I have tried the most recent version of PacketEvents and have seen the first error you mention. I have used a toString method to see the content of the NBTList, I leave it here in case you are interested.

1st type: [10:34:54] [Netty epoll Worker #2/INFO] [com.velocitypowered.proxy.console.VelocityConsole]: Debugging gabriel33 registry tags: Expected: NBTCompound, found: NBTList, data: List([Compound{{piglin_safe=Byte(0), natural=Byte(1), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_overworld), respawn_anchor_works=Byte(0), has_skylight=Byte(1), bed_works=Byte(1), name=String(minecraft:overworld), has_raids=Byte(1), logical_height=Int(256), shrunk=Byte(0), has_ceiling=Byte(0), ultrawarm=Byte(0)}}, Compound{{piglin_safe=Byte(0), natural=Byte(1), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_overworld), respawn_anchor_works=Byte(0), has_skylight=Byte(1), bed_works=Byte(1), name=String(minecraft:overworld_caves), has_raids=Byte(1), logical_height=Int(256), shrunk=Byte(0), has_ceiling=Byte(1), ultrawarm=Byte(0)}}, Compound{{piglin_safe=Byte(1), natural=Byte(0), ambient_light=Float(0.1), infiniburn=String(minecraft:infiniburn_nether), respawn_anchor_works=Byte(1), has_skylight=Byte(0), bed_works=Byte(0), fixed_time=Long(18000), has_raids=Byte(0), name=String(minecraft:the_nether), logical_height=Int(128), shrunk=Byte(1), ultrawarm=Byte(1), has_ceiling=Byte(1)}}, Compound{{piglin_safe=Byte(0), natural=Byte(0), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_end), respawn_anchor_works=Byte(0), has_skylight=Byte(0), bed_works=Byte(0), fixed_time=Long(6000), has_raids=Byte(1), name=String(minecraft:the_end), logical_height=Int(256), shrunk=Byte(0), ultrawarm=Byte(0), has_ceiling=Byte(0)}}])

2nd type: [10:35:19] [Netty epoll Worker #2/INFO] [com.velocitypowered.proxy.console.VelocityConsole]: Debugging gabriel33 registry tags: Expected: NBTCompound, found: NBTList, data: List([Compound{{piglin_safe=Byte(0), natural=Byte(1), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_overworld), respawn_anchor_works=Byte(0), has_skylight=Byte(1), bed_works=Byte(1), effects=String(minecraft:overworld), has_raids=Byte(1), name=String(minecraft:overworld), logical_height=Int(256), coordinate_scale=Double(1.0), shrunk=Byte(0), min_y=Int(-64), ultrawarm=Byte(0), has_ceiling=Byte(0), height=Int(256)}}, Compound{{piglin_safe=Byte(0), natural=Byte(1), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_overworld), respawn_anchor_works=Byte(0), has_skylight=Byte(1), bed_works=Byte(1), effects=String(minecraft:overworld), has_raids=Byte(1), name=String(minecraft:overworld_caves), logical_height=Int(256), coordinate_scale=Double(1.0), shrunk=Byte(0), min_y=Int(-64), ultrawarm=Byte(0), has_ceiling=Byte(1), height=Int(256)}}, Compound{{piglin_safe=Byte(1), natural=Byte(0), ambient_light=Float(0.1), infiniburn=String(minecraft:infiniburn_nether), respawn_anchor_works=Byte(1), has_skylight=Byte(0), bed_works=Byte(0), effects=String(minecraft:the_nether), fixed_time=Long(18000), has_raids=Byte(0), name=String(minecraft:the_nether), logical_height=Int(128), coordinate_scale=Double(8.0), shrunk=Byte(1), min_y=Int(0), ultrawarm=Byte(1), has_ceiling=Byte(1), height=Int(256)}}, Compound{{piglin_safe=Byte(0), natural=Byte(0), ambient_light=Float(0.0), infiniburn=String(minecraft:infiniburn_end), respawn_anchor_works=Byte(0), has_skylight=Byte(0), bed_works=Byte(0), effects=String(minecraft:the_end), fixed_time=Long(6000), has_raids=Byte(1), name=String(minecraft:the_end), logical_height=Int(256), coordinate_scale=Double(1.0), shrunk=Byte(0), min_y=Int(0), ultrawarm=Byte(0), has_ceiling=Byte(0), height=Int(256)}}])

retrooper commented 4 weeks ago

Don't forget to call the init() function after calling load() on PacketEvents. On proxy you can just skip load, and call init() as init calls load if not done yet.

retrooper commented 4 weeks ago

Working on the issue!

retrooper commented 4 weeks ago

Test this fix: https://github.com/retrooper/packetevents/commit/5247ccd12941421a0691fe94afc91821073de99b

MemencioPerez commented 3 weeks ago

I have been using dev build https://github.com/retrooper/packetevents/commit/5247ccd12941421a0691fe94afc91821073de99b for a week and have not seen that error again 👍