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); EventUtil.manager.callEntry(player, plot);
if (plot.hasOwner()) { if (plot.hasOwner()) {
Map<Flag<?>, Object> flags = FlagManager.getPlotFlags(plot); 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 (flags.isEmpty()) {
if (titles) { if (titles) {
greeting = ""; greeting = "";
@ -45,9 +51,7 @@ public class PlotListener {
return true; return true;
} }
} else { } else {
if (Settings.TITLES) { titles = plot.getFlag(Flags.TITLES, titles);
titles = plot.getFlag(Flags.TITLES, true);
}
Optional<String> greetingFlag = plot.getFlag(Flags.GREETING); Optional<String> greetingFlag = plot.getFlag(Flags.GREETING);
if (greetingFlag.isPresent()) { if (greetingFlag.isPresent()) {
greeting = greetingFlag.get(); greeting = greetingFlag.get();