Merge branch 'development'

This commit is contained in:
Brianna 2020-09-28 14:51:35 -05:00
commit 3985df94c8
9 changed files with 3 additions and 40 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>UltimateModeration</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>2.0.2b</version>
<version>2.0.3</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>UltimateModeration-${project.version}</finalName>

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