mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-03 13:43:36 +01:00
Fix plot title toggling (fixes #2456)
This commit is contained in:
parent
df9d5ae2ac
commit
8ab10de4ad
@ -3,7 +3,6 @@ package com.github.intellectualsites.plotsquared.plot.commands;
|
|||||||
import com.github.intellectualsites.plotsquared.commands.Command;
|
import com.github.intellectualsites.plotsquared.commands.Command;
|
||||||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
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.PlotPlayer;
|
||||||
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2;
|
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2;
|
||||||
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3;
|
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,
|
public void titles(Command command, PlotPlayer player, String[] args,
|
||||||
RunnableVal3<Command, Runnable, Runnable> confirm,
|
RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
RunnableVal2<Command, CommandResult> whenDone) {
|
RunnableVal2<Command, CommandResult> whenDone) {
|
||||||
PlotArea area = player.getApplicablePlotArea();
|
if (toggle(player, "disabletitles")) {
|
||||||
boolean chat = area != null && area.PLOT_CHAT;
|
|
||||||
if (toggle(player, "disabletitles") != chat) {
|
|
||||||
MainUtil.sendMessage(player, Captions.TOGGLE_ENABLED, command.toString());
|
MainUtil.sendMessage(player, Captions.TOGGLE_ENABLED, command.toString());
|
||||||
} else {
|
} else {
|
||||||
MainUtil.sendMessage(player, Captions.TOGGLE_DISABLED, command.toString());
|
MainUtil.sendMessage(player, Captions.TOGGLE_DISABLED, command.toString());
|
||||||
|
@ -163,7 +163,7 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
CommentManager.sendTitle(player, plot);
|
CommentManager.sendTitle(player, plot);
|
||||||
}
|
}
|
||||||
if (titles) {
|
if (titles && !player.getAttribute("disabletitles")) {
|
||||||
if (!Captions.TITLE_ENTERED_PLOT.getTranslated().isEmpty()
|
if (!Captions.TITLE_ENTERED_PLOT.getTranslated().isEmpty()
|
||||||
|| !Captions.TITLE_ENTERED_PLOT_SUB.getTranslated().isEmpty()) {
|
|| !Captions.TITLE_ENTERED_PLOT_SUB.getTranslated().isEmpty()) {
|
||||||
TaskManager.runTaskLaterAsync(() -> {
|
TaskManager.runTaskLaterAsync(() -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user