Config build change to new ConfigBuilder

This commit is contained in:
2024-07-03 03:32:03 +02:00
parent c89430b219
commit 35ac13b695
17 changed files with 526 additions and 418 deletions

View File

@@ -22,7 +22,7 @@ import java.util.Map;
public class OpCommand implements Listener {
@EventHandler
public void onOPServer(ServerCommandEvent event) {
if (!OPWhitelist.enable.valueBoolean) return;
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return;
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op "))) {
switch (isNotOPWTL(event.getCommand())) {
case mustOnline:
@@ -39,7 +39,7 @@ public class OpCommand implements Listener {
@EventHandler
public void onOpPlayer(PlayerCommandPreprocessEvent event) {
if (!OPWhitelist.enable.valueBoolean) return;
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return;
if ((event.getMessage().toLowerCase().startsWith("/op ") || event.getMessage().toLowerCase().startsWith("/minecraft:op "))) {
switch (isNotOPWTL(event.getMessage())) {
case mustOnline:
@@ -59,7 +59,7 @@ public class OpCommand implements Listener {
String arg = command.replace("op ", "");
Player target = Bukkit.getPlayer(arg);
if (OPWhitelist.playerMustBeOnlineToOp.valueBoolean) {
if ((boolean)OPWhitelist.VALUES.playerMustBeOnlineToOp.getValue()) {
if (target == null) return OpCommandRequest.mustOnline;
if (!opWhitelist(target.getName(), target.getUniqueId().toString())) return OpCommandRequest.notWhitelisted;
}