@@ -27,7 +27,7 @@ object CommandSounds : CommandExpression {
2727 override val command = subCommand {
2828 dynamic (optional = true ) {
2929 suggestion<Player >(uncheck = true ) { _, _ ->
30- XSound .values ().map { it.name }
30+ XSound .getValues ().map { it.name() }
3131 }
3232
3333 execute<Player > { sender, _, argument ->
@@ -40,9 +40,8 @@ object CommandSounds : CommandExpression {
4040 }
4141
4242 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() }
44+ .let { it.subList(54 * page, it.size) }
4645
4746 val prevNext = arrayOf(page > 0 , sounds.size > 54 )
4847 val receptacle = ChestInventory (6 , player.asLangText(" Menu-Internal-Sounds-Title" , page, filter ? : " *" ))
@@ -57,7 +56,7 @@ object CommandSounds : CommandExpression {
5756 receptacle.setElement(CTRL , ctrl)
5857
5958 slotMap.forEach { (slot, index) ->
60- receptacle.setElement(DISPLAY (sounds[index].name), slot)
59+ receptacle.setElement(DISPLAY (sounds[index].name() ), slot)
6160 }
6261
6362 receptacle.onOpen = { player, _ ->
@@ -88,7 +87,7 @@ object CommandSounds : CommandExpression {
8887 ReceptacleClickType .DROP -> sound.play(player, 1f , 0f )
8988 ReceptacleClickType .LEFT -> sound.play(player, 1f , 1f )
9089 ReceptacleClickType .RIGHT -> sound.play(player, 1f , 2f )
91- ReceptacleClickType .MIDDLE -> player.sendLang(" Menu-Internal-Sounds-Copy" , sound.name)
90+ ReceptacleClickType .MIDDLE -> player.sendLang(" Menu-Internal-Sounds-Copy" , sound.name() )
9291 else -> {
9392 }
9493 }
0 commit comments