From d194d6baa24b9f0a17d0353efef875cb4a5eb020 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 2 Sep 2023 21:23:15 +0700 Subject: [PATCH] nice --- .../java/land/chipmunk/chipmunkmod/modules/SongPlayer.java | 6 ++++-- .../java/land/chipmunk/chipmunkmod/song/NBSConverter.java | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java b/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java index dcb644f..efac249 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java @@ -214,10 +214,10 @@ public class SongPlayer { while (currentSong.reachedNextNote()) { final Note note = currentSong.getNextNote(); - final float floatingPitch = MathUtilities.clamp((float) (0.5 * (Math.pow(2, ((note.pitch + (pitch / 10)) / 12)))), 0F, 2F); - try { if (!useCore && client.player != null) { + final float floatingPitch = (float) (0.5 * (Math.pow(2, ((note.pitch + (pitch / 10)) / 12)))); + final String[] thing = note.instrument.sound.split(":"); if (thing[1] == null) return; // idk if this can be null but ill just protect it for now i guess @@ -240,6 +240,8 @@ public class SongPlayer { clientConnectionAccessor.packetListener() ); } else { + final float floatingPitch = MathUtilities.clamp((float) (0.5 * (Math.pow(2, ((note.pitch + (pitch / 10)) / 12)))), 0F, 2F); + CommandCore.INSTANCE.run("execute as " + SELECTOR + " at @s run playsound " + note.instrument.sound + " record @s ~ ~ ~ " + note.volume + " " + floatingPitch); } } catch (Exception e) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/song/NBSConverter.java b/src/main/java/land/chipmunk/chipmunkmod/song/NBSConverter.java index a45d174..c78d962 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/song/NBSConverter.java +++ b/src/main/java/land/chipmunk/chipmunkmod/song/NBSConverter.java @@ -167,10 +167,6 @@ public class NBSConverter { key += customInstrument.pitch; } - if (key < 33 || key > 57) { - continue; - } - byte layerVolume = 100; if (nbsLayers.size() > note.layer) { layerVolume = nbsLayers.get(note.layer).volume;