1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-10 16:48:05 +02:00

Adding full keyword support for newb join message.

Also adding {ADDRESS} and {USERNAME} as new keywords.
This commit is contained in:
KHobbits
2012-02-18 21:09:18 +00:00
parent 94a553f3ec
commit f680bd4bd6
7 changed files with 105 additions and 30 deletions

View File

@@ -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");