From 4537aaf3394eeb593754ff05b26bc7d96f932974 Mon Sep 17 00:00:00 2001 From: Nassim <28825609+KennyTV@users.noreply.github.com> Date: Thu, 26 Sep 2019 20:46:48 +0200 Subject: [PATCH] Fix some sound rewrites (#1462) Resolves #1434 --- .../Protocol1_11To1_10.java | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java index 9fb7345c1..3d1ef411c 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java @@ -378,34 +378,33 @@ public class Protocol1_11To1_10 extends Protocol { }); } - private int getNewSoundId(int id) { //TODO Make it better, suggestions are welcome. It's ugly and hardcoded now. + private int getNewSoundId(int id) { if (id == 196) // Experience orb sound got removed return -1; - int newId = id; - if (id >= 85) // Hello shulker boxes - newId += 2; - if (id >= 174) // Hello Guardian flop - newId += 1; - if (id >= 194) // Hello evocation things - newId += 8; + if (id >= 85) // Shulker boxes + id += 2; + if (id >= 176) // Guardian flop + id += 1; + if (id >= 197) // evocation things + id += 8; if (id >= 196) // Rip the Experience orb touch sound :'( - newId -= 1; - if (id >= 269) // Hello Liama's - newId += 9; - if (id >= 277) // Hello Mule chest - newId += 1; - if (id >= 370) // Hello Vex - newId += 4; - if (id >= 376) // Hello vindication - newId += 3; - if (id >= 423) // Equip Elytra - newId += 1; - if (id >= 427) // Hello empty bottle - newId += 1; - if (id >= 441) // Hello item totem use - newId += 1; - return newId; + id -= 1; + if (id >= 279) // Liama's + id += 9; + if (id >= 296) // Mule chest + id += 1; + if (id >= 390) // Vex + id += 4; + if (id >= 400) // vindication + id += 3; + if (id >= 450) // Elytra + id += 1; + if (id >= 455) // Empty bottle + id += 1; + if (id >= 470) // Totem use + id += 1; + return id; }