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