From 90bb05a4c573db628af9ed444f094a2de8af0847 Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Tue, 19 May 2020 11:00:06 +0200 Subject: [PATCH] Fixed brightness 0 issues --- src/me/mctp/MCTPAudioCmd.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/me/mctp/MCTPAudioCmd.java b/src/me/mctp/MCTPAudioCmd.java index 0664f0f..3a91b28 100644 --- a/src/me/mctp/MCTPAudioCmd.java +++ b/src/me/mctp/MCTPAudioCmd.java @@ -79,7 +79,7 @@ public class MCTPAudioCmd implements CommandExecutor { return true; } - int brightness = 0; + Integer brightness = null; if (args.length == 7) { try { brightness = Integer.parseInt(args[6]); @@ -88,7 +88,7 @@ public class MCTPAudioCmd implements CommandExecutor { return true; } - if (brightness < 0 || brightness > 255) { + if (brightness < 0 || brightness > 254) { sender.sendMessage(prefix + args[6] + " is geen correcte brightness."); return true; } @@ -125,7 +125,7 @@ public class MCTPAudioCmd implements CommandExecutor { data.put("task", "HUE"); data.put("rgb", r + ":" + g + ":" + b); data.put("type", type.name()); - if (brightness != 0) data.put("brightness", brightness); + if (brightness != null) data.put("brightness", brightness); data.put("uuid", p.getUniqueId().toString().replace("-", "")); Main.getClient().sendData(data); }