Package com.Moshu
Class Main
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.Moshu.Main
- All Implemented Interfaces:
 io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public class Main
extends org.bukkit.plugin.java.JavaPlugin
Main plugin class for MysticTreasures.
 This is the primary entry point for the treasure hunting plugin that manages
 scheduled treasure hunts, player interactions, and all plugin functionality.
 
 The plugin provides a comprehensive treasure hunting system with:
 - Scheduled treasure spawns
 - Player interaction and rewards
 - Integration with various Bukkit plugins
 - Configuration management
 - Cooldown systems
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidCreates and loads all necessary configuration files.voidSets up delayed hooks and initialization tasks that need to run after the server has fully started.org.bukkit.configuration.file.FileConfigurationGets the main configuration file.org.bukkit.configuration.file.FileConfigurationGets the cooldowns configuration file.org.bukkit.configuration.file.FileConfigurationGets the messages configuration file.com.sk89q.worldguard.bukkit.WorldGuardPluginGets world guard instancevoidmetrics()Initializes bStats metrics collection if enabled in configuration.voidCalled when the plugin is disabled.voidonEnable()Called when the plugin is enabled.voidonLoad()Called when the plugin is loaded.voidReload non-essential filesMethods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onTabComplete, registerCommand, registerCommand, registerCommand, registerCommand, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger 
- 
Field Details
- 
plugin
 - 
isLoaded
public static boolean isLoaded 
 - 
 - 
Constructor Details
- 
Main
public Main() 
 - 
 - 
Method Details
- 
onEnable
public void onEnable()Called when the plugin is enabled. Initializes all plugin components, registers events and commands, sets up integrations with other plugins, and starts the treasure task.- Specified by:
 onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
 onEnablein classorg.bukkit.plugin.java.JavaPlugin
 - 
onLoad
public void onLoad()Called when the plugin is loaded. Performs early initialization tasks that need to happen before enable.- Specified by:
 onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
 onLoadin classorg.bukkit.plugin.java.JavaPlugin
 - 
onDisable
public void onDisable()Called when the plugin is disabled. Performs cleanup operations and saves any pending data.- Specified by:
 onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
 onDisablein classorg.bukkit.plugin.java.JavaPlugin
 - 
delayedHooks
public void delayedHooks()Sets up delayed hooks and initialization tasks that need to run after the server has fully started. This includes loading treasure data, starting tasks, and initializing various components. - 
getCooldownsFile
public org.bukkit.configuration.file.FileConfiguration getCooldownsFile()Gets the cooldowns configuration file.- Returns:
 - The FileConfiguration object for cooldowns
 
 - 
getMessages
public org.bukkit.configuration.file.FileConfiguration getMessages()Gets the messages configuration file.- Returns:
 - The FileConfiguration object for messages
 
 - 
getConfigFile
public org.bukkit.configuration.file.FileConfiguration getConfigFile()Gets the main configuration file.- Returns:
 - The FileConfiguration object for the main config
 
 - 
reloadFiles
public void reloadFiles()Reload non-essential files - 
metrics
public void metrics()Initializes bStats metrics collection if enabled in configuration. Sends plugin usage statistics to bStats for analytics. - 
getWorldGuard
public com.sk89q.worldguard.bukkit.WorldGuardPlugin getWorldGuard()Gets world guard instance- Returns:
 - WorldGuard instance or null
 
 - 
createDataFiles
public void createDataFiles()Creates and loads all necessary configuration files. Creates config.yml, messages.yml, and cooldowns.yml if they don't exist. 
 -