Package dev.linwood.itemmods
Class ItemMods
- java.lang.Object
-
- org.bukkit.plugin.PluginBase
-
- org.bukkit.plugin.java.JavaPlugin
-
- dev.linwood.itemmods.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 localesstatic MainConfig
getMainConfig()
Get the general configuration located in plugins/ItemMods/config.json Can be saved withsaveMainConfig()
static PackManager
getPackManager()
static ItemMods
getPlugin()
Get the current pluginstatic @Nullable com.comphenix.protocol.ProtocolManager
getProtocolManager()
Get protocol manager of ProtocolLibstatic java.nio.file.Path
getTempPath()
Get the directory located in plugins/ItemMods/tempstatic 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 pluginstatic @NotNull java.lang.String
getVersion()
Get the version of the pluginstatic boolean
hasProtocolLib()
void
onDisable()
void
onEnable()
static void
reload()
Reload the translation config, the main config and the pack managerstatic void
reloadMainConfig()
Reload the main config which can be got from thegetMainConfig()
methodstatic void
saveMainConfig()
Save the main config which can be got from thegetMainConfig()
methodstatic 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
-
-
-
-
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
-
-
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 thegetMainConfig()
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 withsaveMainConfig()
- 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 thegetMainConfig()
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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()
- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
-