Fix title global flag

This commit is contained in:
Jesse Boyd 2017-01-13 08:05:13 +11:00
parent 35ebc8c830
commit 47db330764
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -35,9 +35,15 @@ public class PlotListener {
EventUtil.manager.callEntry(player, plot);
if (plot.hasOwner()) {
Map<Flag<?>, 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<String> greetingFlag = plot.getFlag(Flags.GREETING);
if (greetingFlag.isPresent()) {
greeting = greetingFlag.get();