Class Stargate

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
org.sgrewritten.stargate.Stargate
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, ConfigurationAPI, StargateAPI

public class Stargate extends org.bukkit.plugin.java.JavaPlugin implements StargateAPI, ConfigurationAPI
A plugin that allows for instant-teleportation between large distances and across servers. Highly customisable and designed with end-user portal creation in mind!

https://git.io/JuWkU | https://discord.gg/mTaHuK6BVa

Lead Developers:

Author:
Thorin (2020-Present), EpicKnarvik97 (2021-Present), PseudoKnight (2015-2020), Drakia (2011-2013), Dinnerbone (2010-2011)
  • Constructor Details

    • Stargate

      public Stargate()
  • Method Details

    • onEnable

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

      public StargateEconomyAPI getEconomyManager()
      Gets the economy manager used for this plugin
      Specified by:
      getEconomyManager in interface StargateAPI
      Returns:

      The economy manager used for this plugin

    • getMaterialHandlerResolver

      public BlockHandlerResolver getMaterialHandlerResolver()
      Specified by:
      getMaterialHandlerResolver in interface StargateAPI
      Returns:

      The material handler resolver used by stargate addons

    • getNetworkManager

      public NetworkManager getNetworkManager()
      Specified by:
      getNetworkManager in interface StargateAPI
      Returns:

      The network manager used to fetch networks from strings

    • getAbsoluteDataFolder

      public String getAbsoluteDataFolder()
      Gets the absolute path to Stargate's data folder
      Returns:

      The absolute path to the data folder

    • getServerName

      public static String getServerName()
      Gets the name of this server as defined by BungeeCord
      Returns:

      The name of this server

    • setServerName

      public static void setServerName(String serverName)
      Sets this server's name as defined by BungeeCord
      Parameters:
      serverName -

      The new name of this server

    • knowsServerName

      public static boolean knowsServerName()
      Gets whether this server knows its own name
      Returns:

      True if this server knows its own name

    • setKnowsServerName

      public static void setKnowsServerName(boolean knowsServerName)
      Sets whether this server knows its server name
      Parameters:
      knowsServerName -

      Whether this server knows its server name

    • getServerUUID

      public static String getServerUUID()
      Gets this server's unique id
      Returns:

      This server's unique id

    • setServerUUID

      public static void setServerUUID(UUID serverUUID)
      Sets this server's unique id
      Parameters:
      serverUUID -

      This server's new unique id

    • 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
    • reloadConfig

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

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

      public void setConfigurationOptionValue(ConfigurationOption configurationOption, Object newValue)
      Description copied from interface: ConfigurationAPI
      Sets the value of a configuration option
      Specified by:
      setConfigurationOptionValue in interface ConfigurationAPI
      Parameters:
      configurationOption -

      The configuration option to update

      newValue -

      The new value of the configuration option

    • getConfigurationOptionValue

      public Object getConfigurationOptionValue(ConfigurationOption configurationOption)
      Description copied from interface: ConfigurationAPI
      Gets the current value of a configuration option
      Specified by:
      getConfigurationOptionValue in interface ConfigurationAPI
      Parameters:
      configurationOption -

      The configuration option to get the value of

      Returns:

      The current value of the specified configuration option

    • saveConfiguration

      public void saveConfiguration()
      Description copied from interface: ConfigurationAPI
      Saves the current state of the configuration to disk

      This needs to be run after any config changes to update the config file.

      Specified by:
      saveConfiguration in interface ConfigurationAPI
    • reload

      public void reload()
      Description copied from interface: ConfigurationAPI
      Reloads the configuration from disk

      This needs to be executed in order for saved config changes to take effect.

      Specified by:
      reload in interface ConfigurationAPI
    • onDisable

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

      public static void log(Throwable throwable)
      Log an exception at the WARNING level
      Parameters:
      throwable -

      THe exception to log

    • log

      public static void log(Level logLevel, Throwable throwable)
      Log an exception at the given level
      Parameters:
      logLevel -

      The level to log on

      throwable -

      The exception to log

    • log

      public static void log(Level priorityLevel, String message)
      Log any message at the given level
      Parameters:
      priorityLevel -

      The log level to log the message on

      message -

      The message to log

    • setLogLevel

      public static void setLogLevel(Level priorityLevel)
      Change the log level of Stargate. Does not save new level to the config
      Parameters:
      priorityLevel -

      The new priority level to set

    • getInstance

      public static Stargate getInstance()
      Gets an instance of this plugin
      Returns:

      An instance of this plugin

    • logMessage

      public void logMessage(Level priorityLevel, String message)
      Log any message at the given level
      Parameters:
      priorityLevel -

      The log level to log the message on

      message -

      The message to log

    • getFileConfiguration

      public static org.bukkit.configuration.file.FileConfiguration getFileConfiguration()
      Returns:

      Get the configuration of stargate, or an empty config

    • getStorageAPIStatic

      public static StorageAPI getStorageAPIStatic()
      Static access of the database interface, will throw null pointer exception if stargate has not been initialized
      Returns:

      A storage API instance

    • getRegistry

      public RegistryAPI getRegistry()
      Description copied from interface: StargateAPI
      Gets the registry used to register and unregister Stargates
      Specified by:
      getRegistry in interface StargateAPI
      Returns:

      The registry used to register and unregister Stargates

    • getStorageAPI

      public StorageAPI getStorageAPI()
      Description copied from interface: StargateAPI
      Gets the storage API used to store and load Stargates
      Specified by:
      getStorageAPI in interface StargateAPI
      Returns:

      The storage API used to store and load stargates

    • getLanguageManager

      public LanguageManager getLanguageManager()
      Description copied from interface: StargateAPI
      Gets the language manager used for translating strings
      Specified by:
      getLanguageManager in interface StargateAPI
      Returns:

      The language manager used for translating strings

    • getPermissionManager

      public PermissionManager getPermissionManager(org.bukkit.entity.Entity entity)
      Description copied from interface: StargateAPI
      Gets permission manager for specified entity
      Specified by:
      getPermissionManager in interface StargateAPI
      Parameters:
      entity -

      The entity to check permissions on

      Returns:

      A permission manager

    • getConfigurationAPI

      public ConfigurationAPI getConfigurationAPI()
      Description copied from interface: StargateAPI
      Gets the configuration API used to interact with the configuration file
      Specified by:
      getConfigurationAPI in interface StargateAPI
      Returns:

      The configuration API

    • getBungeeManager

      public BungeeManager getBungeeManager()
      Description copied from interface: StargateAPI
      Gets the bungee manager used for dealing with bungee related events
      Specified by:
      getBungeeManager in interface StargateAPI
      Returns:

      The bungee manager used for dealing with bungee related events

    • getBlockLoggerManager

      public BlockLoggingManager getBlockLoggerManager()
      Returns:

      The block-logger used for dealing with external block logging plugin compatibility

    • getStoredPropertiesAPI

      public StoredPropertiesAPI getStoredPropertiesAPI()
      Returns:

      The database dealing with internally stored properties