Documentation

Main extends PluginBase
in package

Table of Contents

$std  : AwaitStd
$config  : Config|null
$configFile  : string
$dataFolder  : string
$description  : PluginDescription
$file  : string
$instance  : self
$isEnabled  : bool
$loader  : PluginLoader
$logger  : PluginLogger
$resourceProvider  : ResourceProvider
$scheduler  : TaskScheduler
$server  : Server
__construct()  : mixed
getCommand()  : Command|PluginOwned|null
getConfig()  : Config
getDataFolder()  : string
Gets the plugin's data folder to save files and configuration.
getDescription()  : PluginDescription
getFullName()  : string
getInstance()  : Main
getLogger()  : AttachableLogger
getName()  : string
getPluginLoader()  : PluginLoader
getResource()  : null|resource
Gets an embedded resource on the plugin file.
getResources()  : array<string|int, SplFileInfo>
Returns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]
getScheduler()  : TaskScheduler
getServer()  : Server
isDisabled()  : bool
isEnabled()  : bool
onCommand()  : bool
onEnable()  : void
Called when the plugin is enabled
onLoad()  : void
Called when the plugin is loaded, before calling onEnable()
reloadConfig()  : void
saveConfig()  : void
saveDefaultConfig()  : bool
saveResource()  : bool
Saves an embedded resource to its relative location in the data folder
getFile()  : string
onDisable()  : void
Called when the plugin is disabled Use this to free open things and finish actions
registerYamlCommands()  : void
Registers commands declared in the plugin manifest

Properties

$std

public static AwaitStd $std

$instance

private static self $instance

Methods

getDataFolder()

Gets the plugin's data folder to save files and configuration.

public final getDataFolder() : string

This directory name has a trailing slash.

Return values
string

getFullName()

public final getFullName() : string
Return values
string

getInstance()

public static getInstance() : Main
Return values
Main

getName()

public final getName() : string
Return values
string

getResource()

Gets an embedded resource on the plugin file.

public getResource(string $filename) : null|resource

WARNING: You must close the resource given using fclose()

Parameters
$filename : string
Return values
null|resource

Resource data, or null

getResources()

Returns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]

public getResources() : array<string|int, SplFileInfo>
Return values
array<string|int, SplFileInfo>

isDisabled()

public final isDisabled() : bool
Return values
bool

isEnabled()

public final isEnabled() : bool
Return values
bool

onCommand()

public onCommand(CommandSender $sender, Command $command, string $label, array<string|int, string> $args) : bool
Parameters
$sender : CommandSender
$command : Command
$label : string
$args : array<string|int, string>
Return values
bool

onEnable()

Called when the plugin is enabled

public onEnable() : void
Return values
void

onLoad()

Called when the plugin is loaded, before calling onEnable()

public onLoad() : void
Return values
void

reloadConfig()

public reloadConfig() : void
Return values
void

saveConfig()

public saveConfig() : void
Return values
void

saveDefaultConfig()

public saveDefaultConfig() : bool
Return values
bool

saveResource()

Saves an embedded resource to its relative location in the data folder

public saveResource(string $filename[, bool $replace = false ]) : bool
Parameters
$filename : string
$replace : bool = false
Return values
bool

getFile()

protected getFile() : string
Return values
string

onDisable()

Called when the plugin is disabled Use this to free open things and finish actions

protected onDisable() : void
Return values
void

registerYamlCommands()

Registers commands declared in the plugin manifest

private registerYamlCommands() : void
Return values
void

Search results