diff --git a/pom.xml b/pom.xml
index 9e8ba02..5ccdaea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
com.songoda
UltimateModeration
4.0.0
- 2.0.2b
+ 2.0.3
clean install
UltimateModeration-${project.version}
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandBan.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandBan.java
index fed62b4..6715d90 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandBan.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandBan.java
@@ -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);
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandKick.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandKick.java
index dea19a3..6d7faa2 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandKick.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandKick.java
@@ -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;
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandMute.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandMute.java
index 6682e7c..18d2b9f 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandMute.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandMute.java
@@ -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;
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandRunTemplate.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandRunTemplate.java
index 72ebf25..bb7f16e 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandRunTemplate.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandRunTemplate.java
@@ -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];
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnBan.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnBan.java
index 97338b7..edf9ca9 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnBan.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnBan.java
@@ -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);
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnMute.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnMute.java
index ee3bb21..061477f 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnMute.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandUnMute.java
@@ -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);
diff --git a/src/main/java/com/songoda/ultimatemoderation/commands/CommandWarn.java b/src/main/java/com/songoda/ultimatemoderation/commands/CommandWarn.java
index c8c8ef7..771a19a 100644
--- a/src/main/java/com/songoda/ultimatemoderation/commands/CommandWarn.java
+++ b/src/main/java/com/songoda/ultimatemoderation/commands/CommandWarn.java
@@ -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;
diff --git a/src/main/java/com/songoda/ultimatemoderation/moderate/moderations/SpyModeration.java b/src/main/java/com/songoda/ultimatemoderation/moderate/moderations/SpyModeration.java
index ce0e9d6..5fe9ef6 100644
--- a/src/main/java/com/songoda/ultimatemoderation/moderate/moderations/SpyModeration.java
+++ b/src/main/java/com/songoda/ultimatemoderation/moderate/moderations/SpyModeration.java
@@ -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);