mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Wire up admin notification toggle
This commit is contained in:
parent
9fb9228869
commit
65a234c6b3
@ -1,8 +1,15 @@
|
||||
package com.gmail.nossr50.config.hocon.admin;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigAdmin {
|
||||
|
||||
@Setting(value = "Admin-Notifications", comment = "Settings related to admin alerts in mcMMO.")
|
||||
public ConfigAdminNotifications configAdminNotifications = new ConfigAdminNotifications();
|
||||
|
||||
public boolean isSendAdminNotifications() {
|
||||
return configAdminNotifications.isSendAdminNotifications();
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.gmail.nossr50.config.hocon.admin;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigAdminNotifications {
|
||||
private static final boolean SEND_ADMIN_NOTIFICATIONS_DEFAULT = true;
|
||||
|
||||
@Setting(value = "Send-Admin-Notifications", comment = "Send admins notifications about sensitive commands being executed" +
|
||||
"\nDefault value: "+ SEND_ADMIN_NOTIFICATIONS_DEFAULT)
|
||||
private boolean sendAdminNotifications = SEND_ADMIN_NOTIFICATIONS_DEFAULT;
|
||||
|
||||
public boolean isSendAdminNotifications() {
|
||||
return sendAdminNotifications;
|
||||
}
|
||||
}
|
@ -158,7 +158,7 @@ public class NotificationManager {
|
||||
*/
|
||||
private static void sendAdminNotification(String msg) {
|
||||
//If its not enabled exit
|
||||
if(!Config.getInstance().adminNotifications())
|
||||
if(!mcMMO.getConfigManager().getConfigAdmin().isSendAdminNotifications())
|
||||
return;
|
||||
|
||||
for(Player player : Bukkit.getServer().getOnlinePlayers())
|
||||
|
Loading…
Reference in New Issue
Block a user