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

    Fields
    Modifier and Type
    Field
    Description
    static String
    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.
    static Main
    The plugin instance
    static String
    Version of messages_xx.yml files - must be equal to the version in SuperSecretSettings.
    This variable works exactly as configVersion.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Disable the plugin (when a fatal error occurs)
    static String
     
    static void
    logInfo​(String text)
    Log an informative message to the console
    static void
    logSevere​(String text)
    Log a message warning about a severe issue to the console (red)
    static void
    logWarning​(String text)
    Log a warning to the console (yellow)
    void
     
    void
     
    void
     
    void
    registerListener​(org.bukkit.event.Listener listener)
    Register a listener
    static void
    Run a task using a bukkit scheduler

    Methods 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, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getLog4JLogger, getSLF4JLogger
  • Field Details

    • instance

      public static Main instance
      The plugin instance
    • configVersion

      public static final String 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:
      SecretSettingsConfig, Constant Field Values
    • messagesVersion

      public static final String messagesVersion
      Version of messages_xx.yml files - must be equal to the version in SuperSecretSettings.
      This variable works exactly as configVersion.
      See Also:
      Constant Field Values
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface org.bukkit.plugin.Plugin
      Overrides:
      onLoad in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • getFileAsString

      public static String getFileAsString()
    • registerListener

      public void registerListener(org.bukkit.event.Listener listener)
      Register a listener
      See Also:
      ListenersModule
    • disablePlugin

      public static void disablePlugin()
      Disable the plugin (when a fatal error occurs)
    • logInfo

      public static void logInfo(String text)
      Log an informative message to the console
    • logWarning

      public static void logWarning(String text)
      Log a warning to the console (yellow)
    • logSevere

      public static void logSevere(String text)
      Log a message warning about a severe issue to the console (red)
    • schedulerRun

      public static void schedulerRun(Runnable task)
      Run a task using a bukkit scheduler