Greeting flag in title

This commit is contained in:
boy0001 2015-05-10 17:41:41 +10:00
parent 024aa995f6
commit 74afa033c4
3 changed files with 13 additions and 4 deletions

1
.gitignore vendored
View File

@ -100,3 +100,4 @@ hs_err_pid*
/target /target
/plotsquared/target /plotsquared/target
*.MF *.MF
PlotSquared/schematic.zip

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>2.10.7</version> <version>2.10.8</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

@ -111,8 +111,16 @@ public class PlotListener extends APlotListener {
player.setPlayerWeather(getWeatherType(weatherFlag.getValueString())); player.setPlayerWeather(getWeatherType(weatherFlag.getValueString()));
} }
if ((FlagManager.isBooleanFlag(plot, "titles", Settings.TITLES)) && (C.TITLE_ENTERED_PLOT.s().length() > 2)) { if ((FlagManager.isBooleanFlag(plot, "titles", Settings.TITLES)) && (C.TITLE_ENTERED_PLOT.s().length() > 2)) {
final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceAll("%x%", plot.id.x + "").replaceAll("%z%", plot.id.y + "").replaceAll("%world%", plot.world + ""); Flag greetingFlag = FlagManager.getPlotFlag(plot, "greeting");
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner)); String greeting;
if (greetingFlag != null) {
greeting = greetingFlag.getValue() + "";
}
else {
greeting = "";
}
final String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceAll("%x%", plot.id.x + "").replaceAll("%z%", plot.id.y + "").replaceAll("%world%", plot.world + "").replaceAll("%greeting%", greeting);
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner)).replaceAll("%greeting%", greeting);
if (AbstractTitle.TITLE_CLASS != null) { if (AbstractTitle.TITLE_CLASS != null) {
AbstractTitle.TITLE_CLASS.sendTitle(player, sTitleMain, sTitleSub, ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s()), ChatColor.valueOf(C.TITLE_ENTERED_PLOT_SUB_COLOR.s())); AbstractTitle.TITLE_CLASS.sendTitle(player, sTitleMain, sTitleSub, ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s()), ChatColor.valueOf(C.TITLE_ENTERED_PLOT_SUB_COLOR.s()));
} }