ProtocolLib

3M Downloads

1.16 Bug (COULD BE EASY TO FIX)

copyandexecute opened this issue ยท 2 comments

commented

Code:

    /**
     * Construct the packet listener that will be used to intercept every entity-related packet.
     *
     * @param plugin - the parent plugin.
     * @return The packet listener.
     */
    private PacketAdapter constructProtocol(Plugin plugin) {
        return new PacketAdapter(plugin, ENTITY_PACKETS) {
            @Override
            public void onPacketSending(PacketEvent event) {
                int entityID = event.getPacket().getIntegers().read(0);

                // See if this packet should be cancelled
                if (!isVisible(event.getPlayer(), entityID)) {
                    event.setCancelled(true);
                }
            }
        };
    }

Error

[1v1Plugin] Unhandled exception occured in onPacketSending(PacketEvent) for 1v1Plugin
com.comphenix.protocol.reflect.FieldAccessException: No field with type int exists in class PacketPlayOutPlayerInfo.
at com.comphenix.protocol.reflect.StructureModifier.readInternal(StructureModifier.java:216) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:195) ~[?:?]
at utils.EntityHider$2.onPacketSending(EntityHider.java:215) ~[?:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) ~[?:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:535) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:516) ~[?:?]
at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued(ProtocolInjector.java:334) ~[?:?]
at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending(ProtocolInjector.java:296) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector.processSending(ChannelInjector.java:382) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector.access$800(ChannelInjector.java:64) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.handleScheduled(ChannelInjector.java:347) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.onMessageScheduled(ChannelInjector.java:317) ~[?:?]
at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) ~[?:?]
at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) ~[?:?]
at net.minecraft.server.v1_16_R1.NetworkManager.b(NetworkManager.java:288) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.NetworkManager.dispatchPacket(NetworkManager.java:244) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.NetworkManager.sendPacket(NetworkManager.java:220) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1630) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.PlayerConnection.sendPacket(PlayerConnection.java:1603) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.PlayerList.postChunkLoadJoin(PlayerList.java:295) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.PlayerList.lambda$null$1(PlayerList.java:220) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.PlayerConnection.tick(PlayerConnection.java:150) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.NetworkManager.a(NetworkManager.java:373) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.ServerConnection.c(ServerConnection.java:142) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.MinecraftServer.b(MinecraftServer.java:1378) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.DedicatedServer.b(DedicatedServer.java:377) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1212) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1000) ~[patched_1.16.1.jar:git-Paper-74]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-74]
at java.lang.Thread.run(Thread.java:834) [?:?]
[19:13:48] [Server thread/ERROR]: Parameters:
net.minecraft.server.v1_16_R1.PacketPlayOutPlayerInfo@4af64c59[
a=ADD_PLAYER
b=[PlayerInfoData{latency=0, gameMode=SURVIVAL, profile=com.mojang.authlib.GameProfile@1fec2a64[id=26a4fcde-de39-4ff0-8ea1-786582b7d8ee,name=NoRiskk,properties={textures=[com.mojang.authlib.properties.Property@4041f8d0]},legacy=false], displayName={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"red","text":"NoRiskk"}],"text":""}}]
]

commented

Tracerblocker? I recognise that code haha

commented

PacketPlayOutPlayerInfo doesn't contain an int like you expect it to. It doesnt contain an entity id. It only contains the action enum and a playerinfodata array.

either special case this packet or exclude it from your packet handler.