ProtocolLib

3M Downloads

FieldAccessException: No field with type int exists in class PacketPlayOutEntityDestroy. after upgrade to 1.17.1

taka1945 opened this issue ยท 5 comments

commented

Describe the bug
after upgrade 1.17.1

To Reproduce
https://pastebin.com/PhPYX67k

Version Info
ProtocolLib v4.7.0-SNAPSHOT-b526

commented

Edit:
Changing PacketContainer#getIntegerArrays() to PacketContainer#getIntegers() fixed the error for me.


Previous error:
Similar error with the 1.17, also ProtocolLib v4.7.0-SNAPSHOT-b526

grafik

[lobby-1]java.lang.RuntimeException: FieldAccessException: No field with type [I exists in class PacketPlayOutEntityDestroy.
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.AbstractPacketEntity.delete(AbstractPacketEntity.java:78) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager.lambda$enable$0(PacketEntityManager.java:51) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager$$Lambda$4606/0x000000001d4cfb78.accept(Unknown Source) ~[?:?]
[lobby-1]ud >   at java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager.lambda$enable$1(PacketEntityManager.java:48) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager$$Lambda$4605/0x000000001d4cf8f8.accept(Unknown Source) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.collection.map.CoreMap.forEachValue(CoreMap.java:184) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager.lambda$enable$2(PacketEntityManager.java:42) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.PacketEntityManager$$Lambda$4274/0x000000001d4beab0.run(Unknown Source) ~[?:?]
[lobby-1]ud >   at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[PAPER_1_17.jar:git-Paper-"1cc41d0"]
[lobby-1]ud >   at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[PAPER_1_17.jar:git-Paper-"1cc41d0"]
[lobby-1]ud >   at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[PAPER_1_17.jar:git-Paper-"1cc41d0"]
[lobby-1]ud >   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
[lobby-1]ud >   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
[lobby-1]ud >   at java.lang.Thread.run(Unknown Source) [?:?]
[lobby-1]Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type [I exists in class PacketPlayOutEntityDestroy.
[lobby-1]ud >   at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:365) ~[?:?]
[lobby-1]ud >   at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:345) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.EntityTest.deletePacket(EntityTest.java:75) ~[?:?]
[lobby-1]ud >   at team.dotspace.core.spigot.hologram.v2.entity.AbstractPacketEntity.delete(AbstractPacketEntity.java:74) ~[?:?]
[lobby-1]ud >   ... 14 more
commented

@Day-Hawk are you sure that would fix the error?

It looks like you're using 1.17 and not 1.17.1, 1.17 uses ints, 1.17.1 uses IntList

So your fix is only correct for 1.17.0 and not 1.17.1 which is what the report is about.

commented

@libraryaddict I updated the server yesterday to 1.17.1. It worked without errors. Due to the high number of errors, I have decided to work again without ProtocolLib, because the "NMS" packages have changed.

commented

Added a modifier for the fastutil intlists: packet.getIntLists(); available in the latest dev build and repo snapshot

commented

For the destroy packet you can use something like this in 1.17.1:

        PacketContainer packet = e.getPacket();
        List<Integer> entityIdList = packet.getLists(new EquivalentConverter<Integer>() {
            @Override
            public Object getGeneric(Integer specific) {
                return specific;
            }

            @Override
            public Integer getSpecific(Object generic) {
                return (Integer) generic;
            }

            @Override
            public Class<Integer> getSpecificType() {
                return Integer.class;
            }
        }).read(0);