mirror of
https://github.com/songoda/UltimateModeration.git
synced 2024-11-22 18:26:10 +01:00
Changed system used to detect if a player is real or not.
This commit is contained in:
parent
a2d1e5a84f
commit
f9c9ff8f07
@ -49,11 +49,6 @@ public class CommandBan extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (plugin.getPunishmentManager().getPlayer(player).getActivePunishments()
|
||||
.stream().anyMatch(appliedPunishment -> appliedPunishment.getPunishmentType() == PunishmentType.BAN)) {
|
||||
plugin.getLocale().newMessage("That player is already banned.").sendPrefixedMessage(sender);
|
||||
|
@ -39,11 +39,6 @@ public class CommandKick extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getPlayer(args[0]);
|
||||
|
||||
if (player == null) {
|
||||
plugin.getLocale().newMessage("That player does not exist or is not online.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (sender instanceof Player && player.getPlayer().hasPermission("um.kick.exempt")) {
|
||||
plugin.getLocale().newMessage("You cannot kick this player.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
|
@ -49,11 +49,6 @@ public class CommandMute extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (sender instanceof Player && VaultPermissions.hasPermission(player, "um.mute.exempt")) {
|
||||
plugin.getLocale().newMessage("You cannot mute that player.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
|
@ -27,11 +27,6 @@ public class CommandRunTemplate extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
StringBuilder templateBuilder = new StringBuilder();
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
String line = args[i];
|
||||
|
@ -28,11 +28,6 @@ public class CommandUnBan extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (!plugin.getPunishmentManager().getPlayer(player).getActivePunishments()
|
||||
.stream().anyMatch(appliedPunishment -> appliedPunishment.getPunishmentType() == PunishmentType.BAN)) {
|
||||
plugin.getLocale().newMessage("That player isn't banned.").sendPrefixedMessage(sender);
|
||||
|
@ -28,11 +28,6 @@ public class CommandUnMute extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (!plugin.getPunishmentManager().getPlayer(player).getActivePunishments()
|
||||
.stream().anyMatch(appliedPunishment -> appliedPunishment.getPunishmentType() == PunishmentType.MUTE)) {
|
||||
plugin.getLocale().newMessage("That player isn't muted.").sendPrefixedMessage(sender);
|
||||
|
@ -49,11 +49,6 @@ public class CommandWarn extends AbstractCommand {
|
||||
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[0]);
|
||||
|
||||
if (!player.hasPlayedBefore()) {
|
||||
plugin.getLocale().newMessage("That player does not exist.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (sender instanceof Player && VaultPermissions.hasPermission(player, "um.warning.exempt")) {
|
||||
plugin.getLocale().newMessage("You cannot warn that player.").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
|
@ -86,13 +86,11 @@ public class SpyModeration extends AbstractModeration {
|
||||
return;
|
||||
}
|
||||
|
||||
if (oPlayer == null) return;
|
||||
Player player = oPlayer.getPlayer();
|
||||
|
||||
if (player == null) {
|
||||
if (oPlayer == null || !oPlayer.isOnline()) {
|
||||
instance.getLocale().newMessage("That player does not exist or is not online.").sendPrefixedMessage(senderP);
|
||||
return;
|
||||
}
|
||||
Player player = oPlayer.getPlayer();
|
||||
|
||||
if (player == senderP) {
|
||||
instance.getLocale().getMessage("command.spy.cant").sendPrefixedMessage(senderP);
|
||||
|
Loading…
Reference in New Issue
Block a user