fix: patch negative music values causing unexpected behavior

This commit is contained in:
ChomeNS
2025-04-14 08:22:32 +07:00
parent 26ca1eb830
commit b7807686d0
2 changed files with 3 additions and 1 deletions

View File

@@ -439,6 +439,7 @@ public class MusicCommand extends Command {
final float speed = context.getFloat(true, false);
if (speed > 5) throw new CommandException(Component.text("Too fast!"));
else if (speed < 0) throw new CommandException(Component.text("Invalid speed"));
long oldTime = -1;
@@ -477,6 +478,7 @@ public class MusicCommand extends Command {
final int amplify = context.getInteger(true);
if (amplify > 8) throw new CommandException(Component.text("Too big value"));
else if (amplify < 0) throw new CommandException(Component.text("Invalid amplification value"));
bot.music.amplify = amplify;