Class MultiverseCore

  • All Implemented Interfaces:
    Core, LoggablePlugin, MVPlugin, org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

    public class MultiverseCore
    extends org.bukkit.plugin.java.JavaPlugin
    implements MVPlugin, Core
    The implementation of the Multiverse-Core.
    • Constructor Detail

      • MultiverseCore

        public MultiverseCore()
      • MultiverseCore

        public MultiverseCore​(org.bukkit.plugin.java.JavaPluginLoader loader,
                              org.bukkit.plugin.PluginDescriptionFile description,
                              java.io.File dataFolder,
                              java.io.File file)
        This is for unit testing.
        Parameters:
        loader - The PluginLoader to use.
        description - The Description file to use.
        dataFolder - The folder that other datafiles can be found in.
        file - The location of the plugin.
    • Method Detail

      • getPlayerTeleporter

        public static java.lang.String getPlayerTeleporter​(java.lang.String playerName)
        This method is used to find out who is teleporting a player.
        Parameters:
        playerName - The teleported player (the teleportee).
        Returns:
        The player that teleported the other one (the teleporter).
      • addPlayerToTeleportQueue

        public static void addPlayerToTeleportQueue​(java.lang.String teleporter,
                                                    java.lang.String teleportee)
        This method is used to add a teleportation to the teleportQueue.
        Parameters:
        teleporter - The name of the player that initiated the teleportation.
        teleportee - The name of the player that was teleported.
      • dumpVersionInfo

        @Deprecated
        public java.lang.String dumpVersionInfo​(java.lang.String buffer)
        Deprecated.
        This is now deprecated, nobody needs it any longer. All version info-dumping is now done with MVVersionEvent.
        Adds This plugin's version information to the buffer and returns the new string.
        Specified by:
        dumpVersionInfo in interface MVPlugin
        Parameters:
        buffer - The string that contains Core and all other MV plugins' versions.
        Returns:
        A modified buffer that contains this MVPlugin's version information.
      • getProtocolVersion

        public int getProtocolVersion()
        Description copied from interface: MVPlugin
        Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is. This number should change when something will break the code.
        Specified by:
        getProtocolVersion in interface MVPlugin
        Returns:
        The Integer protocol version.
      • onLoad

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

        @Deprecated
        public VaultHandler getVaultHandler()
        Deprecated.
        Description copied from interface: Core
        Returns the Vault handler used by Multiverse. The returned object will have all methods necessary for interfacing with Vault.
        Specified by:
        getVaultHandler in interface Core
        Returns:
        the Vault handler for Multiverse.
      • getEconomist

        public MVEconomist getEconomist()
        Description copied from interface: Core
        Retrieves Multiverse's friendly economist. The economist can be used for dealing with economies without worrying about any of the messy details.
        Specified by:
        getEconomist in interface Core
        Returns:
        the economy manager for Multiverse.
      • onEnable

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

        public void loadConfigs()
        Reloads the Multiverse Configuration files: worlds.yml and config.yml.
        Specified by:
        loadConfigs in interface Core
      • onDisable

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

        public MVPlayerSession getPlayerSession​(org.bukkit.entity.Player player)
        Gets the MVPlayerSession for the given player. This will also create a player session if one does not exist for a player.
        Specified by:
        getPlayerSession in interface Core
        Parameters:
        player - The player's session to grab.
        Returns:
        The corresponding MVPlayerSession.
      • getMVPerms

        public MVPermissions getMVPerms()
        Multiverse uses an advanced permissions setup, this object simplifies getting/setting permissions.
        Specified by:
        getMVPerms in interface Core
        Returns:
        A non-null MVPermissions.
      • onCommand

        public boolean onCommand​(org.bukkit.command.CommandSender sender,
                                 org.bukkit.command.Command command,
                                 java.lang.String commandLabel,
                                 java.lang.String[] args)
        Specified by:
        onCommand in interface org.bukkit.command.CommandExecutor
        Overrides:
        onCommand in class org.bukkit.plugin.java.JavaPlugin
      • log

        @Deprecated
        public void log​(java.util.logging.Level level,
                        java.lang.String msg)
        Deprecated.
        This is now deprecated, nobody needs it any longer. All logging is now done with Logging.
        Logs a message at the specified level.
        Specified by:
        log in interface LoggablePlugin
        Parameters:
        level - The Log-Level.
        msg - The message to log.
      • staticLog

        @Deprecated
        public static void staticLog​(java.util.logging.Level level,
                                     java.lang.String msg)
        Deprecated.
        Replaced by Logging. Please refrain from using this from a third party plugin as the messages will appear to originate from Multiverse-Core.
        Logs a message at the specified level.
        Parameters:
        level - The Log-Level.
        msg - The message to log.
      • staticDebugLog

        @Deprecated
        public static void staticDebugLog​(java.util.logging.Level level,
                                          java.lang.String msg)
        Deprecated.
        Replaced by Logging. Please refrain from using this from a third party plugin as the messages will appear to originate from Multiverse-Core.
        Print messages to the Debug Log, if the servers in Debug Mode then we also want to print the messages to the standard Server Console.
        Parameters:
        level - The Log-Level
        msg - The message
      • getAuthors

        public java.lang.String getAuthors()
        Parse the Authors Array into a readable String with ',' and 'and'.
        Specified by:
        getAuthors in interface Core
        Returns:
        The readable authors-String
      • getCommandHandler

        public com.pneumaticraft.commandhandler.CommandHandler getCommandHandler()
        Multiverse uses CommandHandler to make adding and using commands a piece of cake.
        Specified by:
        getCommandHandler in interface Core
        Returns:
        A non-null CommandHandler.
      • getTag

        public java.lang.String getTag()
        Gets the log-tag.
        Returns:
        The log-tag
      • showNotMVWorldMessage

        public void showNotMVWorldMessage​(org.bukkit.command.CommandSender sender,
                                          java.lang.String worldName)
        Shows a message that the given world is not a MultiverseWorld.
        Parameters:
        sender - The CommandSender that should receive the message
        worldName - The name of the invalid world
      • removePlayerSession

        public void removePlayerSession​(org.bukkit.entity.Player player)
        Removes a player-session.
        Parameters:
        player - The Player that owned the session.
      • getPluginCount

        public int getPluginCount()
        Returns the number of plugins that have specifically hooked into core.
        Specified by:
        getPluginCount in interface Core
        Returns:
        The number if plugins that have hooked into core.
      • incrementPluginCount

        public void incrementPluginCount()
        Increments the number of plugins that have specifically hooked into core.
        Specified by:
        incrementPluginCount in interface Core
      • decrementPluginCount

        public void decrementPluginCount()
        Decrements the number of plugins that have specifically hooked into core.
        Specified by:
        decrementPluginCount in interface Core
      • teleportPlayer

        public void teleportPlayer​(org.bukkit.command.CommandSender teleporter,
                                   org.bukkit.entity.Player p,
                                   org.bukkit.Location l)
        This is a convenience method to allow the QueuedCommand system to call it. You should NEVER call this directly.
        Parameters:
        teleporter - The Person requesting that the teleport should happen.
        p - Player The Person being teleported.
        l - The potentially unsafe location.
      • getServerFolder

        public java.io.File getServerFolder()
        Gets the server's root-folder as File.
        Returns:
        The server's root-folder
      • setServerFolder

        public void setServerFolder​(java.io.File newServerFolder)
        Sets this server's root-folder.
        Parameters:
        newServerFolder - The new server-root
      • saveMVConfig

        public boolean saveMVConfig()
        Saves the Multiverse-Config.
        Returns:
        Whether the Multiverse-Config was successfully saved
      • saveWorldConfig

        public boolean saveWorldConfig()
        Saves the world config.
        Returns:
        Whether the world-config was successfully saved
      • saveMVConfigs

        public boolean saveMVConfigs()
        Saves all configs.
        Specified by:
        saveMVConfigs in interface Core
        Returns:
        Whether the config was successfully saved
      • deleteWorld

        public java.lang.Boolean deleteWorld​(java.lang.String name)
        NOT deprecated for the time as queued commands use this. However, this is not in the API and other plugins should therefore not use it.
        Parameters:
        name - World to delete
        Returns:
        True if success, false if fail.
      • cloneWorld

        public java.lang.Boolean cloneWorld​(java.lang.String oldName,
                                            java.lang.String newName,
                                            java.lang.String generator)
        NOT deprecated for the time as queued commands use this. However, this is not in the API and other plugins should therefore not use it.
        Parameters:
        oldName - World to copy
        newName - World to create
        generator - The Custom generator plugin to use.
        Returns:
        True if success, false if fail.
      • regenWorld

        @Deprecated
        public java.lang.Boolean regenWorld​(java.lang.String name,
                                            java.lang.Boolean useNewSeed,
                                            java.lang.Boolean randomSeed,
                                            java.lang.String seed)
        Deprecated.
        This is deprecated! Do not use!
        Previously used by queued commands to regenerate a world on a delay. Do not use api method for any other purpose.
        Specified by:
        regenWorld in interface Core
        Parameters:
        name - Name of the world to regenerate
        useNewSeed - If a new seed should be used
        randomSeed - If the new seed should be random
        seed - The seed of the world.
        Returns:
        True if success, false if fail.
      • regenWorld

        @Deprecated
        public java.lang.Boolean regenWorld​(java.lang.String name,
                                            java.lang.Boolean useNewSeed,
                                            java.lang.Boolean randomSeed,
                                            java.lang.String seed,
                                            java.lang.Boolean keepGameRules)
        Deprecated.
        This is deprecated! Do not use!
        Used by queued commands to regenerate a world on a delay. Do not use api method for any other purpose.
        Specified by:
        regenWorld in interface Core
        Parameters:
        name - Name of the world to regenerate
        useNewSeed - If a new seed should be used
        randomSeed - If the new seed should be random
        seed - The seed of the world.
        keepGameRules - If GameRules should be kept on world regen.
        Returns:
        True if success, false if fail.
      • getStaticConfig

        @Deprecated
        public static MultiverseCoreConfiguration getStaticConfig()
        Deprecated.
        This is deprecated.
        This method is currently used by other plugins. It will be removed in 2.4
        Returns:
        The Multiverse config.
      • getScriptAPI

        public buscript.Buscript getScriptAPI()
        Description copied from interface: Core
        Gets the buscript object for Multiverse. This is what handles Javascript processing.
        Specified by:
        getScriptAPI in interface Core
        Returns:
        The Multiverse buscript object.