@@ -27,7 +27,7 @@ object CommandSounds : CommandExpression {
27
27
override val command = subCommand {
28
28
dynamic (optional = true ) {
29
29
suggestion<Player >(uncheck = true ) { _, _ ->
30
- XSound .values ().map { it.name }
30
+ XSound .getValues ().map { it.name() }
31
31
}
32
32
33
33
execute<Player > { sender, _, argument ->
@@ -40,9 +40,7 @@ object CommandSounds : CommandExpression {
40
40
}
41
41
42
42
private fun open (player : Player , page : Int , filter : String? ) {
43
- val sounds = XSound .values().filter { filter == null || it.name.contains(filter, true ) }.sorted().let {
44
- it.subList(54 * page, it.size)
45
- }
43
+ val sounds = XSound .getValues().filter { filter == null || it.name().contains(filter, true ) }.sortedBy { it.name() }.subList(54 * page, it.size)
46
44
47
45
val prevNext = arrayOf(page > 0 , sounds.size > 54 )
48
46
val receptacle = ChestInventory (6 , player.asLangText(" Menu-Internal-Sounds-Title" , page, filter ? : " *" ))
@@ -57,7 +55,7 @@ object CommandSounds : CommandExpression {
57
55
receptacle.setElement(CTRL , ctrl)
58
56
59
57
slotMap.forEach { (slot, index) ->
60
- receptacle.setElement(DISPLAY (sounds[index].name), slot)
58
+ receptacle.setElement(DISPLAY (sounds[index].name() ), slot)
61
59
}
62
60
63
61
receptacle.onOpen = { player, _ ->
@@ -88,7 +86,7 @@ object CommandSounds : CommandExpression {
88
86
ReceptacleClickType .DROP -> sound.play(player, 1f , 0f )
89
87
ReceptacleClickType .LEFT -> sound.play(player, 1f , 1f )
90
88
ReceptacleClickType .RIGHT -> sound.play(player, 1f , 2f )
91
- ReceptacleClickType .MIDDLE -> player.sendLang(" Menu-Internal-Sounds-Copy" , sound.name)
89
+ ReceptacleClickType .MIDDLE -> player.sendLang(" Menu-Internal-Sounds-Copy" , sound.name() )
92
90
else -> {
93
91
}
94
92
}
0 commit comments