public class AnnoyingPlugin
extends org.bukkit.plugin.java.JavaPlugin
| Modifier and Type | Field and Description |
|---|---|
@Nullable org.bstats.bukkit.Metrics |
bStats
The
bStats instance for the plugin |
@NotNull java.util.Map<java.util.UUID,java.util.Map<AnnoyingCooldown.CooldownType,java.lang.Long>> |
cooldowns
Stores the cooldowns for each player/type
|
@NotNull java.util.Map<java.util.UUID,AnnoyingData> |
entityDataFiles
Caches the data files for entities, used in
EntityData |
@NotNull java.util.Map<java.lang.String,java.lang.String> |
globalPlaceholders
ChatColor aliases for the plugin from the messages file (MessagesOptions.MessageKeys#globalPlaceholders) |
static @NotNull java.util.logging.Logger |
LOGGER
The
Logger for the plugin |
@Nullable AnnoyingResource |
messages
The
AnnoyingResource that contains the plugin's messages |
static @NotNull xyz.srnyx.javautilities.objects.SemanticVersion |
MINECRAFT_VERSION
The Minecraft version the server is running
|
@NotNull AnnoyingOptions |
options
The API options for the plugin
|
boolean |
papiInstalled
Whether PlaceholderAPI is installed
|
@NotNull java.util.Set<Registrable> |
registeredClasses
Set of registered
Registrables by the plugin |
| Constructor and Description |
|---|
AnnoyingPlugin()
Constructs a new
AnnoyingPlugin instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkUpdate()
|
void |
disable()
Called when the plugin is disabled
|
void |
disablePlugin()
Disables the plugin.
|
void |
enable()
Called after dependency checks, start-up messages, and command/listener registration.
|
@NotNull java.lang.String |
getMessagesString(@NotNull java.lang.String key)
Gets a string from
messages with the specified key |
void |
load()
Called when the plugin is loaded
|
void |
loadMessages()
Loads the messages.yml file to
messages and globalPlaceholders |
static void |
log(@Nullable java.util.logging.Level level,
@Nullable java.lang.String message)
Logs a message to the console
|
static void |
log(@NotNull java.lang.String message)
|
void |
onDisable()
Called when the plugin is disabled
|
void |
onEnable()
Called when the plugin is enabled.
|
void |
onLoad()
Called after a plugin is loaded but before it has been enabled.
|
@NotNull java.lang.String |
parsePapiPlaceholders(@Nullable org.bukkit.OfflinePlayer player,
@Nullable java.lang.String message)
Parses all PlaceholderAPI placeholders in a message
|
void |
reload()
Called when the plugin is reloaded
|
void |
reloadPlugin()
Reloads the plugin (
messages, etc...). |
void |
unregisterClasses()
Unregisters all
Registrables in registeredClasses |
getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, initialize, installDDL, isEnabled, isInitialized, isNaggable, onCommand, onTabComplete, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString@NotNull public static @NotNull java.util.logging.Logger LOGGER
Logger for the plugin@NotNull public static final @NotNull xyz.srnyx.javautilities.objects.SemanticVersion MINECRAFT_VERSION
@NotNull public final @NotNull AnnoyingOptions options
@Nullable public @Nullable org.bstats.bukkit.Metrics bStats
bStats instance for the plugin@Nullable public @Nullable AnnoyingResource messages
AnnoyingResource that contains the plugin's messages@NotNull public final @NotNull java.util.Map<java.lang.String,java.lang.String> globalPlaceholders
ChatColor aliases for the plugin from the messages file (MessagesOptions.MessageKeys#globalPlaceholders)MessagesOptions.MessageKeys#globalPlaceholders@NotNull public final @NotNull java.util.Set<Registrable> registeredClasses
Registrables by the plugin@NotNull public final @NotNull java.util.Map<java.util.UUID,java.util.Map<AnnoyingCooldown.CooldownType,java.lang.Long>> cooldowns
@NotNull public final @NotNull java.util.Map<java.util.UUID,AnnoyingData> entityDataFiles
EntityDatapublic boolean papiInstalled
public AnnoyingPlugin()
AnnoyingPlugin instance. Registers event handlers for custom eventspublic final void onLoad()
Do not try to override this method! Override load() instead
onLoad in interface org.bukkit.plugin.PluginonLoad in class org.bukkit.plugin.java.JavaPluginload()public final void onEnable()
Do not try to override this method! Override enable() instead
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginenable()public final void onDisable()
Do not try to override this method! Override disable() instead
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPlugindisable()public void load()
public void enable()
public void disable()
public void reload()
reloadPlugin()public void reloadPlugin()
messages, etc...). This will not trigger onLoad() or onEnable()
This is not run automatically (such as onEnable() and onDisable()), it is to be used manually by the plugin itself (ex: in a /reload command)
Do not try to override this method! Override reload() instead
reload()public void loadMessages()
messages and globalPlaceholderspublic void disablePlugin()
PluginManager.disablePlugin(Plugin)
This is not meant to be overriden, only override if you know what you're doing!
@NotNull
public @NotNull java.lang.String getMessagesString(@NotNull
@NotNull java.lang.String key)
messages with the specified keykey - the key of the stringkey if messages is null or the string is not found@NotNull
public @NotNull java.lang.String parsePapiPlaceholders(@Nullable
@Nullable org.bukkit.OfflinePlayer player,
@Nullable
@Nullable java.lang.String message)
player - the OfflinePlayer to parse the placeholders for (or null if none)message - the message to parsepublic void unregisterClasses()
Registrables in registeredClassespublic void checkUpdate()
AnnoyingUpdatepublic static void log(@Nullable
@Nullable java.util.logging.Level level,
@Nullable
@Nullable java.lang.String message)
level - the level of the message. If null, Level.INFO will be usedmessage - the message to logpublic static void log(@NotNull
@NotNull java.lang.String message)
message - the message to log