This commit is contained in:
Chayapak 2023-09-02 21:23:15 +07:00
parent 5cf5163d75
commit d194d6baa2
2 changed files with 4 additions and 6 deletions

View file

@ -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) {

View file

@ -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;