Skip to content

Commit c829a32

Browse files
committedJul 14, 2014
Clean up tempban messages to be a little clearer.
1 parent ae984c2 commit c829a32

30 files changed

+80
-19
lines changed
 

‎Essentials/src/com/earth2me/essentials/commands/Commandban.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void run(final Server server, final CommandSource sender, final String co
6363
banReason = tl("defaultBanReason");
6464
}
6565

66-
Bukkit.getBanList(BanList.Type.NAME).addBan(user.getName(), banReason, null, senderName);
66+
ess.getServer().getBanList(BanList.Type.NAME).addBan(user.getName(), banReason, null, senderName);
6767

6868
String banDisplay = tl("banFormat", banReason, senderName);
6969

‎Essentials/src/com/earth2me/essentials/commands/Commandbanip.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void run(final Server server, final CommandSource sender, final String co
6262
banReason = tl("defaultBanReason");
6363
}
6464

65-
Bukkit.getBanList(BanList.Type.IP).addBan(ipAddress, banReason, null, senderName);
65+
ess.getServer().getBanList(BanList.Type.IP).addBan(ipAddress, banReason, null, senderName);
6666
server.getLogger().log(Level.INFO, tl("playerBanIpAddress", senderName, ipAddress, banReason));
6767

6868
ess.broadcastMessage("essentials.ban.notify", tl("playerBanIpAddress", senderName, ipAddress, banReason));

‎Essentials/src/com/earth2me/essentials/commands/Commandseen.java

+20-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
import com.earth2me.essentials.utils.DateUtil;
88
import com.earth2me.essentials.utils.FormatUtil;
99
import com.earth2me.essentials.utils.StringUtil;
10+
import java.text.DateFormat;
1011
import java.util.ArrayList;
12+
import java.util.Date;
1113
import java.util.List;
1214
import org.bukkit.BanList;
1315
import org.bukkit.Bukkit;
1416
import java.util.UUID;
17+
import org.bukkit.BanEntry;
1518
import org.bukkit.Location;
1619
import org.bukkit.Server;
1720

