summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-03-31 11:34:47 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-03-31 11:34:47 +0100
commit45bb40353aac654c7861a41c5ddbe0f8d781a4fb (patch)
treed013f12e1c849b76761386bb5cd24540538e1c35 /nms-patches
parent8b61cc52088ccb9220970740a4905baf3781a680 (diff)
downloadcraftbukkit-45bb40353aac654c7861a41c5ddbe0f8d781a4fb.tar
craftbukkit-45bb40353aac654c7861a41c5ddbe0f8d781a4fb.tar.gz
craftbukkit-45bb40353aac654c7861a41c5ddbe0f8d781a4fb.tar.lz
craftbukkit-45bb40353aac654c7861a41c5ddbe0f8d781a4fb.tar.xz
craftbukkit-45bb40353aac654c7861a41c5ddbe0f8d781a4fb.zip
SPIGOT-2098: Fix sound effects for 1.9.0 clients
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PacketPlayOutNamedSoundEffect.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/nms-patches/PacketPlayOutNamedSoundEffect.patch b/nms-patches/PacketPlayOutNamedSoundEffect.patch
new file mode 100644
index 00000000..207de38a
--- /dev/null
+++ b/nms-patches/PacketPlayOutNamedSoundEffect.patch
@@ -0,0 +1,21 @@
+--- a/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
++++ b/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
+@@ -38,7 +38,17 @@
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+- packetdataserializer.d(SoundEffect.a.a((Object) this.a));
++ // CraftBukkit start
++ if (packetdataserializer.version > 107) {
++ packetdataserializer.d(SoundEffect.a.a(this.a));
++ } else {
++ int id = SoundEffect.a.a(this.a);
++ if (id >= SoundEffect.a.a(SoundEffect.a.get(new MinecraftKey("item.elytra.flying")))) {
++ id--;
++ }
++ packetdataserializer.d(id);
++ }
++ // CraftBukkit end
+ packetdataserializer.a((Enum) this.b);
+ packetdataserializer.writeInt(this.c);
+ packetdataserializer.writeInt(this.d);