From b4039a5965d1b4a92e246d5b99d29b8fbb48c0a8 Mon Sep 17 00:00:00 2001 From: Chip <65827213+ChipmunkMC@users.noreply.github.com> Date: Sat, 25 Feb 2023 13:43:14 -0500 Subject: [PATCH] nomusic --- .../java/land/chipmunk/chipmunkbot/plugins/SongPlayer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkbot/plugins/SongPlayer.java b/src/main/java/land/chipmunk/chipmunkbot/plugins/SongPlayer.java index 81f6fe8..1978201 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/plugins/SongPlayer.java +++ b/src/main/java/land/chipmunk/chipmunkbot/plugins/SongPlayer.java @@ -20,6 +20,7 @@ import java.util.LinkedList; public class SongPlayer extends SessionAdapter { private final ChipmunkBot client; + public static final String SELECTOR = "@a[tag=!nomusic,tag=!chipmunkbot_nomusic]"; public static File SONG_DIR = new File("songs"); static { if (!SONG_DIR.exists()) { @@ -85,7 +86,7 @@ public class SongPlayer extends SessionAdapter { if (currentSong.paused && ticksUntilPausedActionbar-- < 0) return; else ticksUntilPausedActionbar = 20; - client.core().run("title @a actionbar " + GsonComponentSerializer.gson().serialize(generateActionbar())); + client.core().run("title " + SELECTOR + " actionbar " + GsonComponentSerializer.gson().serialize(generateActionbar())); if (currentSong.paused) return; @@ -164,7 +165,7 @@ public class SongPlayer extends SessionAdapter { final double floatingPitch = Math.pow(2, (note.pitch - 12) / 12.0); - client.core().run("execute as @a at @s run playsound " + note.instrument.sound + " record @s ~ ~ ~ " + note.volume + " " + floatingPitch); + client.core().run("execute as " + SELECTOR + " at @s run playsound " + note.instrument.sound + " record @s ~ ~ ~ " + note.volume + " " + floatingPitch); } } }