feat: Don't display the default plot title if on a server-plot, unless configured otherwise. (#3305)

- If plot-title flag is set, title will still be displayed.
This commit is contained in:
Jordan 2021-11-01 11:23:53 +00:00 committed by GitHub
parent 804228fa6c
commit 6f3eabba0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 44 deletions

View File

@ -708,6 +708,9 @@ public class Settings extends Config {
"If you would like to still show the owner of the plot, append the contents of \"titles.title_entered_plot_sub\" onto the " +
"former lang key."})
public static boolean TITLES_AS_ACTIONBAR = false;
@Comment({"If the default title should be displayed on plots with server-plot flag set.",
"Titles will still be sent if the plot-title flag is set."})
public static boolean DISPLAY_DEFAULT_ON_SERVER_PLOT = false;
}

View File

@ -58,6 +58,7 @@ import com.plotsquared.core.plot.flag.implementations.MusicFlag;
import com.plotsquared.core.plot.flag.implementations.NotifyEnterFlag;
import com.plotsquared.core.plot.flag.implementations.NotifyLeaveFlag;
import com.plotsquared.core.plot.flag.implementations.PlotTitleFlag;
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
import com.plotsquared.core.plot.flag.implementations.TimeFlag;
import com.plotsquared.core.plot.flag.implementations.TitlesFlag;
import com.plotsquared.core.plot.flag.implementations.WeatherFlag;
@ -317,7 +318,7 @@ public class PlotListener {
subtitle = "";
fromFlag = false;
}
// It's not actually possible for these to be null, but IntelliJ is dumb
if (fromFlag || !plot.getFlag(ServerPlotFlag.class) || Settings.Titles.DISPLAY_DEFAULT_ON_SERVER_PLOT) {
TaskManager.runTaskLaterAsync(() -> {
Plot lastPlot;
try (final MetaDataAccess<Plot> lastPlotAccess =
@ -363,6 +364,7 @@ public class PlotListener {
}
}, TaskTime.seconds(1L));
}
}
TimedFlag.Timed<Integer> feed = plot.getFlag(FeedFlag.class);
if (feed.getInterval() != 0 && feed.getValue() != 0) {