Package fr.sandro642.github.hook
Class MCSupport
java.lang.Object
fr.sandro642.github.hook.MCSupport
MCSupport is a utility class for handling Minecraft plugin support in the ConnectLib library.
It provides methods to check if the project is a Minecraft project, set and get the plugin instance,
-
Method Summary
Modifier and TypeMethodDescriptionstatic MCSupport
Static method to get the singleton instance of MCSupport.org.bukkit.plugin.Plugin
Method to get the plugin instance.Method to get the path of the plugin's data folder.boolean
Method to check if the plugin has been initialized.org.bukkit.plugin.Plugin
setPluginVariable
(org.bukkit.plugin.Plugin plugin) Method to set the plugin instance.
-
Method Details
-
setPluginVariable
public org.bukkit.plugin.Plugin setPluginVariable(org.bukkit.plugin.Plugin plugin) Method to set the plugin instance. This method should be called in a Minecraft project to set the plugin instance.- Parameters:
plugin
- The instance of the Minecraft plugin to be set.- Returns:
- The instance of the plugin that was set.
- Throws:
IllegalArgumentException
- If the plugin is null.
-
getPluginPath
Method to get the path of the plugin's data folder. This method returns the absolute path of the plugin's data folder.- Returns:
- The absolute path of the plugin's data folder.
- Throws:
IllegalStateException
- If the plugin variable is not set.
-
isPluginInitialized
public boolean isPluginInitialized()Method to check if the plugin has been initialized. This method checks if the pluginSingleton is not null.- Returns:
- true if the plugin is initialized, false otherwise.
-
getPlugin
public org.bukkit.plugin.Plugin getPlugin()Method to get the plugin instance. This method returns the singleton instance of the plugin.- Returns:
- The instance of the plugin.
- Throws:
IllegalStateException
- If the plugin variable is not set.
-
getInstance
Static method to get the singleton instance of MCSupport. This method initializes the instance if it is null and returns it.- Returns:
- The singleton instance of MCSupport.
-