diff --git a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java index e626b6f..05f4c47 100644 --- a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java +++ b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java @@ -52,20 +52,29 @@ public class CommandPreprocessListener implements Listener { DynmapAPI dynmap = (DynmapAPI) plugin.getDynmap(); // Spec dynmap hide - if (base.equals("spec") && sender.hasPermission("SafeSpectate.spectate") && dynmap != null) { + if (base.equals("spec") && sender.hasPermission("safespectate.spectate") && dynmap != null) { + String message; boolean visibleStatus; if (sender.getGameMode() != GameMode.SPECTATOR){ dynmapVisibleStatusMap.put(sender.getUniqueId(), dynmap.getPlayerVisbility(sender.getName())); visibleStatus = false; + + message = "You are now being hidden Dynmap."; + } else if (dynmapVisibleStatusMap.containsKey(sender.getUniqueId())){ visibleStatus = dynmapVisibleStatusMap.remove(sender.getUniqueId()); + + String status = ((visibleStatus) ? "shown" : "hidden"); + message = "Your " + status + " status has been restored on Dynmap."; } else { + message = "You are now visible on the Dynmap."; visibleStatus = true; } - dynmap.setPlayerVisiblity(sender.getDisplayName(), visibleStatus); + sender.spigot().sendMessage(new TextComponent(ChatColor.GREEN + message)); + dynmap.setPlayerVisiblity(sender.getName(), visibleStatus); } // Spec TP confirmation