fix worldguard block-command bug
This commit is contained in:
parent
e8a3c26650
commit
0bfbeac52d
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.jatitv</groupId>
|
||||
<artifactId>OPSecurity</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<version>2.4.1_DEV</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>OPSecurity</name>
|
||||
|
@ -17,7 +17,10 @@ public class Events implements org.bukkit.event.Listener {
|
||||
public void CommandSendEvent(PlayerCommandPreprocessEvent event) {
|
||||
if (SelectConfig.CheckOnCommand) {
|
||||
Player player = event.getPlayer();
|
||||
event.setCancelled(Check.onCheck(player, false));
|
||||
if (Check.onCheck(player, false)) {
|
||||
if (event.isCancelled()) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,9 +29,7 @@ public class Events implements org.bukkit.event.Listener {
|
||||
if (SelectConfig.CheckOnChat) {
|
||||
Player player = event.getPlayer();
|
||||
if (Check.onCheck(player, false)) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (event.isCancelled()) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public class OPCommand implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onOPServer(ServerCommandEvent event) {
|
||||
|
||||
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op ")) && SelectConfig.OP_Whitelist_Enable) {
|
||||
switch (this.isNotOPWTL(event.getCommand())) {
|
||||
case 1:
|
||||
@ -40,6 +41,7 @@ public class OPCommand implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onOpPlayer(PlayerCommandPreprocessEvent event) {
|
||||
|
||||
if (SelectConfig.OP_Whitelist_Enable) {
|
||||
if ((event.getMessage().toLowerCase().startsWith("/op ") || event.getMessage().toLowerCase().startsWith("/minecraft:op "))) {
|
||||
switch (this.isNotOPWTL(event.getMessage())) {
|
||||
@ -57,6 +59,7 @@ public class OPCommand implements Listener {
|
||||
}
|
||||
|
||||
private int isNotOPWTL(String command) {
|
||||
if (!command.contains("op")) return 0;
|
||||
if (command.charAt(0) == '/') command = command.replaceFirst("/", "");
|
||||
String arg = command.replace("op ", "");
|
||||
|
||||
|
@ -15,6 +15,7 @@ public class PlugManCommand implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onOPServer(ServerCommandEvent event) {
|
||||
|
||||
if ((event.getCommand().toLowerCase().contains("plugman disable") && event.getCommand().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase()))
|
||||
|| (event.getCommand().toLowerCase().contains("plugman reload") && event.getCommand().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase()))
|
||||
|| (event.getCommand().toLowerCase().contains("plugman unload") && event.getCommand().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase()))
|
||||
@ -27,6 +28,7 @@ public class PlugManCommand implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onOpPlayer(PlayerCommandPreprocessEvent event) {
|
||||
|
||||
if (event.getMessage().toLowerCase().startsWith("/plugman disable") && event.getMessage().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase())
|
||||
|| (event.getMessage().toLowerCase().startsWith("/plugman reload") && event.getMessage().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase()))
|
||||
|| (event.getMessage().toLowerCase().startsWith("/plugman unload") && event.getMessage().toLowerCase().contains(Main.plugin.getDescription().getName().toLowerCase()))
|
||||
|
Loading…
Reference in New Issue
Block a user