code changes
This commit is contained in:
parent
156784f37c
commit
e8a3c26650
@ -18,6 +18,7 @@ import java.util.Iterator;
|
|||||||
|
|
||||||
public class LPCommand implements Listener {
|
public class LPCommand implements Listener {
|
||||||
|
|
||||||
|
/*
|
||||||
private boolean LPCheck(String command) {
|
private boolean LPCheck(String command) {
|
||||||
if (command.charAt(0) == '/') {
|
if (command.charAt(0) == '/') {
|
||||||
command = command.replaceFirst("/", "");
|
command = command.replaceFirst("/", "");
|
||||||
@ -83,4 +84,6 @@ public class LPCommand implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
@ -21,35 +21,6 @@ import org.bukkit.event.server.ServerCommandEvent;
|
|||||||
|
|
||||||
public class OPCommand implements Listener {
|
public class OPCommand implements Listener {
|
||||||
|
|
||||||
private int isNotOPWTL(String command) {
|
|
||||||
if (command.charAt(0) == '/') command = command.replaceFirst("/", "");
|
|
||||||
String arg = command.replace("op ", "");
|
|
||||||
|
|
||||||
if (SelectConfig.PlayerMustBeOnlineToOp) {
|
|
||||||
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
|
||||||
Player target = Bukkit.getPlayer(arg);
|
|
||||||
if (target == null) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (Main.opHashMap.get(target.getName().toLowerCase()).UUID.equals(target.getUniqueId().toString().replace("-", ""))) {
|
|
||||||
return 0;
|
|
||||||
} else return 2;
|
|
||||||
} else return 2;
|
|
||||||
} else {
|
|
||||||
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
|
||||||
String targetUUID = null;
|
|
||||||
try {
|
|
||||||
targetUUID = NameHistory.getPlayerUUID(arg);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (Main.opHashMap.get(arg.toLowerCase()).UUID.equals(targetUUID)) {
|
|
||||||
return 0;
|
|
||||||
} else return 2;
|
|
||||||
} else return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onOPServer(ServerCommandEvent event) {
|
public void onOPServer(ServerCommandEvent event) {
|
||||||
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op ")) && SelectConfig.OP_Whitelist_Enable) {
|
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op ")) && SelectConfig.OP_Whitelist_Enable) {
|
||||||
@ -84,4 +55,33 @@ public class OPCommand implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int isNotOPWTL(String command) {
|
||||||
|
if (command.charAt(0) == '/') command = command.replaceFirst("/", "");
|
||||||
|
String arg = command.replace("op ", "");
|
||||||
|
|
||||||
|
if (SelectConfig.PlayerMustBeOnlineToOp) {
|
||||||
|
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
||||||
|
Player target = Bukkit.getPlayer(arg);
|
||||||
|
if (target == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (Main.opHashMap.get(target.getName().toLowerCase()).UUID.equals(target.getUniqueId().toString().replace("-", ""))) {
|
||||||
|
return 0;
|
||||||
|
} else return 2;
|
||||||
|
} else return 2;
|
||||||
|
} else {
|
||||||
|
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
||||||
|
String targetUUID = null;
|
||||||
|
try {
|
||||||
|
targetUUID = NameHistory.getPlayerUUID(arg);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (Main.opHashMap.get(arg.toLowerCase()).UUID.equals(targetUUID)) {
|
||||||
|
return 0;
|
||||||
|
} else return 2;
|
||||||
|
} else return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user