3 Commits
3.0.3 ... 3.0.4

Author SHA1 Message Date
43e51fee59 3.0.4
Bugfix:
- In Permission Whitelist, the customCommands function did not work as expected.
2022-11-17 21:07:15 +01:00
466314f206 Merge branch 'main' of https://git.t2code.net/JaTiTV/OPSecurity 2022-11-15 02:33:22 +01:00
47a9080dba Update pom.xml 2022-11-15 02:31:56 +01:00
4 changed files with 12 additions and 12 deletions

View File

@@ -6,7 +6,8 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2C-OPSecurity</artifactId> <artifactId>T2C-OPSecurity</artifactId>
<version>3.0.3_SNAPSHOT-1</version> <version>3.0.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2C-OPSecurity</name> <name>T2C-OPSecurity</name>
@@ -82,8 +83,7 @@
<dependency> <dependency>
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>DEV-13.4</version> <version>13.4</version>
<classifier>snapshot-2</classifier>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->

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() {