Class BukkitScriptManager

java.lang.Object
dev.magicmq.pyspigot.manager.script.ScriptManager
dev.magicmq.pyspigot.bukkit.manager.script.BukkitScriptManager

public class BukkitScriptManager extends ScriptManager
The Bukkit-specific implementation of the script manager.
  • Method Details

    • scheduleStartScriptTask

      public void scheduleStartScriptTask()
      Description copied from class: ScriptManager
      Schedules and starts the start script task for the script load delay via a platform-specific implementation.
      Specified by:
      scheduleStartScriptTask in class ScriptManager
    • cancelStartScriptTask

      public void cancelStartScriptTask()
      Description copied from class: ScriptManager
      Cancels the start script task via a platform-specific implementation.
      Specified by:
      cancelStartScriptTask in class ScriptManager
    • isPluginDependencyMissing

      public boolean isPluginDependencyMissing(String dependency)
      Description copied from class: ScriptManager
      Checks if a script plugin dependency is missing via a platform-specific implementation.
      Specified by:
      isPluginDependencyMissing in class ScriptManager
      Parameters:
      dependency - The name of the dependency to check
      Returns:
      True if the dependency is missing, false if it is present
    • callScriptExceptionEvent

      public boolean callScriptExceptionEvent(Script script, PyException exception)
      Description copied from class: ScriptManager
      Calls a ScriptExceptionEvent via a platform-specific implementation.
      Specified by:
      callScriptExceptionEvent in class ScriptManager
      Parameters:
      script - The script that threw the exception
      exception - The exception that was thrown
      Returns:
      True if the exception should be reported, false if otherwise
    • callScriptLoadEvent

      public void callScriptLoadEvent(Script script)
      Description copied from class: ScriptManager
      Calls a ScriptLoadEvent via a platform-specific implementation.
      Specified by:
      callScriptLoadEvent in class ScriptManager
      Parameters:
      script - The script that was loaded
    • callScriptUnloadEvent

      public void callScriptUnloadEvent(Script script, boolean error)
      Description copied from class: ScriptManager
      Calls a ScriptUnloadEvent via a platform-specific implementation.
      Specified by:
      callScriptUnloadEvent in class ScriptManager
      Parameters:
      script - The script that was unloaded
      error - True if the unload was due to an error, false if it was not
    • newScriptOptions

      public ScriptOptions newScriptOptions()
      Description copied from class: ScriptManager
      Initialize a new ScriptOptions with the default values.

      This is done in a platform-specific implementation, as initializing script options for Bukkit initializes permissions

      Specified by:
      newScriptOptions in class ScriptManager
      Returns:
      The new ScriptOptions
    • newScriptOptions

      public ScriptOptions newScriptOptions(String scriptName) throws InvalidConfigurationException
      Description copied from class: ScriptManager
      Initialize a new ScriptOptions using the appropriate values in the script_options.yml file, using the script name to search for the values.

      This is done in a platform-specific implementation, as initializing script options for Bukkit initializes permissions

      Specified by:
      newScriptOptions in class ScriptManager
      Parameters:
      scriptName - The name of the script whose script options should be initialized
      Returns:
      The new ScriptOptions
      Throws:
      InvalidConfigurationException - If
    • newScript

      public Script newScript(Path path, String name, ScriptOptions options)
      Description copied from class: ScriptManager
      Initialize a new Script via a platform-specific implementation.
      Specified by:
      newScript in class ScriptManager
      Parameters:
      path - The path that corresponds to the file where the script lives
      name - The name of this script. Should contain its extension (.py)
      options - The ScriptOptions for this script
      Returns:
      The new script
    • initScriptPermissions

      public void initScriptPermissions(Script script)
      Description copied from class: ScriptManager
      Initialize script permissions via a platform-specific implementation.
      Specified by:
      initScriptPermissions in class ScriptManager
      Parameters:
      script - The script whose permissions should be initialized
    • removeScriptPermissions

      public void removeScriptPermissions(Script script)
      Description copied from class: ScriptManager
      Remove script permissions from the server via a platform-specific implementation.
      Specified by:
      removeScriptPermissions in class ScriptManager
      Parameters:
      script - The script whose permissions should be removed
    • unregisterFromPlatformManagers

      public void unregisterFromPlatformManagers(Script script)
      Description copied from class: ScriptManager
      Unregisters the script from any platform-specific managers.
      Specified by:
      unregisterFromPlatformManagers in class ScriptManager
      Parameters:
      script - The script to unregister
    • get

      public static BukkitScriptManager get()
      Get the singleton instance of this BukkitScriptManager.
      Returns:
      The instance