@@ -56,15 +59,14 @@ protected void seen(final Server server, final CommandSource sender, final Strin
5659
seenIP(server, sender, args[0]);
5760
return;
5861
}
59-
else if (Bukkit.getBanList(BanList.Type.IP).isBanned(args[0]))
62+
else if (ess.getServer().getBanList(BanList.Type.IP).isBanned(args[0]))
6063
{
6164
sender.sendMessage(tl("isIpBanned", args[0]));
6265
return;
6366
}
64-
65-
else if (Bukkit.getBanList(BanList.Type.NAME).isBanned(args[0]))
67+
else if (ess.getServer().getBanList(BanList.Type.NAME).isBanned(args[0]))
6668
{
67-
sender.sendMessage(tl("whoisBanned", showBan ? Bukkit.getBanList(BanList.Type.NAME).getBanEntry(args[0]).getReason() : tl("true")));
69+
sender.sendMessage(tl("whoisBanned", showBan ? ess.getServer().getBanList(BanList.Type.NAME).getBanEntry(args[0]).getReason() : tl("true")));
6870
return;
6971
}
7072
else
@@ -145,7 +147,19 @@ private void seenOffline(final Server server, final CommandSource sender, User u
145147

146148
if (user.getBase().isBanned())
147149
{
148-
sender.sendMessage(tl("whoisBanned", showBan ? Bukkit.getBanList(BanList.Type.NAME).getBanEntry(user.getName()).getReason() : tl("true")));
150+
final BanEntry banEntry = ess.getServer().getBanList(BanList.Type.NAME).getBanEntry(user.getName());
151+
final String reason = showBan ? banEntry.getReason() : tl("true");
152+
sender.sendMessage(tl("whoisBanned", reason));
153+
if (banEntry.getExpiration() != null)
154+
{
155+
Date expiry = banEntry.getExpiration();
156+
String expireString = tl("now");
157+
if (expiry.after(new Date()))
158+
{
159+
expireString = DateUtil.formatDateDiff(expiry.getTime());
160+
}
161+
sender.sendMessage(tl("whoisTempBanned", expireString));
162+
}
149163
}
150164
final String location = user.getGeoLocation();
151165
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show")))
@@ -170,7 +184,7 @@ private void seenIP(final Server server, final CommandSource sender, final Strin
170184
{
171185
final UserMap userMap = ess.getUserMap();
172186

173-
if (Bukkit.getBanList(BanList.Type.IP).isBanned(ipAddress))
187+
if (ess.getServer().getBanList(BanList.Type.IP).isBanned(ipAddress))
174188
{
175189
sender.sendMessage(tl("isIpBanned", ipAddress));
176190
}

‎Essentials/src/com/earth2me/essentials/commands/Commandtempban.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.util.GregorianCalendar;
1010
import java.util.logging.Level;
1111
import org.bukkit.BanList;
12-
import org.bukkit.Bukkit;
1312
import org.bukkit.Server;
1413

1514

@@ -63,13 +62,13 @@ public void run(final Server server, final CommandSource sender, final String co
6362
}
6463

6564
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
66-
Bukkit.getBanList(BanList.Type.NAME).addBan(user.getName(), banReason, new Date(banTimestamp), senderName);
65+
ess.getServer().getBanList(BanList.Type.NAME).addBan(user.getName(), banReason, new Date(banTimestamp), senderName);
66+
final String expiry = DateUtil.formatDateDiff(banTimestamp);
6767

68-
String banDisplay = tl("tempBanned", DateUtil.formatDateDiff(banTimestamp), senderName, banReason);
68+
final String banDisplay = tl("tempBanned", expiry, senderName, banReason);
6969
user.getBase().kickPlayer(banDisplay);
70-
server.getLogger().log(Level.INFO, tl("playerBanned", senderName, user.getName(), banDisplay));
7170

72-
final String message = tl("playerBanned", senderName, user.getName(), banReason, DateUtil.formatDateDiff(banTimestamp));
71+
final String message = tl("playerTempBanned", senderName, user.getName(), expiry, banReason);
7372
server.getLogger().log(Level.INFO, message);
7473
ess.broadcastMessage("essentials.ban.notify", message);
7574
}

‎Essentials/src/com/earth2me/essentials/commands/Commandunban.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void run(final Server server, final CommandSource sender, final String co
3030
{
3131
final User user = getPlayer(server, args, 0, true, true);
3232
name = user.getName();
33-
Bukkit.getBanList(BanList.Type.NAME).pardon(name);
33+
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
3434
}
3535
catch (NoSuchFieldException e)
3636
{
@@ -40,12 +40,12 @@ public void run(final Server server, final CommandSource sender, final String co
4040
{
4141
throw new Exception(tl("playerNotFound"), e);
4242
}
43-
Bukkit.getBanList(BanList.Type.NAME).pardon(name);
43+
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
4444
}
4545

4646
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
4747
server.getLogger().log(Level.INFO, tl("playerUnbanned", senderName, name));
48-
48+
4949
ess.broadcastMessage("essentials.ban.notify", tl("playerUnbanned", senderName, name));
5050
}
5151
}

‎Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void run(final Server server, final CommandSource sender, final String co
2525
{
2626
throw new NotEnoughArgumentsException();
2727
}
28-
28+
2929
String ipAddress;
3030
if (FormatUtil.validIP(args[0]))
3131
{
@@ -48,9 +48,9 @@ public void run(final Server server, final CommandSource sender, final String co
4848
{
4949
throw new PlayerNotFoundException();
5050
}
51-
5251

53-
Bukkit.getBanList(BanList.Type.IP).pardon(ipAddress);
52+
53+
ess.getServer().getBanList(BanList.Type.IP).pardon(ipAddress);
5454
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
5555
server.getLogger().log(Level.INFO, tl("playerUnbanIpAddress", senderName, ipAddress));
5656

‎Essentials/src/messages.properties

+2
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,5 @@ itemsConverted=\u00a76Converted all items into blocks.
552552
itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
556+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_cs.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

Has conversations. Original line has conversations.
556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_da.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_de.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_en.properties

+2
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,5 @@ itemsConverted=\u00a76Converted all items into blocks.
552552
itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
556+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_es.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_et.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_fi.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_fr.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_hu.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_it.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_ko.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_lt.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_nl.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_pl.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_pt.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_pt_BR.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_ro.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_ru.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_sv.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_tr.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_zh.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_zh_HK.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

‎Essentials/src/messages_zh_TW.properties

+2
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,5 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
553553
mailSentTo=\u00a7c{0}\u00a76 has been sent the following mail\:
554554
mailMessage={0}
555555

556+
whoisTempBanned=\u00a76 - Ban expires:\u00a7r {0}
557+
playerTempBanned=\u00a76Player \u00a7c{0}\u00a76 temporarily banned \u00a7c{1}\u00a76 for \u00a7c{2}\u00a76: \u00a7c{3}\u00a76.

0 commit comments

Comments
 (0)
Please sign in to comment.