add moodlight color config

This commit is contained in:
dank074 2022-03-23 03:15:25 -05:00
parent f81470f7ba
commit b668bfd99a
2 changed files with 4 additions and 1 deletions

View File

@ -80,3 +80,6 @@ ALTER TABLE `permissions` ADD COLUMN `acc_calendar_force` enum('0','1') NULL DEF
ALTER TABLE `permissions` ADD `cmd_update_calendar` ENUM('0', '1') NOT NULL DEFAULT '0';
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.description.cmd_update_calendar', ':update_calendar'), ('commands.keys.cmd_update_calendar', 'update_calendar');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.success.cmd_update_calendar', 'Calendar updated successfully!');
-- add moodlight configuration
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('moodlight.color_check.enabled', '1');

View File

@ -30,7 +30,7 @@ public class MoodLightSaveSettingsEvent extends MessageHandler {
int brightness = this.packet.readInt();
boolean apply = this.packet.readBoolean();
if (!MOODLIGHT_AVAILABLE_COLORS.contains(color)) {
if (Emulator.getConfig().getBoolean("moodlight.color_check.enabled", true) && !MOODLIGHT_AVAILABLE_COLORS.contains(color)) {
ScripterManager.scripterDetected(this.client, "User tried to set a moodlight to a non-whitelisted color: " + color);
return;
}