All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.afternode.commons.bukkit.kotlin.PluginReportExt.kt Maven / Gradle / Ivy

The newest version!
package cn.afternode.commons.bukkit.kotlin

import cn.afternode.commons.bukkit.report.PluginInfoElement
import cn.afternode.commons.bukkit.report.PluginListElement
import cn.afternode.commons.bukkit.report.PluginReport
import org.bukkit.plugin.Plugin

/**
 * Create plugin report
 * @see PluginReport
 */
fun pluginReport(plugin: Plugin, block: PluginReport.() -> Unit): PluginReport {
    val report = PluginReport(plugin)
    block(report)
    return report
}

/**
 * @see PluginInfoElement
 * @see PluginReport.withPluginInfo
 */
fun PluginReport.info(plugin: Plugin, block: PluginInfoElement.() -> Unit) {
    val info = PluginInfoElement(plugin)
    block(info)
    this.appendElement(info)
}

/**
 * @see PluginListElement
 * @see PluginReport.withPluginList
 */
fun PluginReport.list(block: PluginListElement.() -> Unit) {
    val list = PluginListElement()
    block(list)
    this.appendElement(list)
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy