From 47db33076474a172fa8e1acaea50ccf2763f7e96 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 13 Jan 2017 08:05:13 +1100 Subject: [PATCH] Fix title global flag --- .../com/plotsquared/listener/PlotListener.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/listener/PlotListener.java index de339a323..c1b3479c0 100644 --- a/Core/src/main/java/com/plotsquared/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/listener/PlotListener.java @@ -35,9 +35,15 @@ public class PlotListener { EventUtil.manager.callEntry(player, plot); if (plot.hasOwner()) { Map, Object> flags = FlagManager.getPlotFlags(plot); - boolean titles = Settings.TITLES; - final String greeting; + boolean titles; + if (!plot.getArea().DEFAULT_FLAGS.isEmpty()) { + Boolean value = (Boolean) plot.getArea().DEFAULT_FLAGS.get(Flags.TITLES); + titles = value != null ? value : Settings.TITLES; + } else { + titles = Settings.TITLES; + } + final String greeting; if (flags.isEmpty()) { if (titles) { greeting = ""; @@ -45,9 +51,7 @@ public class PlotListener { return true; } } else { - if (Settings.TITLES) { - titles = plot.getFlag(Flags.TITLES, true); - } + titles = plot.getFlag(Flags.TITLES, titles); Optional greetingFlag = plot.getFlag(Flags.GREETING); if (greetingFlag.isPresent()) { greeting = greetingFlag.get();