9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 01:49:30 +00:00

fix(network): 改进声音事件处理

This commit is contained in:
jhqwqmc
2025-04-10 02:40:33 +08:00
parent 55b0bee275
commit 9318034e99
2 changed files with 2 additions and 4 deletions

View File

@@ -1620,9 +1620,7 @@ public class PacketConsumers {
buf.writeVarInt(event.packetID());
buf.writeVarInt(0);
Object newId = KeyUtils.toResourceLocation(mapped);
Object newSoundEvent = VersionHelper.isVersionNewerThan1_21_2() ?
Reflections.constructor$SoundEvent.newInstance(newId, Reflections.field$SoundEvent$fixedRange.get(soundEvent)) :
Reflections.constructor$SoundEvent.newInstance(newId, Reflections.field$SoundEvent$range.get(soundEvent), Reflections.field$SoundEvent$newSystem.get(soundEvent));
Object newSoundEvent = FastNMS.INSTANCE.constructor$SoundEvent(newId, FastNMS.INSTANCE.method$SoundEvent$fixedRange(soundEvent));
FastNMS.INSTANCE.method$SoundEvent$directEncode(buf, newSoundEvent);
buf.writeVarInt(source);
buf.writeInt(x);

View File

@@ -51,7 +51,7 @@ byte_buddy_version=1.17.5
ahocorasick_version=0.6.3
snake_yaml_version=2.4
anti_grief_version=0.13
nms_helper_version=0.52
nms_helper_version=0.53
# Ignite Dependencies
mixinextras_version=0.4.1
mixin_version=0.15.2+mixin.0.8.7