T2C-OPSecurity/OpSecurity V3/src/main/java/net/t2code/opsecurity/config/config/Config.java

65 lines
2.3 KiB
Java
Raw Normal View History

2022-11-03 01:29:26 +00:00
package net.t2code.opsecurity.config.config;
2022-11-03 18:15:07 +00:00
import net.t2code.opsecurity.enums.ConfigParam;
2022-11-03 01:29:26 +00:00
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
2022-11-03 18:15:07 +00:00
import org.bukkit.Sound;
2022-11-03 01:29:26 +00:00
public enum Config {
2022-11-03 18:15:07 +00:00
language("plugin.language", "english", ConfigParam.STRING),
onlyOPcanUseThePlugin("plugin.onlyOPcanUseThePlugin", true, ConfigParam.BOOLEAN),
checkOnJoin("check.onJoin", true, ConfigParam.BOOLEAN),
checkOnInteract("check.onInteract", true, ConfigParam.BOOLEAN),
checkOnCommand("check.onCommand", true, ConfigParam.BOOLEAN),
checkOnChat("check.onChat", true, ConfigParam.BOOLEAN),
checkTimerEnable("check.timer.enable", true, ConfigParam.BOOLEAN),
checkTimerRefreshInSec("check.timer.refreshInSec", 60, ConfigParam.INTEGER),
kickCustomCommand("kick.customCommand.Enable", false, ConfigParam.BOOLEAN),
kickCommand("kick.customCommand.command", "minecraft:kick [player] [reason]", ConfigParam.STRING),
2022-11-03 18:15:07 +00:00
notifyJoinWarning("notify.joinWarn.enable", true, ConfigParam.BOOLEAN),
notifyBungee("notify.allBungeePlayer.enable", false, ConfigParam.BOOLEAN),
notifySoundEnable("notify.soundEnable", true, ConfigParam.BOOLEAN),
notifySoundValue("notify.sound", sound(), ConfigParam.SOUND);
2022-11-03 01:29:26 +00:00
public String path;
public String valueString;
public Integer valueInt;
public Boolean valueBoolean;
2022-11-03 18:15:07 +00:00
public Sound sound;
2022-11-03 01:29:26 +00:00
public ConfigParam cEnum;
Config(String path, String value, ConfigParam cEnum) {
this.path = path;
this.valueString = value;
this.cEnum = cEnum;
}
2022-11-03 18:15:07 +00:00
Config(String path, Sound value, ConfigParam cEnum) {
this.path = path;
this.sound = value;
this.cEnum = cEnum;
}
2022-11-03 01:29:26 +00:00
Config(String path, Integer value, ConfigParam cEnum) {
this.path = path;
this.valueInt = value;
this.cEnum = cEnum;
}
Config(String path, Boolean value, ConfigParam cEnum) {
this.path = path;
this.valueBoolean = value;
this.cEnum = cEnum;
}
2022-11-03 18:15:07 +00:00
public static Sound sound() {
if (T2CmcVersion.isMc1_8()) {
return Sound.valueOf("NOTE_PIANO");
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
return Sound.valueOf("BLOCK_NOTE_HARP");
} else return Sound.valueOf("BLOCK_NOTE_BLOCK_HARP");
2022-11-03 01:29:26 +00:00
}
}