Added spy permission for staff chat.

This commit is contained in:
Brianna O'Keefe 2019-03-09 12:26:54 -05:00
parent 11e0d7e631
commit 1709251803
2 changed files with 5 additions and 4 deletions

View File

@ -107,7 +107,9 @@ public class GUIPunishments extends AbstractGUI {
if (appliedPunishment.getPunishmentType() != PunishmentType.KICK) {
lore.add("");
lore.add(plugin.getLocale().getMessage("gui.punishments.duration"));
lore.add("&7" + (appliedPunishment.getDuration() != -1 ? Methods.makeReadable(appliedPunishment.getDuration()) : plugin.getLocale().getMessage("gui.general.permanent")));
lore.add("&7" + (appliedPunishment.getDuration() != -1
? Methods.makeReadable(appliedPunishment.getDuration())
: plugin.getLocale().getMessage("gui.general.permanent")));
lore.add("");
lore.add(plugin.getLocale().getMessage("gui.punishments.punisher"));
lore.add("&7" + (appliedPunishment.getPunisher() == null ? "Console" : Bukkit.getOfflinePlayer(appliedPunishment.getPunisher()).getName()));

View File

@ -51,9 +51,8 @@ public class StaffChannel {
private void messageAll(String message) {
chatLog.add(message);
for (UUID uuid : members) {
Player player = Bukkit.getPlayer(uuid);
if (player == null) continue;
for (Player player : Bukkit.getOnlinePlayers()) {
if (!members.contains(player.getUniqueId()) && !player.hasPermission("um.staffchat.spy")) continue;
player.sendMessage(Methods.formatText(message));
}
}