Cursed refactor ?
This commit is contained in:
@@ -84,7 +84,11 @@ class CommandGiveRandomBook(plugin: EcoPlugin) : PluginCommand(
|
||||
1 -> Bukkit.getOnlinePlayers().map { it.name }
|
||||
2 -> (EnchantmentRarities.values().map { it.id } + EnchantmentTypes.values().map { it.id })
|
||||
3 -> (1..10).map { it.toString() }
|
||||
4 -> ((args[3].toIntOrNull() ?: 1)..(args[3].toIntOrNull() ?: 1) + 10).map { it.toString() }
|
||||
4 -> {
|
||||
val startLevel = args[3].toIntOrNull() ?: 1
|
||||
val endLevel = startLevel + 10
|
||||
(startLevel..endLevel).map { it.toString() }
|
||||
}
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user