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

54 lines
1.9 KiB
Java

package net.t2code.opsecurity.config.config;
import net.t2code.opsecurity.config.ConfigParam;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
public enum Config {
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),
kickCommand("Kick.Command", "minecraft:kick [player] [reason]", ConfigParam.STRING),
notifyJoinWarning("Notify.JoinWarn.Enable", true, ConfigParam.BOOLEAN),
notifySoundEnable("Notify.SoundEnable", true, ConfigParam.BOOLEAN),
notifySoundValue("Notify.SoundEnable", sound(), ConfigParam.SOUND);
public String path;
public String valueString;
public Integer valueInt;
public Boolean valueBoolean;
public ConfigParam cEnum;
Config(String path, String value, ConfigParam cEnum) {
this.path = path;
this.valueString = value;
this.cEnum = cEnum;
}
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;
}
public static String sound(){
if (T2CmcVersion.isMc1_8()){
return "NOTE_PIANO";
} else if (T2CmcVersion.isMc1_9()||T2CmcVersion.isMc1_10()||T2CmcVersion.isMc1_11()||T2CmcVersion.isMc1_12()){
return "BLOCK_NOTE_HARP";
} else return "BLOCK_NOTE_BLOCK_HARP";
}
}