Class ItemMods

  • All Implemented Interfaces:
    org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

    public class ItemMods
    extends org.bukkit.plugin.java.JavaPlugin
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int FILE_VERSION
      The current version of the file.
      static com.google.gson.Gson GSON  
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemMods()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getLocales()
      Get all supported locales
      static MainConfig getMainConfig()
      Get the general configuration located in plugins/ItemMods/config.json Can be saved with saveMainConfig()
      static PackManager getPackManager()  
      static ItemMods getPlugin()
      Get the current plugin
      static @Nullable com.comphenix.protocol.ProtocolManager getProtocolManager()
      Get protocol manager of ProtocolLib
      static java.nio.file.Path getTempPath()
      Get the directory located in plugins/ItemMods/temp
      static java.lang.String getTranslation​(java.lang.String key, java.lang.Object... placeholders)  
      static dev.linwood.api.translations.TranslationConfig getTranslationConfig()
      Get the translation config where all translations for this plugin
      static @NotNull java.lang.String getVersion()
      Get the version of the plugin
      static boolean hasProtocolLib()  
      void onDisable()  
      void onEnable()  
      static void reload()
      Reload the translation config, the main config and the pack manager
      static void reloadMainConfig()
      Reload the main config which can be got from the getMainConfig() method
      static void saveMainConfig()
      Save the main config which can be got from the getMainConfig() method
      static dev.linwood.api.translations.Translation subTranslation​(java.lang.String... namespaces)  
      • Methods inherited from class org.bukkit.plugin.java.JavaPlugin

        getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, 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
    • Field Detail

      • GSON

        public static final com.google.gson.Gson GSON
      • FILE_VERSION

        public static final int FILE_VERSION
        The current version of the file. This is used to update the file if a new version is released!
        See Also:
        Constant Field Values
    • Constructor Detail

      • ItemMods

        public ItemMods()
    • Method Detail

      • getPlugin

        public static ItemMods getPlugin()
        Get the current plugin
        Returns:
        The singleton of this class created from the server
      • saveMainConfig

        public static void saveMainConfig()
        Save the main config which can be got from the getMainConfig() method
      • getTranslationConfig

        public static dev.linwood.api.translations.TranslationConfig getTranslationConfig()
        Get the translation config where all translations for this plugin
        Returns:
        The translation config with all translations
      • subTranslation

        public static dev.linwood.api.translations.Translation subTranslation​(java.lang.String... namespaces)
      • getTranslation

        public static java.lang.String getTranslation​(java.lang.String key,
                                                      java.lang.Object... placeholders)
      • getMainConfig

        public static MainConfig getMainConfig()
        Get the general configuration located in plugins/ItemMods/config.json Can be saved with saveMainConfig()
        Returns:
        The main config instance
      • getVersion

        @NotNull
        public static @NotNull java.lang.String getVersion()
        Get the version of the plugin
        Returns:
        The version string
      • getPackManager

        public static PackManager getPackManager()
      • getTempPath

        public static java.nio.file.Path getTempPath()
        Get the directory located in plugins/ItemMods/temp
        Returns:
        The path of the directory
      • reloadMainConfig

        public static void reloadMainConfig()
        Reload the main config which can be got from the getMainConfig() method
      • getLocales

        public static java.util.List<java.lang.String> getLocales()
                                                           throws java.io.IOException
        Get all supported locales
        Returns:
        A list of the supported locales
        Throws:
        java.io.IOException - Throws if the directory can't be read
      • reload

        public static void reload()
        Reload the translation config, the main config and the pack manager
      • getProtocolManager

        @Nullable
        public static @Nullable com.comphenix.protocol.ProtocolManager getProtocolManager()
        Get protocol manager of ProtocolLib
        Returns:
        Returns true if the server is running on paper
      • hasProtocolLib

        public static boolean hasProtocolLib()
      • onEnable

        public void onEnable()
        Specified by:
        onEnable in interface org.bukkit.plugin.Plugin
        Overrides:
        onEnable 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