mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
add moodlight color config
This commit is contained in:
parent
f81470f7ba
commit
b668bfd99a
@ -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';
|
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.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!');
|
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');
|
@ -30,7 +30,7 @@ public class MoodLightSaveSettingsEvent extends MessageHandler {
|
|||||||
int brightness = this.packet.readInt();
|
int brightness = this.packet.readInt();
|
||||||
boolean apply = this.packet.readBoolean();
|
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);
|
ScripterManager.scripterDetected(this.client, "User tried to set a moodlight to a non-whitelisted color: " + color);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user