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 CustomBlockManager
getCustomBlockManager()
Get the current custom block manager singletonstatic CustomItemManager
getCustomItemManager()
Get the current custom item manager singletonstatic List<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()
Get the pack manager to control all packsstatic ItemMods
getPlugin()
Get the current pluginstatic Path
getTempPath()
Get the directory located in plugins/ItemMods/tempstatic String
getTranslation(String key, Object... placeholders)
static dev.linwood.api.translations.TranslationConfig
getTranslationConfig()
Get the translation config where all translations for this pluginstatic @NotNull String
getVersion()
Get the version of the pluginstatic boolean
isRunningOnPaper()
Test if the server is running on papervoid
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(String... namespaces)
-
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, 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
-
getCustomBlockManager
public static CustomBlockManager getCustomBlockManager()
Get the current custom block manager singleton- Returns:
- The singleton created from the plugin
-
getCustomItemManager
public static CustomItemManager getCustomItemManager()
Get the current custom item manager singleton- Returns:
- The singleton created from the plugin
-
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(String... namespaces)
-
getMainConfig
public static MainConfig getMainConfig()
Get the general configuration located in plugins/ItemMods/config.json Can be saved withsaveMainConfig()
- Returns:
- The main config instance
-
getPackManager
public static PackManager getPackManager()
Get the pack manager to control all packs- Returns:
- The singleton created from the plugin
-
getVersion
@NotNull public static @NotNull String getVersion()
Get the version of the plugin- Returns:
- The version string
-
getTempPath
public static 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 List<String> getLocales() throws IOException
Get all supported locales- Returns:
- A list of the supported locales
- Throws:
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
-
isRunningOnPaper
public static boolean isRunningOnPaper()
Test if the server is running on paper- Returns:
- Returns true if the server is running on paper
-
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
-
-