Allow offline players to be warned.

This commit is contained in:
Brianna 2020-06-04 11:42:15 -05:00
parent ff36503381
commit 8db3c9070c
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,6 @@ import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.omg.CORBA.TypeCodePackage.BadKind;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -5,6 +5,7 @@ import com.songoda.ultimatemoderation.UltimateModeration;
import com.songoda.ultimatemoderation.punish.Punishment;
import com.songoda.ultimatemoderation.punish.PunishmentType;
import com.songoda.ultimatemoderation.utils.Methods;
import com.songoda.ultimatemoderation.utils.VaultPermissions;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
@ -53,7 +54,7 @@ public class CommandWarn extends AbstractCommand {
return ReturnType.FAILURE;
}
if (sender instanceof Player && player.getPlayer().hasPermission("um.warning.exempt")) {
if (sender instanceof Player && VaultPermissions.hasPermission(Bukkit.getWorlds().get(0).getName(), player, "um.warning.exempt")) {
instance.getLocale().newMessage("You cannot warn that player.").sendPrefixedMessage(sender);
return ReturnType.FAILURE;
}