KotlinPlugin

abstract class KotlinPlugin : JavaPlugin

Functions

disable
Link copied to clipboard
Disable logic.
abstract fun disable()
enable
Link copied to clipboard
Code to run in the onEnable block.
abstract fun enable()
equals
Link copied to clipboard
operator override fun equals(other: Any?): Boolean
getClassLoader
Link copied to clipboard
override fun getClassLoader(): ClassLoader
getCommand
Link copied to clipboard
open override fun getCommand(@NotNull() p0: String): PluginCommand?
getConfig
Link copied to clipboard
open override fun getConfig(): FileConfiguration
getDataFolder
Link copied to clipboard
override fun getDataFolder(): File
getDefaultWorldGenerator
Link copied to clipboard
open override fun getDefaultWorldGenerator(@NotNull() p0: String, @Nullable() p1: String?): ChunkGenerator?
getDescription
Link copied to clipboard
override fun getDescription(): PluginDescriptionFile
getFile
Link copied to clipboard
open override fun getFile(): File
getLogger
Link copied to clipboard
open override fun getLogger(): Logger
getName
Link copied to clipboard
override fun getName(): String
getPluginLoader
Link copied to clipboard
override fun getPluginLoader(): PluginLoader
getResource
Link copied to clipboard
open override fun getResource(@NotNull() p0: String): InputStream?
getServer
Link copied to clipboard
override fun getServer(): Server
getSLF4JLogger
Link copied to clipboard
open override fun getSLF4JLogger(): Logger
getTextResource
Link copied to clipboard
override fun getTextResource(@NotNull() p0: String): Reader?
hashCode
Link copied to clipboard
override fun hashCode(): Int
init
Link copied to clipboard
override fun init(@NotNull() p0: PluginLoader, @NotNull() p1: Server, @NotNull() p2: PluginDescriptionFile, @NotNull() p3: File, @NotNull() p4: File, @NotNull() p5: ClassLoader)
isEnabled
Link copied to clipboard
override fun isEnabled(): Boolean
isNaggable
Link copied to clipboard
override fun isNaggable(): Boolean
onCommand
Link copied to clipboard
open override fun onCommand(@NotNull() p0: CommandSender, @NotNull() p1: Command, @NotNull() p2: String, @NotNull() p3: Array<String>): Boolean
onDisable
Link copied to clipboard
open override fun onDisable()
onEnable
Link copied to clipboard
We override onEnable to call all of our register methods and then our enable code.
open override fun onEnable()
onLoad
Link copied to clipboard
open override fun onLoad()
onTabComplete
Link copied to clipboard
open override fun onTabComplete(@NotNull() p0: CommandSender, @NotNull() p1: Command, @NotNull() p2: String, @NotNull() p3: Array<String>): MutableList<String>?
registerCommands
Link copied to clipboard
Code to register commands.
abstract fun registerCommands()
registerListeners
Link copied to clipboard
Code the register all the plugins listeners.
abstract fun registerListeners()
registerManagers
Link copied to clipboard
Code to register all managers/api things.
abstract fun registerManagers()
reloadConfig
Link copied to clipboard
open override fun reloadConfig()
saveConfig
Link copied to clipboard
open override fun saveConfig()
saveDefaultConfig
Link copied to clipboard
open override fun saveDefaultConfig()
saveResource
Link copied to clipboard
open override fun saveResource(@NotNull() p0: String, p1: Boolean)
setEnabled
Link copied to clipboard
override fun setEnabled(p0: Boolean)
setNaggable
Link copied to clipboard
override fun setNaggable(p0: Boolean)
toString
Link copied to clipboard
open override fun toString(): String

Properties

classLoader
Link copied to clipboard
override val classLoader: ClassLoader
configFile
Link copied to clipboard
override val configFile: File
dataFolder
Link copied to clipboard
override val dataFolder: File
description
Link copied to clipboard
override val description: PluginDescriptionFile
file
Link copied to clipboard
override val file: File
isEnabled
Link copied to clipboard
override val isEnabled: Boolean
loader
Link copied to clipboard
override val loader: PluginLoader
logger
Link copied to clipboard
override val logger: Logger
naggable
Link copied to clipboard
override val naggable: Boolean
newConfig
Link copied to clipboard
override val newConfig: FileConfiguration
server
Link copied to clipboard
override val server: Server

Extensions

listenForEvent
Link copied to clipboard
Listen for an event as long as this plugin is Enabled. The predicate is optional. It can be nice for quick events, but it also default to true to allow for customization. You can also set ignoreCancelled and priority When this is detected, if the predicate is matched, the action is run
inline fun <T : Event> KotlinPlugin.listenForEvent(ignoreCancelled: Boolean, priority: EventPriority, crossinline predicate: (T) -> Boolean, crossinline action: (T) -> Unit)
waitForEvent
Link copied to clipboard
Wait for an event to occur, then unregister it on a timeout or when the event occurs once. Useful for listening to chat messages for example.
inline fun <T : Event> KotlinPlugin.waitForEvent(timeoutTicks: Long, ignoreCancelled: Boolean, priority: EventPriority, crossinline predicate: (T) -> Boolean, crossinline timeoutAction: () -> Unit, crossinline action: (T) -> Unit)