Package me.remigio07.chatplugin.api
Class ChatPlugin
java.lang.Object
me.remigio07.chatplugin.api.ChatPlugin
ChatPlugin's main class's abstraction.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets ChatPlugin's data folder in plugins folder.static ChatPlugin
Gets ChatPlugin's instance, the main one.int
Gets the time elapsed during ChatPlugin's last reload, in milliseconds.Gets the plugin's logger.Gets the managers' manager.int
Gets the time elapsed during ChatPlugin's startup, in milliseconds.boolean
Checks if ChatPlugin has started correctly.boolean
isLoaded()
Checks if ChatPlugin has finished (re)loading.abstract boolean
Checks if ChatPlugin is running on online mode.abstract boolean
Checks if a licensed copy of ChatPlugin is running.boolean
Checks if a reload is being performed.abstract void
Prints the beautiful start message.abstract int
reload()
Reloads ChatPlugin.abstract void
runConsoleCommand
(String command) Runs a command from the console.abstract void
sendConsoleMessage
(String message, boolean log) Sends a message to the console.abstract int
unload()
Deprecated.Internal use only.
-
Field Details
-
VERSION
String containing the plugin's current version.Content: 🤷
-
-
Constructor Details
-
ChatPlugin
public ChatPlugin()
-
-
Method Details
-
isLoaded
public boolean isLoaded()Checks if ChatPlugin has finished (re)loading.- Returns:
- Whether the plugin is loaded
-
hasStarted
public boolean hasStarted()Checks if ChatPlugin has started correctly.- Returns:
- Whether the plugin has started
-
isReloading
public boolean isReloading()Checks if a reload is being performed.- Returns:
- Whether the plugin is reloading
-
getManagers
Gets the managers' manager. Yeah...- Returns:
- Managers' manager
-
getLogger
Gets the plugin's logger.There are two loggers supported:
java.util.logging.Logger
- Bukkit and BungeeCord environmentsorg.slf4j.Logger
- Sponge and Velocity environments
- Returns:
- Plugin's logger
- See Also:
-
getDataFolder
Gets ChatPlugin's data folder in plugins folder.- Returns:
- Data folder
-
getStartupTime
public int getStartupTime()Gets the time elapsed during ChatPlugin's startup, in milliseconds.- Returns:
- Time elapsed in milliseconds
-
getLastReloadTime
public int getLastReloadTime()Gets the time elapsed during ChatPlugin's last reload, in milliseconds.- Returns:
- Time elapsed in milliseconds
-
getInstance
Gets ChatPlugin's instance, the main one.- Returns:
- Main instance
-
reload
public abstract int reload()Reloads ChatPlugin. Totally.If the reload fails the plugin will be safely disabled and an error message will be sent to the console.
- Returns:
- Time elapsed in milliseconds or 0 if not loaded or -1 if failed
- See Also:
-
unload
Deprecated.Internal use only. You should never need to manually unload ChatPlugin.Unloads ChatPlugin.If the unload fails the plugin will be safely disabled and an error message will be sent to the console.
- Returns:
- Time elapsed in milliseconds or 0 if already unloaded or -1 if failed
- See Also:
-
runConsoleCommand
Runs a command from the console.- Parameters:
command
- Command to run
-
sendConsoleMessage
Sends a message to the console.- Parameters:
message
- Message to sendlog
- Whether toLogManager.writeToFile(String)
the message
-
printStartMessage
public abstract void printStartMessage()Prints the beautiful start message. -
isOnlineMode
public abstract boolean isOnlineMode()Checks if ChatPlugin is running on online mode.- Returns:
- Whether online mode is enabled
- Throws:
IllegalStateException
- If!
Environment.isProxy()
and!
isLoaded()
-
isPremium
public abstract boolean isPremium()Checks if a licensed copy of ChatPlugin is running.- Returns:
- Whether the plugin is premium
-