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
    Modifier and Type
    Field
    Description
    static boolean
     
    static Main
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates and loads all necessary configuration files.
    void
    Sets up delayed hooks and initialization tasks that need to run after the server has fully started.
    org.bukkit.configuration.file.FileConfiguration
    Gets the main configuration file.
    org.bukkit.configuration.file.FileConfiguration
    Gets the cooldowns configuration file.
    org.bukkit.configuration.file.FileConfiguration
    Gets the messages configuration file.
    com.sk89q.worldguard.bukkit.WorldGuardPlugin
    Gets world guard instance
    void
    Initializes bStats metrics collection if enabled in configuration.
    void
    Called when the plugin is disabled.
    void
    Called when the plugin is enabled.
    void
    Called when the plugin is loaded.
    void
    Reload non-essential files

    Methods 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, 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

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
  • Field Details

    • plugin

      public static Main 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:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.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:
      onLoad in interface org.bukkit.plugin.Plugin
      Overrides:
      onLoad in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Called when the plugin is disabled. Performs cleanup operations and saves any pending data.
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.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.