mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Fix moodlight saving false-positive scripter detection
This commit is contained in:
parent
b3a88c7d10
commit
eb7c7a5498
@ -14,6 +14,7 @@ import java.util.List;
|
||||
|
||||
public class MoodLightSaveSettingsEvent extends MessageHandler {
|
||||
public static List<String> MOODLIGHT_AVAILABLE_COLORS = Arrays.asList("#74F5F5,#0053F7,#E759DE,#EA4532,#F2F851,#82F349,#000000".split(","));
|
||||
public static int MIN_BRIGHTNESS = (int) Math.floor(0.3 * 0xFF);
|
||||
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
@ -33,7 +34,7 @@ public class MoodLightSaveSettingsEvent extends MessageHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (brightness > 0xFF || brightness < (0.3 * 0xFF)) {
|
||||
if (brightness > 0xFF || brightness < MIN_BRIGHTNESS) {
|
||||
ScripterManager.scripterDetected(this.client, "User tried to set a moodlight's brightness to out-of-bounds ([76, 255]): " + brightness);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user