2.4.3 #5

Merged
JaTiTV merged 4 commits from customCommands-fix into main 2022-11-02 18:01:27 +00:00
2 changed files with 22 additions and 23 deletions
Showing only changes of commit 485b50de7a - Show all commits

View File

@ -6,7 +6,7 @@
<groupId>de.jatitv</groupId>
<artifactId>OPSecurity</artifactId>
<version>2.4.2</version>
<version>2.4.3-DEV-1</version>
<packaging>jar</packaging>
<name>OPSecurity</name>

View File

@ -20,14 +20,14 @@ public class Check {
return false;
}
if (join) {
send.console(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleOnJoin.replace("[player]", player.getName())));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleOnJoin.replace("[player]", player.getName())));
}
if (SelectConfig.Notify_Warn) {
for (Player notifyperm : Bukkit.getOnlinePlayers()) {
if (notifyperm.hasPermission(Permissions.notify)) {
if (join) {
notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleOnJoin.replace("[player]", player.getName())));
} else notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleOnJoin.replace("[player]", player.getName())));
} else notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
if (SelectConfig.Notify_Sound_Enable) {
notifyperm.playSound(player.getLocation(), SelectConfig.Notify_Sound, 3, 1);
}
@ -37,20 +37,19 @@ public class Check {
if (SelectConfig.no_OP_Player_kick && SelectConfig.no_OP_Player_deop) {
player.setOp(false);
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName())
.replace("[reason]", Replace.replace(Util.getPrefix(),SelectMessages.OP_kick + "\n" + "\n" + SelectMessages.OP_deop)));
send.console(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
.replace("[reason]", Replace.replace(Util.getPrefix(), SelectMessages.OP_kick + "\n" + "\n" + SelectMessages.OP_deop)));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
return true;
} else {
if (SelectConfig.no_OP_Player_kick) {
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(),SelectMessages.OP_kick)));
send.console(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(), SelectMessages.OP_kick)));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleKick.replace("[player]", player.getName())));
for (Player notifyperm : Bukkit.getOnlinePlayers()) {
if (notifyperm.hasPermission(Permissions.notify)) {
notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleKick.replace("[player]", player.getName())
notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleKick.replace("[player]", player.getName())
+ "\n" + SelectMessages.OP_consoleDeop.replace("[player]", player.getName())));
}
}
return true;
}
if (SelectConfig.no_OP_Player_deop) {
player.setOp(false);
@ -58,18 +57,17 @@ public class Check {
new BukkitRunnable() {
@Override
public void run() {
player.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.OP_deop));
player.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.OP_deop));
}
}.runTaskLater(Main.plugin, 5L);
}
send.console(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleDeop.replace("[player]", player.getName())));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleDeop.replace("[player]", player.getName())));
for (Player notifyperm : Bukkit.getOnlinePlayers()) {
if (notifyperm.hasPermission(Permissions.notify)) {
notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.OP_consoleDeop.replace("[player]", player.getName())));
notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.OP_consoleDeop.replace("[player]", player.getName())));
}
}
return true;
}
}
if (SelectConfig.customCommand_Enable) {
@ -77,12 +75,13 @@ public class Check {
@Override
public void run() {
for (String cmd : SelectConfig.customKickCommand) {
Cmd.console(Replace.replace(Util.getPrefix(),cmd.replace("[player]", player.getName())));
Cmd.console(Replace.replace(Util.getPrefix(), cmd.replace("[player]", player.getName())));
}
}
}.runTaskLater(Main.plugin, 5L);
return true;
}
return true;
}
}
@ -91,15 +90,15 @@ public class Check {
if (player.hasPermission(s)) {
if (!permWhitelist(player)) {
if (join) {
send.console(Replace.replace(Util.getPrefix(),SelectMessages.Perm_consoleOnJoin.replace("[player]", player.getName()).replace("[perm]", s)));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.Perm_consoleOnJoin.replace("[player]", player.getName()).replace("[perm]", s)));
}
if (SelectConfig.Notify_Warn) {
for (Player notifyperm : Bukkit.getOnlinePlayers()) {
if (notifyperm.hasPermission(Permissions.notify)) {
if (join) {
notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.Perm_consoleOnJoin.replace("[player]",
notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.Perm_consoleOnJoin.replace("[player]",
player.getName()).replace("[perm]", s)));
} else notifyperm.sendMessage(Replace.replace(Util.getPrefix(),SelectMessages.Perm_consoleKick.replace("[player]",
} else notifyperm.sendMessage(Replace.replace(Util.getPrefix(), SelectMessages.Perm_consoleKick.replace("[player]",
player.getName()).replace("[perm]", s)));
if (SelectConfig.Notify_Sound_Enable) {
notifyperm.playSound(player.getLocation(), SelectConfig.Notify_Sound, 3, 1);
@ -108,8 +107,8 @@ public class Check {
}
}
if (SelectConfig.PlayerWhithPermission_kick && SelectConfig.Perm_Command_enable) {
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(),SelectMessages.Perm_kick)));
send.console(Replace.replace(Util.getPrefix(),SelectMessages.Perm_consoleKick.replace("[player]",
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(), SelectMessages.Perm_kick)));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.Perm_consoleKick.replace("[player]",
player.getName()).replace("[perm]", s)));
for (String cmd : SelectConfig.Perm_Command) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd.replace("[player]", player.getName()).replace("[perm]", s));
@ -118,8 +117,8 @@ public class Check {
}
if (SelectConfig.PlayerWhithPermission_kick) {
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(),SelectMessages.Perm_kick)));
send.console(Replace.replace(Util.getPrefix(),SelectMessages.Perm_consoleKick.replace("[player]",
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(Util.getPrefix(), SelectMessages.Perm_kick)));
send.console(Replace.replace(Util.getPrefix(), SelectMessages.Perm_consoleKick.replace("[player]",
player.getName()).replace("[perm]", s)));
return true;
}