kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics from 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
161 stars 69 forks source link

1.19.3 missing sound packet field #631

Closed thiagogebrimm closed 1 year ago

thiagogebrimm commented 1 year ago
[02:00:08 WARN]: [OldCombatMechanics] Error detecting sound packets. Please report it along with the following exception on github.
java.lang.ExceptionInInitializerError: null
        at kernitus.plugin.OldCombatMechanics.utilities.packet.sound.SoundPacket.getSoundName(SoundPacket.java:27) ~[OldCombatMechanics.jar:?]
        at kernitus.plugin.OldCombatMechanics.module.ModuleAttackSounds$SoundListener.lambda$onPacketSend$0(ModuleAttackSounds.java:79) ~[OldCombatMechanics.jar:?]
        at java.util.Optional.filter(Optional.java:218) ~[?:?]
        at kernitus.plugin.OldCombatMechanics.module.ModuleAttackSounds$SoundListener.onPacketSend(ModuleAttackSounds.java:79) ~[OldCombatMechanics.jar:?]
        at kernitus.plugin.OldCombatMechanics.utilities.packet.mitm.PacketInjector.write(PacketInjector.java:187) ~[OldCombatMechanics.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1020) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:311) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
        at com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:227) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:233) ~[ProtocolLib.jar:?]
        at net.minecraft.network.Connection.doSendPacket(Connection.java:459) ~[?:?]
        at net.minecraft.network.Connection.lambda$sendPacket$11(Connection.java:433) ~[?:?]
        at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.lambda$proxyRunnable$2(NettyEventLoopProxy.java:48) ~[ProtocolLib.jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403) ~[netty-transport-classes-epoll-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.RuntimeException: Field with type SoundEffect not found
        at kernitus.plugin.OldCombatMechanics.utilities.reflection.Reflector.getFieldByType(Reflector.java:159) ~[OldCombatMechanics.jar:?]
        at kernitus.plugin.OldCombatMechanics.utilities.packet.sound.SoundPacket$PacketAccess.<clinit>(SoundPacket.java:55) ~[OldCombatMechanics.jar:?]
        ... 23 more
kernitus commented 1 year ago

@I-Al-Istannen did the field names change or did we miss something in 1.19.3?

I-Al-Istannen commented 1 year ago

The type changed.

https://nms.screamingsandals.org/1.19.2/net/minecraft/network/protocol/game/ClientboundSoundPacket.html https://nms.screamingsandals.org/1.19.3/net/minecraft/network/protocol/game/ClientboundSoundPacket.html

kernitus commented 1 year ago

@I-Al-Istannen That's annoying. Do we have to update the code to handle that? I would have though the code wouldn't change much between patch versions.

kernitus commented 1 year ago

@thiagogebrimm Can you check if the issue is still present with test build 134 or above?