Merge branch 'patch/moodlight-color-config' into 'dev'

add moodlight color config

See merge request morningstar/Arcturus-Community!510
This commit is contained in:
ArpyAge 2022-03-23 18:01:27 +00:00
commit 9608d6cec2
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;
}