Package nl.mtvehicles.core
Class Main
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
nl.mtvehicles.core.Main
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public class Main
extends org.bukkit.plugin.java.JavaPlugin
The plugin's main class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringVersion of config.yml AND vehicles.yml - must be equal to the version in SuperSecretSettings.
We might not change config in every version, why bother creating a new config file on every update then?static MainThe plugin instancestatic final StringVersion of messages_xx.yml files - must be equal to the version in SuperSecretSettings.
This variable works exactly asconfigVersion. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisable the plugin (when a fatal error occurs)static Stringstatic booleanCheck if all objects are not nullstatic voidLog an informative message to the consolestatic voidLog a message warning about a severe issue to the console (red)static voidlogWarning(String text) Log a warning to the console (yellow)voidvoidonEnable()voidonLoad()voidregisterListener(org.bukkit.event.Listener listener) Register a listenerstatic voidschedulerRun(Runnable task) Run a task using a bukkit schedulerMethods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getLog4JLogger, getSLF4JLogger
-
Field Details
-
instance
The plugin instance -
configVersion
Version of config.yml AND vehicles.yml - must be equal to the version in SuperSecretSettings.
We might not change config in every version, why bother creating a new config file on every update then? Change this EVERY TIME you edit config. OTHERWISE, DON'T TOUCH IT.- See Also:
-
messagesVersion
Version of messages_xx.yml files - must be equal to the version in SuperSecretSettings.
This variable works exactly asconfigVersion.- See Also:
-
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
onEnable
public void onEnable()- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
onLoad
public void onLoad()- Specified by:
onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
onLoadin classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
getFileAsString
-
registerListener
public void registerListener(org.bukkit.event.Listener listener) Register a listener- See Also:
-
disablePlugin
public static void disablePlugin()Disable the plugin (when a fatal error occurs) -
logInfo
Log an informative message to the console -
logWarning
Log a warning to the console (yellow) -
logSevere
Log a message warning about a severe issue to the console (red) -
schedulerRun
Run a task using a bukkit scheduler -
isNotNull
Check if all objects are not null- Parameters:
objects- Objects to check- Returns:
- True if all objects are not null, false otherwise
-