From d0c89f4e9f4df6756707031ba397c7e8185f9c42 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 18 Feb 2012 21:09:18 +0000 Subject: Adding full keyword support for newb join message. Also adding {ADDRESS} and {USERNAME} as new keywords. --- .../earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'EssentialsSpawn/src/com/earth2me/essentials') diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index b68b4e350..083fd66a5 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -4,6 +4,9 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; +import com.earth2me.essentials.textreader.IText; +import com.earth2me.essentials.textreader.KeywordReplacer; +import com.earth2me.essentials.textreader.SimpleTextPager; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; @@ -73,7 +76,9 @@ public class EssentialsSpawnPlayerListener implements Listener if (ess.getSettings().getAnnounceNewPlayers()) { - ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); + final IText output = new KeywordReplacer(ess.getSettings().getAnnounceNewPlayerFormat(), user, ess); + final SimpleTextPager pager = new SimpleTextPager(output); + ess.broadcastMessage(user, pager.getString(0)); } LOGGER.log(Level.FINE, "New player join"); -- cgit v1.2.3