forked from Minecraft/QoL
Added messages when notifying the user they are entering spec.
parent
7180b0982b
commit
6c5c20960b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue