@@ -12,71 +12,71 @@ import org.bukkit.ChatColor
1212import org.bukkit.command.CommandSender
1313import java.net.Inet4Address
1414
15- internal val bansCommand = command(
16- " bans " ,
15+ internal val banhistoryCommand = command(
16+ " banhistory " ,
1717 " Shows previous bans of a player or an IP address" ,
18- " zcore.bans "
18+ " zcore.banhistory "
1919) {
2020 offlinePlayerArgument(" player" ) {
2121 runs {
2222 val player: OfflinePlayer by this
23- doBans (player, 1 )
23+ doBanHistory (player, 1 )
2424 }
2525 intArgument(" page" ) {
2626 runs {
2727 val player: OfflinePlayer by this
2828 val page: Int by this
29- doBans (player, page)
29+ doBanHistory (player, page)
3030 }
3131 }
3232 }
3333 inet4AddressArgument(" address" ) {
3434 runs {
3535 val address: Inet4Address by this
36- doBans (address, 1 )
36+ doBanHistory (address, 1 )
3737 }
3838 intArgument(" page" ) {
3939 runs {
4040 val address: Inet4Address by this
4141 val page: Int by this
42- doBans (address, page)
42+ doBanHistory (address, page)
4343 }
4444 }
4545 }
4646}
4747
48- private fun CommandContext<CommandSender>.doBans (target : OfflinePlayer , page : Int ) {
48+ private fun CommandContext<CommandSender>.doBanHistory (target : OfflinePlayer , page : Int ) {
4949 val bans = BanList .getAllBans(target).sortedByDescending { it.timeIssued }
5050 val list = PagingList (bans, 5 )
5151 if (list.isEmpty())
52- throw TranslatableException (" command.bans .none" , target.name)
52+ throw TranslatableException (" command.banhistory .none" , target.name)
5353
5454 val index = page.coerceIn(1 .. list.pages()) - 1
55- source.sendMessage(local(" command.bans " , target.name, index + 1 , list.pages()))
55+ source.sendMessage(local(" command.banhistory " , target.name, index + 1 , list.pages()))
5656 source.sendMessage(line(ChatColor .GRAY ))
5757
5858 list.page(index).forEach {
5959 val issuer = it.issuer?.name ? : " Console"
6060 val duration = it.duration?.let { dur -> ZCore .formatDuration(dur) } ? : " permanent"
61- source.sendMessage(local(" command.bans .issued" , issuer, ZCore .formatTimestamp(it.timeIssued)))
62- source.sendMessage(local(" command.bans .details" , duration, it.reason, it.pardoned))
61+ source.sendMessage(local(" command.banhistory .issued" , issuer, ZCore .formatTimestamp(it.timeIssued)))
62+ source.sendMessage(local(" command.banhistory .details" , duration, it.reason, it.pardoned))
6363 }
6464}
6565
66- private fun CommandContext<CommandSender>.doBans (target : Inet4Address , page : Int ) {
66+ private fun CommandContext<CommandSender>.doBanHistory (target : Inet4Address , page : Int ) {
6767 val bans = IpBanList .getAllBans(target).sortedByDescending { it.timeIssued }
6868 val list = PagingList (bans, 5 )
6969 if (list.isEmpty())
70- throw TranslatableException (" command.bans .ip.none" , target.hostAddress)
70+ throw TranslatableException (" command.banhistory .ip.none" , target.hostAddress)
7171
7272 val index = page.coerceIn(1 .. list.pages()) - 1
73- source.sendMessage(local(" command.bans " , target.hostAddress, index + 1 , list.pages()))
73+ source.sendMessage(local(" command.banhistory " , target.hostAddress, index + 1 , list.pages()))
7474 source.sendMessage(line(ChatColor .GRAY ))
7575
7676 list.page(index).forEach {
7777 val issuer = it.issuer?.name ? : " Console"
7878 val duration = it.duration?.let { dur -> ZCore .formatDuration(dur) } ? : " permanent"
79- source.sendMessage(local(" command.bans .issued" , issuer, ZCore .formatTimestamp(it.timeIssued)))
80- source.sendMessage(local(" command.bans .details" , duration, it.reason, it.pardoned))
79+ source.sendMessage(local(" command.banhistory .issued" , issuer, ZCore .formatTimestamp(it.timeIssued)))
80+ source.sendMessage(local(" command.banhistory .details" , duration, it.reason, it.pardoned))
8181 }
8282}
0 commit comments