mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Added chat spy toggle
This commit is contained in:
parent
6006b0e011
commit
ea6d5778c8
@ -77,6 +77,20 @@ public class Toggle extends SubCommand {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
toggles.put("chatspy",
|
||||
new Command<PlotPlayer>("chatspy", "/plot toggle chatspy", "Toggle chat spying", C.PERMISSION_COMMANDS_CHAT.s()) {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
if (toggle(player, "chatspy")) {
|
||||
MainUtil.sendMessage(player, C.TOGGLE_ENABLED, getCommand());
|
||||
}
|
||||
else {
|
||||
MainUtil.sendMessage(player, C.TOGGLE_DISABLED, getCommand());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
toggles.put("chat",
|
||||
new Command<PlotPlayer>("chat", "/plot toggle chat", "Toggle plot chat for yourself", C.PERMISSION_PLOT_TOGGLE_CHAT.s()) {
|
||||
|
||||
|
@ -626,7 +626,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
recipients.clear();
|
||||
for (final Player p : Bukkit.getOnlinePlayers()) {
|
||||
PlotPlayer pp = BukkitUtil.getPlayer(p);
|
||||
if (Permissions.hasPermission(pp, C.PERMISSION_COMMANDS_CHAT) || plot.equals(pp.getCurrentPlot())) {
|
||||
if (pp.getAttribute("chatspy") || plot.equals(pp.getCurrentPlot())) {
|
||||
recipients.add(p);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user