Class AbstractADPPlugin
- java.lang.Object
-
- com.alessiodp.core.common.bootstrap.AbstractADPPlugin
-
- All Implemented Interfaces:
ADPBootstrap
- Direct Known Subclasses:
ADPPlugin
public abstract class AbstractADPPlugin extends Object implements ADPBootstrap
-
-
Constructor Summary
Constructors Constructor Description AbstractADPPlugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecuteCommand(@NotNull String command)Execute the command via consolevoidexecuteCommandByUser(@NotNull String command, @NotNull User user)Execute the command via console@NotNull StringgetAuthor()Get plugin author@NotNull ADPBootstrapgetBootstrap()Get bootstrapabstract intgetBstatsId()Get bStats plugin id@NotNull PathgetFolder()Get plugin folder@Nullable OfflineUsergetOfflinePlayer(@NotNull UUID uuid)Get offline player with given uuid@NotNull List<User>getOnlinePlayers()Get online players listabstract @NotNull StringgetPackageName()Get the package name@NotNull PluginPlatformgetPlatform()Get plugin platform@Nullable UsergetPlayer(@NotNull UUID uuid)Get player with given uuid@Nullable UsergetPlayerByName(@NotNull String name)Get player with given nameabstract @NotNull StringgetPluginFallbackName()Get plugin fallback nameabstract @NotNull StringgetPluginName()Get plugin name@Nullable InputStreamgetResource(@NotNull String resource)Get resource from plugin resources@NotNull StringgetVersion()Get plugin version@NotNull ADPLoggerinitializeLogger()Initialize plugin loggerbooleanisPluginEnabled(@NotNull String pluginName)Is the plugin enabled?voidregisterListener(@NotNull Object object)Register a listenervoidstopPlugin()Stop the pluginvoidunregisterListener(@NotNull Object object)Unregister a listener
-
-
-
Method Detail
-
getBootstrap
@NotNull public @NotNull ADPBootstrap getBootstrap()
Description copied from interface:ADPBootstrapGet bootstrap- Specified by:
getBootstrapin interfaceADPBootstrap- Returns:
- the bootstrap
-
initializeLogger
@NotNull public @NotNull ADPLogger initializeLogger()
Description copied from interface:ADPBootstrapInitialize plugin logger- Specified by:
initializeLoggerin interfaceADPBootstrap- Returns:
- the logger
-
getFolder
@NotNull public @NotNull Path getFolder()
Description copied from interface:ADPBootstrapGet plugin folder- Specified by:
getFolderin interfaceADPBootstrap- Returns:
- the plugin folder path
-
getAuthor
@NotNull public @NotNull String getAuthor()
Description copied from interface:ADPBootstrapGet plugin author- Specified by:
getAuthorin interfaceADPBootstrap- Returns:
- the author of the plugin
-
getPlatform
@NotNull public @NotNull PluginPlatform getPlatform()
Description copied from interface:ADPBootstrapGet plugin platform- Specified by:
getPlatformin interfaceADPBootstrap- Returns:
- the
PluginPlatform
-
getVersion
@NotNull public @NotNull String getVersion()
Description copied from interface:ADPBootstrapGet plugin version- Specified by:
getVersionin interfaceADPBootstrap- Returns:
- the version of the plugin
-
stopPlugin
public void stopPlugin()
Description copied from interface:ADPBootstrapStop the plugin- Specified by:
stopPluginin interfaceADPBootstrap
-
getResource
@Nullable public @Nullable InputStream getResource(@NotNull @NotNull String resource)
Description copied from interface:ADPBootstrapGet resource from plugin resources- Specified by:
getResourcein interfaceADPBootstrap- Parameters:
resource- the resource name- Returns:
- the resource found
-
isPluginEnabled
public boolean isPluginEnabled(@NotNull @NotNull String pluginName)Description copied from interface:ADPBootstrapIs the plugin enabled?- Specified by:
isPluginEnabledin interfaceADPBootstrap- Parameters:
pluginName- the name of the plugin- Returns:
- true if the given plugin is enabled
-
getPlayer
@Nullable public @Nullable User getPlayer(@NotNull @NotNull UUID uuid)
Description copied from interface:ADPBootstrapGet player with given uuid- Specified by:
getPlayerin interfaceADPBootstrap- Parameters:
uuid- uuid of the player- Returns:
- the player found
-
getPlayerByName
@Nullable public @Nullable User getPlayerByName(@NotNull @NotNull String name)
Description copied from interface:ADPBootstrapGet player with given name- Specified by:
getPlayerByNamein interfaceADPBootstrap- Parameters:
name- name of the player- Returns:
- the player found
-
getOfflinePlayer
@Nullable public @Nullable OfflineUser getOfflinePlayer(@NotNull @NotNull UUID uuid)
Description copied from interface:ADPBootstrapGet offline player with given uuid- Specified by:
getOfflinePlayerin interfaceADPBootstrap- Parameters:
uuid- uuid of the player- Returns:
- the offline player found
-
getOnlinePlayers
@NotNull public @NotNull List<User> getOnlinePlayers()
Description copied from interface:ADPBootstrapGet online players list- Specified by:
getOnlinePlayersin interfaceADPBootstrap- Returns:
- a list of online players
-
executeCommand
public void executeCommand(@NotNull @NotNull String command)Description copied from interface:ADPBootstrapExecute the command via console- Specified by:
executeCommandin interfaceADPBootstrap- Parameters:
command- the command to execute
-
executeCommandByUser
public void executeCommandByUser(@NotNull @NotNull String command, @NotNull @NotNull User user)Description copied from interface:ADPBootstrapExecute the command via console- Specified by:
executeCommandByUserin interfaceADPBootstrap- Parameters:
command- the command to executeuser- the user executor
-
registerListener
public void registerListener(@NotNull @NotNull Object object)Description copied from interface:ADPBootstrapRegister a listener- Specified by:
registerListenerin interfaceADPBootstrap- Parameters:
object- the listener to register
-
unregisterListener
public void unregisterListener(@NotNull @NotNull Object object)Description copied from interface:ADPBootstrapUnregister a listener- Specified by:
unregisterListenerin interfaceADPBootstrap- Parameters:
object- the listener to unregister
-
getPluginName
@NotNull public abstract @NotNull String getPluginName()
Get plugin name- Returns:
- the name of the plugin
-
getPluginFallbackName
@NotNull public abstract @NotNull String getPluginFallbackName()
Get plugin fallback name- Returns:
- the fallback name of the plugin
-
getBstatsId
public abstract int getBstatsId()
Get bStats plugin id- Returns:
- the id of the plugin
-
getPackageName
@NotNull public abstract @NotNull String getPackageName()
Get the package name- Returns:
- the package name
-
-