From 8ab10de4ad3cd39debcd8f9d620f4b88c1761ef3 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sat, 10 Aug 2019 17:54:44 +0200 Subject: [PATCH] Fix plot title toggling (fixes #2456) --- .../intellectualsites/plotsquared/plot/commands/Toggle.java | 5 +---- .../plotsquared/plot/listener/PlotListener.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java index d9bd9bd99..e19d81762 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java @@ -3,7 +3,6 @@ package com.github.intellectualsites.plotsquared.plot.commands; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; @@ -69,9 +68,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; public void titles(Command command, PlotPlayer player, String[] args, RunnableVal3 confirm, RunnableVal2 whenDone) { - PlotArea area = player.getApplicablePlotArea(); - boolean chat = area != null && area.PLOT_CHAT; - if (toggle(player, "disabletitles") != chat) { + if (toggle(player, "disabletitles")) { MainUtil.sendMessage(player, Captions.TOGGLE_ENABLED, command.toString()); } else { MainUtil.sendMessage(player, Captions.TOGGLE_DISABLED, command.toString()); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index 50b2f5398..c26c4231e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -163,7 +163,7 @@ public class PlotListener { } CommentManager.sendTitle(player, plot); } - if (titles) { + if (titles && !player.getAttribute("disabletitles")) { if (!Captions.TITLE_ENTERED_PLOT.getTranslated().isEmpty() || !Captions.TITLE_ENTERED_PLOT_SUB.getTranslated().isEmpty()) { TaskManager.runTaskLaterAsync(() -> {