public class SpongePlugin extends Object implements ViaPlatform<org.spongepowered.api.entity.living.player.Player>
Constructor and Description |
---|
SpongePlugin() |
Modifier and Type | Method and Description |
---|---|
void |
cancelTask(TaskId taskId)
Cancel a task
|
SpongeViaAPI |
getApi()
Get the API for this platform
|
SpongeViaConfig |
getConf()
Get the config API for this platform
|
ConfigurationProvider |
getConfigurationProvider()
Get the backend configuration provider for this platform.
|
ViaConnectionManager |
getConnectionManager() |
File |
getDataFolder()
Get ViaVersions's data folder.
|
com.google.gson.JsonObject |
getDump()
Get the JSON data required for /viaversion dump
|
Logger |
getLogger()
Get the logger for this platform
|
ViaCommandSender[] |
getOnlinePlayers()
Get the online players
|
String |
getPlatformName()
Get the platform name
|
String |
getPlatformVersion()
Get the platform version
|
String |
getPluginVersion()
Get the plugin version
|
boolean |
isOldClientsAllowed()
Get if older clients are allowed to be used using ViaVersion.
|
boolean |
isPluginEnabled()
Check if the plugin is enabled.
|
boolean |
kickPlayer(UUID uuid,
String message)
Kick a player for a reason
|
void |
onGameStart(org.spongepowered.api.event.game.state.GameInitializationEvent event) |
void |
onReload()
Called when a reload happens
|
void |
onServerStart(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent event) |
void |
onServerStop(org.spongepowered.api.event.game.state.GameStoppingServerEvent event) |
TaskId |
runAsync(Runnable runnable)
Run a task Async
|
TaskId |
runRepeatingSync(Runnable runnable,
Long ticks)
Run a task at a repeating interval.
|
TaskId |
runSync(Runnable runnable)
Run a task Sync
|
TaskId |
runSync(Runnable runnable,
Long ticks)
Run a task Sync after a interval
This must be only used after plugin enable.
|
void |
sendMessage(UUID uuid,
String message)
Send a message to a player
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disconnect, isProxy
public void onGameStart(org.spongepowered.api.event.game.state.GameInitializationEvent event)
public void onServerStart(org.spongepowered.api.event.game.state.GameAboutToStartServerEvent event)
public void onServerStop(org.spongepowered.api.event.game.state.GameStoppingServerEvent event)
public String getPlatformName()
ViaPlatform
getPlatformName
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public String getPlatformVersion()
ViaPlatform
getPlatformVersion
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public String getPluginVersion()
ViaPlatform
getPluginVersion
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public TaskId runAsync(Runnable runnable)
ViaPlatform
runAsync
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
runnable
- The task to runpublic TaskId runSync(Runnable runnable)
ViaPlatform
runSync
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
runnable
- The task to runpublic TaskId runSync(Runnable runnable, Long ticks)
ViaPlatform
runSync
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
runnable
- The task to runticks
- The interval to run it afterpublic TaskId runRepeatingSync(Runnable runnable, Long ticks)
ViaPlatform
runRepeatingSync
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
runnable
- The task to runticks
- The interval to run it atpublic void cancelTask(TaskId taskId)
ViaPlatform
cancelTask
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
taskId
- The task ID to cancelpublic ViaCommandSender[] getOnlinePlayers()
ViaPlatform
getOnlinePlayers
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public void sendMessage(UUID uuid, String message)
ViaPlatform
sendMessage
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
uuid
- The player's UUIDmessage
- The message to sendpublic boolean kickPlayer(UUID uuid, String message)
ViaPlatform
kickPlayer
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
uuid
- The player's UUIDmessage
- The message to kick them withpublic boolean isPluginEnabled()
ViaPlatform
isPluginEnabled
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public ConfigurationProvider getConfigurationProvider()
ViaPlatform
getConfigurationProvider
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public File getDataFolder()
ViaPlatform
getDataFolder
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public void onReload()
ViaPlatform
onReload
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public com.google.gson.JsonObject getDump()
ViaPlatform
getDump
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public boolean isOldClientsAllowed()
ViaPlatform
isOldClientsAllowed
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public ViaConnectionManager getConnectionManager()
getConnectionManager
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public SpongeViaAPI getApi()
ViaPlatform
getApi
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public SpongeViaConfig getConf()
ViaPlatform
getConf
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
public Logger getLogger()
ViaPlatform
getLogger
in interface ViaPlatform<org.spongepowered.api.entity.living.player.Player>
Copyright © 2016–2021. All rights reserved.