summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
diff options
context:
space:
mode:
authorKhyperia <khyperia@live.com>2011-12-01 10:02:57 +0800
committersnowleo <schneeleo@gmail.com>2011-12-02 08:42:48 +0800
commit2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830 (patch)
tree1da9440d5ed61a1357db89877fbeb0975c7b8648 /Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
parent8e4bddba2afed1bb4001b014f1437f4c13b73841 (diff)
downloadEssentials-2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830.tar
Essentials-2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830.tar.gz
Essentials-2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830.tar.lz
Essentials-2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830.tar.xz
Essentials-2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830.zip
Added {DATE} and {TIME} to motd
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
index 29e44a682..84cd63f68 100644
--- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
+++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
@@ -2,6 +2,8 @@ package com.earth2me.essentials.textreader;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import org.bukkit.World;
@@ -24,7 +26,7 @@ public class KeywordReplacer implements IText
private void replaceKeywords(final CommandSender sender)
{
String displayName, ipAddress, balance, mails, world;
- String worlds, online, unique, playerlist;
+ String worlds, online, unique, playerlist, date, time;
if (sender instanceof Player)
{
final User user = ess.getUser(sender);
@@ -75,6 +77,9 @@ public class KeywordReplacer implements IText
playerlistBuilder.append(p.getDisplayName());
}
playerlist = playerlistBuilder.toString();
+
+ date = new SimpleDateFormat("MMMM/dd/yyyy").format(new Date());
+ time = new SimpleDateFormat("hh:mm:ss").format(new Date());
for (int i = 0; i < input.getLines().size(); i++)
{
@@ -88,6 +93,8 @@ public class KeywordReplacer implements IText
line = line.replace("{UNIQUE}", unique);
line = line.replace("{WORLDS}", worlds);
line = line.replace("{PLAYERLIST}", playerlist);
+ line = line.replace("{TIME}", time);
+ line = line.replace("{DATE}", date);
input.getLines().set(i, line);
}
}