Changed system used to detect if a player is real or not.

This commit is contained in:
Brianna 2020-09-28 14:49:55 -05:00
parent a2d1e5a84f
commit f9c9ff8f07
8 changed files with 2 additions and 39 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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];

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);