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

3
.gitignore vendored
View File

@ -99,4 +99,5 @@ local.properties
hs_err_pid*
/target
/plotsquared/target
*.MF
*.MF
PlotSquared/schematic.zip

View File

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

View File

@ -111,8 +111,16 @@ public class PlotListener extends APlotListener {
player.setPlayerWeather(getWeatherType(weatherFlag.getValueString()));
}
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 + "");
final String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
Flag greetingFlag = FlagManager.getPlotFlag(plot, "greeting");
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) {
AbstractTitle.TITLE_CLASS.sendTitle(player, sTitleMain, sTitleSub, ChatColor.valueOf(C.TITLE_ENTERED_PLOT_COLOR.s()), ChatColor.valueOf(C.TITLE_ENTERED_PLOT_SUB_COLOR.s()));
}