Bugfix:
- In Permission Whitelist, the customCommands function did not work as expected.
This commit is contained in:
JaTiTV 2022-11-17 21:07:15 +01:00
parent 466314f206
commit 43e51fee59
4 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2C-OPSecurity</artifactId> <artifactId>T2C-OPSecurity</artifactId>
<version>3.0.3</version> <version>3.0.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@ -47,7 +47,7 @@ public class PermissionCheck {
T2Csend.console(Language.permissionWhitelistNotifyKick.value.replace("[player]", T2Csend.console(Language.permissionWhitelistNotifyKick.value.replace("[player]",
player.getName()).replace("[perm]", perm).replace("[uuid]",String.valueOf(player.getUniqueId()))); player.getName()).replace("[perm]", perm).replace("[uuid]",String.valueOf(player.getUniqueId())));
} }
if (PermissionWhitelist.customCommandsCommands.valueBoolean) { if (PermissionWhitelist.customCommandsEnable.valueBoolean) {
for (String cmd : PermissionWhitelist.customCommandsCommands.valueStringList) { for (String cmd : PermissionWhitelist.customCommandsCommands.valueStringList) {
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[perm]", perm)); T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[perm]", perm));
} }

View File

@ -24,12 +24,12 @@ public class FileSelect {
File config = new File(Main.getPath(), "config.yml"); File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config); YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
for (Config value : Config.values()) { for (Config value : Config.values()) {
switch (value.cEnum) { switch (value.configParam) {
case STRING: case STRING:
if (!yamlConfiguration.contains(value.path)) { if (!yamlConfiguration.contains(value.path)) {
yamlConfiguration.set(value.path, value.valueString); yamlConfiguration.set(value.path, value.valueString);
} }
value.valueString = T2Creplace.replace(Util.getPrefix(), yamlConfiguration.getString(value.path)); value.valueString = T2Creplace.replace(Util.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(value.path)));
break; break;
case SOUND: case SOUND:
if (!yamlConfiguration.contains(value.path)) { if (!yamlConfiguration.contains(value.path)) {
@ -143,7 +143,7 @@ public class FileSelect {
String name = yamlConfiguration.getString(value.pathPlayerName.replace("KEY", key)); String name = yamlConfiguration.getString(value.pathPlayerName.replace("KEY", key));
PlayerObject playerObject = new PlayerObject( PlayerObject playerObject = new PlayerObject(
name, name,
yamlConfiguration.getString(value.pathPlayerUuid.replace("KEY", key).replace("-", ""))); yamlConfiguration.getString(value.pathPlayerUuid.replace("KEY", key)).replace("-", ""));
PlayerCash.getOpHashMap().put(name, playerObject); PlayerCash.getOpHashMap().put(name, playerObject);
} }
break; break;

View File

@ -31,30 +31,30 @@ public enum Config {
public Integer valueInt; public Integer valueInt;
public Boolean valueBoolean; public Boolean valueBoolean;
public Sound sound; public Sound sound;
public ConfigParam cEnum; public ConfigParam configParam;
Config(String path, String value, ConfigParam cEnum) { Config(String path, String value, ConfigParam cEnum) {
this.path = path; this.path = path;
this.valueString = value; this.valueString = value;
this.cEnum = cEnum; this.configParam = cEnum;
} }
Config(String path, Sound value, ConfigParam cEnum) { Config(String path, Sound value, ConfigParam cEnum) {
this.path = path; this.path = path;
this.sound = value; this.sound = value;
this.cEnum = cEnum; this.configParam = cEnum;
} }
Config(String path, Integer value, ConfigParam cEnum) { Config(String path, Integer value, ConfigParam cEnum) {
this.path = path; this.path = path;
this.valueInt = value; this.valueInt = value;
this.cEnum = cEnum; this.configParam = cEnum;
} }
Config(String path, Boolean value, ConfigParam cEnum) { Config(String path, Boolean value, ConfigParam cEnum) {
this.path = path; this.path = path;
this.valueBoolean = value; this.valueBoolean = value;
this.cEnum = cEnum; this.configParam = cEnum;
} }
public static Sound sound() { public static Sound sound() {