From 90d48b2cd0c7170f3ce3c9cf2b2d9669c6f399b0 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 26 Aug 2016 13:54:22 +1000 Subject: [PATCH] Fixes #1289 --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 2 +- .../java/com/intellectualcrafters/plot/commands/Toggle.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 18560e88e..a981d3d8f 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -607,7 +607,7 @@ public class PlayerEvents extends PlotListener implements Listener { PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer()); Location location = plotPlayer.getLocation(); PlotArea area = location.getPlotArea(); - if (area == null || (!area.PLOT_CHAT && !plotPlayer.getAttribute("chat"))) { + if (area == null || (!area.PLOT_CHAT != plotPlayer.getAttribute("chat"))) { return; } Plot plot = area.getPlot(location); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java index 536f82c63..9bc3423f1 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java @@ -1,6 +1,7 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.object.PlotArea; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.RunnableVal2; import com.intellectualcrafters.plot.object.RunnableVal3; @@ -67,7 +68,9 @@ public class Toggle extends Command { description = "Toggle plot title messages") public void titles(Command command, PlotPlayer player, String[] args, RunnableVal3 confirm, RunnableVal2 whenDone) { - if (toggle(player, "disabletitles")) { + PlotArea area = player.getApplicablePlotArea(); + boolean chat = area == null ? false : area.PLOT_CHAT; + if (toggle(player, "disabletitles") != chat) { MainUtil.sendMessage(player, C.TOGGLE_ENABLED, command.toString()); } else { MainUtil.sendMessage(player, C.TOGGLE_DISABLED, command.toString());