Skip to content

Commit a7fdfa5

Browse files
committed
Rename /bans and /mutes to /banhistory and /mutehistory
1 parent 6e20f00 commit a7fdfa5

6 files changed

Lines changed: 44 additions & 44 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "me.zavdav"
8-
version = "0.23.1"
8+
version = "0.23.2"
99

1010
repositories {
1111
mavenCentral()

src/main/kotlin/me/zavdav/zcore/command/BansCommand.kt renamed to src/main/kotlin/me/zavdav/zcore/command/BanHistoryCommand.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,71 @@ import org.bukkit.ChatColor
1212
import org.bukkit.command.CommandSender
1313
import 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
}

src/main/kotlin/me/zavdav/zcore/command/CommandDispatcher.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ internal object CommandDispatcher : com.mojang.brigadier.CommandDispatcher<Comma
1717
balanceCommand,
1818
baltopCommand,
1919
banCommand,
20+
banhistoryCommand,
2021
banipCommand,
2122
bankCommand,
22-
bansCommand,
2323
broadcastCommand,
2424
clearCommand,
2525
delhomeCommand,
@@ -46,7 +46,7 @@ internal object CommandDispatcher : com.mojang.brigadier.CommandDispatcher<Comma
4646
movehomeCommand,
4747
msgCommand,
4848
muteCommand,
49-
mutesCommand,
49+
mutehistoryCommand,
5050
nickCommand,
5151
payCommand,
5252
ptsCommand,

src/main/kotlin/me/zavdav/zcore/command/MutesCommand.kt renamed to src/main/kotlin/me/zavdav/zcore/command/MuteHistoryCommand.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ import me.zavdav.zcore.util.local
1010
import org.bukkit.ChatColor
1111
import org.bukkit.command.CommandSender
1212

13-
internal val mutesCommand = command(
14-
"mutes",
13+
internal val mutehistoryCommand = command(
14+
"mutehistory",
1515
"Shows previous mutes of a player",
16-
"zcore.mutes"
16+
"zcore.mutehistory"
1717
) {
1818
offlinePlayerArgument("player") {
1919
runs {
2020
val player: OfflinePlayer by this
21-
doMutes(player, 1)
21+
doMuteHistory(player, 1)
2222
}
2323
intArgument("page") {
2424
runs {
2525
val player: OfflinePlayer by this
2626
val page: Int by this
27-
doMutes(player, page)
27+
doMuteHistory(player, page)
2828
}
2929
}
3030
}
3131
}
3232

33-
private fun CommandContext<CommandSender>.doMutes(target: OfflinePlayer, page: Int) {
33+
private fun CommandContext<CommandSender>.doMuteHistory(target: OfflinePlayer, page: Int) {
3434
val mutes = MuteList.getAllMutes(target).sortedByDescending { it.timeIssued }
3535
val list = PagingList(mutes, 5)
3636
if (list.isEmpty())
37-
throw TranslatableException("command.mutes.none", target.name)
37+
throw TranslatableException("command.mutehistory.none", target.name)
3838

3939
val index = page.coerceIn(1..list.pages()) - 1
40-
source.sendMessage(local("command.mutes", target.name, index + 1, list.pages()))
40+
source.sendMessage(local("command.mutehistory", target.name, index + 1, list.pages()))
4141
source.sendMessage(line(ChatColor.GRAY))
4242

4343
list.page(index).forEach {
4444
val issuer = it.issuer?.name ?: "Console"
4545
val duration = it.duration?.let { dur -> ZCore.formatDuration(dur) } ?: "permanent"
46-
source.sendMessage(local("command.mutes.issued", issuer, ZCore.formatTimestamp(it.timeIssued)))
47-
source.sendMessage(local("command.mutes.details", duration, it.reason, it.pardoned))
46+
source.sendMessage(local("command.mutehistory.issued", issuer, ZCore.formatTimestamp(it.timeIssued)))
47+
source.sendMessage(local("command.mutehistory.details", duration, it.reason, it.pardoned))
4848
}
4949
}

src/main/resources/lang.properties

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ command.ban.permanent = <prefix> Banned {0} permanently: {1}
3030
command.ban.permanent.notify = &cYou are permanently banned: {0}
3131
command.ban.exempt = <prefix> &cCannot ban player {0}
3232

33+
command.banhistory = <prefix> Bans of {0}: (p. {1}/{2})
34+
command.banhistory.issued = &aBan issued by {0} at {1}
35+
command.banhistory.details = &aDuration: {0} | Reason: {1} | Pardoned: {2}
36+
command.banhistory.none = <prefix> &cPlayer {0} does not have any bans
37+
command.banhistory.ip.none = <prefix> &cIP address {0} does not have any bans
38+
3339
command.banip.temporary = <prefix> Banned {0} for {1}: {2}
3440
command.banip.temporary.notify = &cYour IP address is banned for {0}: {1}
3541
command.banip.permanent = <prefix> Banned {0} permanently: {1}
@@ -82,12 +88,6 @@ command.bank.action.owner = <prefix> &cMust be owner of the bank {0}
8288
command.bank.action.member = <prefix> &cMust be a member of the bank {0}
8389
command.bank.insufficient = <prefix> &cInsufficient funds
8490

85-
command.bans = <prefix> Bans of {0}: (p. {1}/{2})
86-
command.bans.issued = &aBan issued by {0} at {1}
87-
command.bans.details = &aDuration: {0} | Reason: {1} | Pardoned: {2}
88-
command.bans.none = <prefix> &cPlayer {0} does not have any bans
89-
command.bans.ip.none = <prefix> &cIP address {0} does not have any bans
90-
9191
command.broadcast = &a[Broadcast] {0}
9292

9393
command.clear = <prefix> Cleared the inventory of {0}
@@ -178,10 +178,10 @@ command.mute.permanent = <prefix> Muted {0} permanently: {1}
178178
command.mute.permanent.notify = &cYou are permanently muted: {0}
179179
command.mute.exempt = <prefix> &cCannot mute player {0}
180180

181-
command.mutes = <prefix> Mutes of {0}: (p. {1}/{2})
182-
command.mutes.issued = &aMute issued by {0} at {1}
183-
command.mutes.details = &aDuration: {0} | Reason: {1} | Pardoned: {2}
184-
command.mutes.none = <prefix> &cPlayer {0} does not have any mutes
181+
command.mutehistory = <prefix> Mutes of {0}: (p. {1}/{2})
182+
command.mutehistory.issued = &aMute issued by {0} at {1}
183+
command.mutehistory.details = &aDuration: {0} | Reason: {1} | Pardoned: {2}
184+
command.mutehistory.none = <prefix> &cPlayer {0} does not have any mutes
185185

186186
command.nick = <prefix> Set the nickname of {0} to {1}
187187
command.nick.empty = <prefix> &cNickname cannot be empty

src/main/resources/plugin.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ permissions:
3434
zcore.ban:
3535
default: op
3636

37+
zcore.banhistory:
38+
default: op
39+
3740
zcore.banip:
3841
default: op
3942

@@ -48,9 +51,6 @@ permissions:
4851
zcore.bank: true
4952
zcore.bank.op: true
5053

51-
zcore.bans:
52-
default: op
53-
5454
zcore.broadcast:
5555
default: op
5656

@@ -264,7 +264,7 @@ permissions:
264264
zcore.mute:
265265
default: op
266266

267-
zcore.mutes:
267+
zcore.mutehistory:
268268
default: op
269269

270270
zcore.nick:

0 commit comments

Comments
 (0)