Class Settings

java.lang.Object
com.github.mafelp.utils.Settings

public class Settings
extends java.lang.Object
Class containing all settings: [ Internal variables, user defined values, handling configuration files ]
  • Field Summary

    Fields
    Modifier and Type Field Description
    static boolean debug
    enables more information being displayed while executing events
    static org.javacord.api.DiscordApi discordApi
    communication API with Discord, defined in DiscordMain.init()
    static org.bukkit.Server minecraftServer
    this minecraft server, defined in Main.onEnable()
    static java.lang.String prefix
    plugin prefix - optionally definable in config.yml - else defined in createDefaultConfig() - Used before log outputs in the console
    static java.lang.String serverName
    Name of the server displayed in footer of discord messages defined in config.yml
    static boolean shortMsg
    Use if message prefix should be one (true) or two (true) lines - optionally definable in config.yml - else defined in createDefaultConfig()
    static java.lang.String version
    version number of the plugin - displayed to users
  • Constructor Summary

    Constructors
    Constructor Description
    Settings()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String getApiToken()
    Getter for the API Token
    static org.bukkit.configuration.file.YamlConfiguration getConfiguration()
    Getter for the configuration
    static java.io.File getConfigurationFileDirectory()
    Getter for the configurationFileDirectory
    static void init()
    Initializing method of the settings - initializes config and variables
    static java.lang.String msgPrefix​(org.javacord.api.event.message.MessageCreateEvent event)
    Creates a prefix for a minecraft message
    static void saveConfiguration()
    saves the configuration (values) in "YamlConfiguration configuration" to the configuration file

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • discordApi

      public static volatile org.javacord.api.DiscordApi discordApi
      communication API with Discord, defined in DiscordMain.init()
    • minecraftServer

      public static volatile org.bukkit.Server minecraftServer
      this minecraft server, defined in Main.onEnable()
    • version

      public static final java.lang.String version
      version number of the plugin - displayed to users
      See Also:
      Constant Field Values
    • debug

      public static boolean debug
      enables more information being displayed while executing events
    • prefix

      public static volatile java.lang.String prefix
      plugin prefix - optionally definable in config.yml - else defined in createDefaultConfig() - Used before log outputs in the console
    • shortMsg

      public static volatile boolean shortMsg
      Use if message prefix should be one (true) or two (true) lines - optionally definable in config.yml - else defined in createDefaultConfig()
    • serverName

      public static volatile java.lang.String serverName
      Name of the server displayed in footer of discord messages defined in config.yml
  • Constructor Details

    • Settings

      public Settings()
  • Method Details

    • msgPrefix

      public static java.lang.String msgPrefix​(org.javacord.api.event.message.MessageCreateEvent event)
      Creates a prefix for a minecraft message
      Parameters:
      event - Message create event made by the discord API containing information about the message and its source and author
      Returns:
      usable message prefix, one or two lines. two lines include unicode characters
    • init

      public static void init()
      Initializing method of the settings - initializes config and variables
    • getConfiguration

      public static org.bukkit.configuration.file.YamlConfiguration getConfiguration()
      Getter for the configuration
      Returns:
      main configuration file
    • saveConfiguration

      public static void saveConfiguration()
      saves the configuration (values) in "YamlConfiguration configuration" to the configuration file
    • getApiToken

      public static java.lang.String getApiToken()
      Getter for the API Token
      Returns:
      discord bot API Token specified in the configuration
    • getConfigurationFileDirectory

      public static java.io.File getConfigurationFileDirectory()
      Getter for the configurationFileDirectory
      Returns:
      a File which contains the configuration file directory