Class Graves

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.ranull.graves.Graves
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public class Graves extends org.bukkit.plugin.java.JavaPlugin
  • Constructor Details

    • Graves

      public Graves()
  • Method Details

    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface org.bukkit.plugin.Plugin
      Overrides:
      onLoad in class org.bukkit.plugin.java.JavaPlugin
    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • saveDefaultConfig

      public void saveDefaultConfig()
      Specified by:
      saveDefaultConfig in interface org.bukkit.plugin.Plugin
      Overrides:
      saveDefaultConfig in class org.bukkit.plugin.java.JavaPlugin
    • reloadConfig

      public void reloadConfig()
      Specified by:
      reloadConfig in interface org.bukkit.plugin.Plugin
      Overrides:
      reloadConfig in class org.bukkit.plugin.java.JavaPlugin
    • getConfig

      @NotNull public @NotNull org.bukkit.configuration.file.FileConfiguration getConfig()
      Specified by:
      getConfig in interface org.bukkit.plugin.Plugin
      Overrides:
      getConfig in class org.bukkit.plugin.java.JavaPlugin
    • reload

      public void reload()
    • saveTextFiles

      public void saveTextFiles()
    • registerListeners

      public void registerListeners()
    • unregisterListeners

      public void unregisterListeners()
    • debugMessage

      public void debugMessage(String string, int level)
    • warningMessage

      public void warningMessage(String string)
      Logs a warning message to the console with a "Warning" prefix.
      Parameters:
      string - the message to log
    • compatibilityMessage

      public void compatibilityMessage(String string)
      Logs a compatibility-related warning message to the console.
      Parameters:
      string - the message to log
    • infoMessage

      public void infoMessage(String string)
      Logs an informational message to the console.
      Parameters:
      string - the message to log
    • testMessage

      public void testMessage(String string)
      Logs a test message to the console. Used for internal/debug purposes.
      Parameters:
      string - the message to log
    • updateMessage

      public void updateMessage(String string)
      Logs an update message to the console.
      Parameters:
      string - the message to log
    • integrationMessage

      public void integrationMessage(String string)
      Logs an integration message to the console as an info message by default.
      Parameters:
      string - the message to log
    • integrationMessage

      public void integrationMessage(String string, String messageType)
      Logs an integration message to the console with the specified message level.
      Parameters:
      string - the message to log
      messageType - the type of message: "info", "warn", or "severe"
    • dumpServerInfo

      public void dumpServerInfo(org.bukkit.command.CommandSender commandSender)
    • getVersionManager

      public VersionManager getVersionManager()
      Returns:
      the VersionManager responsible for handling Minecraft version compatibility.
    • getIntegrationManager

      public IntegrationManager getIntegrationManager()
      Returns:
      the IntegrationManager that manages third-party plugin integrations.
    • getGraveManager

      public GraveManager getGraveManager()
      Returns:
      the GraveManager that handles the creation and management of graves.
    • getHologramManager

      public HologramManager getHologramManager()
      Returns:
      the HologramManager for displaying holographic text or elements above graves.
    • getBlockManager

      public BlockManager getBlockManager()
      Returns:
      the BlockManager that manages custom block-related functionality.
    • getItemStackManager

      public ItemStackManager getItemStackManager()
      Returns:
      the ItemStackManager that handles item serialization and manipulation.
    • getEntityDataManager

      public EntityDataManager getEntityDataManager()
      Returns:
      the EntityDataManager used for storing and retrieving entity-specific data.
    • getCacheManager

      public CacheManager getCacheManager()
      Returns:
      the CacheManager responsible for caching frequently accessed data.
    • getDataManager

      public DataManager getDataManager()
      Returns:
      the DataManager that manages persistent plugin data and file I/O.
    • getImportManager

      public ImportManager getImportManager()
      Returns:
      the ImportManager used for importing data from other plugins or older formats.
    • getGUIManager

      public GUIManager getGUIManager()
      Returns:
      the GUIManager that handles graphical user interfaces shown to players.
    • getRecipeManager

      public RecipeManager getRecipeManager()
      Returns:
      the RecipeManager responsible for managing custom recipes.
    • getLocationManager

      public LocationManager getLocationManager()
      Returns:
      the LocationManager that handles location serialization and retrieval.
    • getEntityManager

      public EntityManager getEntityManager()
      Returns:
      the EntityManager for managing in-game entities related to graves.
    • getParticleManager

      public ParticleManager getParticleManager()
      Returns:
      the ParticleManager that manages particle effects used by the plugin.
    • getCompatibility

      public Compatibility getCompatibility()
      Returns:
      the Compatibility handler that ensures functionality across Minecraft versions and server platforms.
    • getGravesXScheduler

      public com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskScheduler getGravesXScheduler()
      Returns:
      the TaskScheduler used for running asynchronous or scheduled plugin tasks.
    • getPluginReleaseType

      public String getPluginReleaseType()
      Returns the plugin's current release type.
      Returns:
      a string indicating whether the build is Development, Outdated, Unknown, or Production.
    • getConfig

      public org.bukkit.configuration.ConfigurationSection getConfig(String config, Grave grave)
      Gets a configuration section based on a specific grave.
      Parameters:
      config - the config key.
      grave - the grave instance.
      Returns:
      the matching configuration section, or default if none match.
    • getConfig

      public org.bukkit.configuration.ConfigurationSection getConfig(String config, List<Grave> graveList)
      Gets a configuration section for a list of graves. Returns the first matching config found, or the default if none match.
      Parameters:
      config - the config key.
      graveList - the list of graves.
      Returns:
      the matching configuration section, or default if none match.
    • getConfig

      public org.bukkit.configuration.ConfigurationSection getConfig(String config, org.bukkit.entity.Entity entity)
      Gets a configuration section based on a specific entity.
      Parameters:
      config - the config key.
      entity - the entity.
      Returns:
      the matching configuration section, or default if none match.
    • getConfig

      public org.bukkit.configuration.ConfigurationSection getConfig(String config, org.bukkit.entity.Entity entity, List<String> permissionList)
      Gets a configuration section based on a specific entity and its permission list.
      Parameters:
      config - the config key.
      entity - the entity.
      permissionList - the permissions associated with the entity.
      Returns:
      the matching configuration section, or default if none match.
    • getConfig

      public org.bukkit.configuration.ConfigurationSection getConfig(String config, org.bukkit.entity.EntityType entityType, List<String> permissionList)
      Resolves the most appropriate configuration section based on entity type and permissions.
      Parameters:
      config - the config key.
      entityType - the type of entity.
      permissionList - a list of permissions to prioritize.
      Returns:
      the best matching configuration section.
    • getPermissionList

      public List<String> getPermissionList(org.bukkit.entity.Entity entity)
      Builds a sorted list of permission keys for a given entity (player).
      Parameters:
      entity - the entity (usually a Player).
      Returns:
      a sorted list of permission keys that match configuration sections.
    • getConfigFolder

      public final File getConfigFolder()
      Returns:
      the folder where Graves configuration files are stored.
    • getPluginsFolder

      public final File getPluginsFolder()
      Returns:
      the parent folder where all plugins are stored.
    • getVersion

      public String getVersion()
      Returns:
      the current version of the Graves plugin from plugin.yml.
    • getLatestVersion

      public String getLatestVersion()
      Returns:
      the latest available version from Spigot update checking.
    • getSpigotID

      public final int getSpigotID()
      Returns:
      the Spigot plugin resource ID used for update checking.
    • getMetricsID

      public final int getMetricsID()
      Returns:
      the bStats plugin ID used for usage metrics.
    • getMetricsIDLegacy

      public final int getMetricsIDLegacy()
      Returns:
      the legacy bStats plugin ID (for previous plugin versions).
    • logStackTrace

      public void logStackTrace(Exception e)
      Logs the full stack trace of an exception to the plugin logger.
      Parameters:
      e - the exception to log.
    • logStackTrace

      public void logStackTrace(Throwable t)
      Logs the full stack trace of a throwable to the plugin logger.
      Parameters:
      t - the throwable to log.
    • getModuleManager

      public ModuleManager getModuleManager()
    • logInvalidGraveSite

      public void logInvalidGraveSite(String grave_uuid, org.bukkit.Location affectedGraveLocation, List<String> invalidationReason)
      Logs information about a grave that has invalid or incomplete data.
      Parameters:
      grave_uuid - the UUID of the affected grave.
      affectedGraveLocation - the location of the grave.
      invalidationReason - reasons the grave is considered invalid.
    • hasGrantedPermission

      public boolean hasGrantedPermission(String permission, org.bukkit.entity.Player player)
      Checks if the specified player has been granted the specified permission. This method first checks if various permission plugins are available and uses them to check permissions. If no permission plugin is found, it falls back to the default Bukkit permission check. Additionally, this method logs debug messages based on the permission check results for each permission plugin.
      Parameters:
      permission - the permission to check for
      player - the player whose permissions are being checked
      Returns:
      true if the player has the specified permission, false otherwise
    • hasGrantedPermission

      @Deprecated public boolean hasGrantedPermission(String permission, org.bukkit.OfflinePlayer offlinePlayer)
      Deprecated.
      This method is deprecated because it is less efficient to check permissions for offline players. Use hasGrantedPermission(String, Player) for online players instead.
      Checks if the specified offline player has been granted the specified permission. This method first checks if various permission plugins are available and uses them to check permissions. If no permission plugin is found, it falls back to the default Bukkit permission check. Additionally, this method logs debug messages based on the permission check results for each permission plugin.
      Parameters:
      permission - the permission to check for
      offlinePlayer - the offline player whose permissions are being checked
      Returns:
      true if the offline player has the specified permission, false otherwise