Package com.onarandombox.MultiverseCore
Class MultiverseCore
- java.lang.Object
-
- org.bukkit.plugin.PluginBase
-
- org.bukkit.plugin.java.JavaPlugin
-
- com.onarandombox.MultiverseCore.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 Summary
Constructors Constructor Description MultiverseCore()
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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addPlayerToTeleportQueue(java.lang.String teleporter, java.lang.String teleportee)
This method is used to add a teleportation to the teleportQueue.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.void
decrementPluginCount()
Decrements the number of plugins that have specifically hooked into core.java.lang.Boolean
deleteWorld(java.lang.String name)
NOT deprecated for the time as queued commands use this.java.lang.String
dumpVersionInfo(java.lang.String buffer)
Deprecated.This is now deprecated, nobody needs it any longer.AnchorManager
getAnchorManager()
Gets theAnchorManager
.java.lang.String
getAuthors()
Parse the Authors Array into a readable String with ',' and 'and'.BlockSafety
getBlockSafety()
Gets theBlockSafety
thisCore
is using.MVChatListener
getChatListener()
Gets theMVChatListener
.com.pneumaticraft.commandhandler.CommandHandler
getCommandHandler()
Multiverse usesCommandHandler
to make adding and using commands a piece of cake.CommandQueueManager
getCommandQueueManager()
Deprecated.MultiverseCore
getCore()
Gets the reference to MultiverseCore.DestinationFactory
getDestFactory()
Gets the factory class responsible for loading many different destinations on demand.MVEconomist
getEconomist()
Retrieves Multiverse's friendly economist.MVEntityListener
getEntityListener()
Gets theMVEntityListener
.LocationManipulation
getLocationManipulation()
Gets theLocationManipulation
thisCore
is using.MultiverseMessaging
getMessaging()
Gets the Multiverse message system.MultiverseCoreConfig
getMVConfig()
Gets theMultiverseCoreConfig
.MVPermissions
getMVPerms()
Multiverse uses an advanced permissions setup, this object simplifies getting/setting permissions.MVWorldManager
getMVWorldManager()
Gets the primary class responsible for managing Multiverse Worlds.MVPlayerListener
getPlayerListener()
Gets theMVPlayerListener
.MVPlayerSession
getPlayerSession(org.bukkit.entity.Player player)
Gets theMVPlayerSession
for the given player.static java.lang.String
getPlayerTeleporter(java.lang.String playerName)
This method is used to find out who is teleporting a player.int
getPluginCount()
Returns the number of plugins that have specifically hooked into core.int
getProtocolVersion()
Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is.SafeTTeleporter
getSafeTTeleporter()
Gets theSafeTTeleporter
thisCore
is using.buscript.Buscript
getScriptAPI()
Gets the buscript object for Multiverse.java.io.File
getServerFolder()
Gets the server's root-folder asFile
.static MultiverseCoreConfiguration
getStaticConfig()
Deprecated.This is deprecated.java.lang.String
getTag()
Gets the log-tag.UnsafeCallWrapper
getUnsafeCallWrapper()
VaultHandler
getVaultHandler()
Deprecated.MVWeatherListener
getWeatherListener()
Gets theMVWeatherListener
.void
incrementPluginCount()
Increments the number of plugins that have specifically hooked into core.void
loadConfigs()
Reloads the Multiverse Configuration files: worlds.yml and config.yml.void
log(java.util.logging.Level level, java.lang.String msg)
Deprecated.This is now deprecated, nobody needs it any longer.boolean
onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, java.lang.String commandLabel, java.lang.String[] args)
void
onDisable()
void
onEnable()
void
onLoad()
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!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!void
removePlayerSession(org.bukkit.entity.Player player)
Removes a player-session.boolean
saveMVConfig()
Saves the Multiverse-Config.boolean
saveMVConfigs()
Saves all configs.boolean
saveWorldConfig()
Saves the world config.void
setBlockSafety(BlockSafety bs)
Sets theBlockSafety
thisCore
is using.void
setCore(MultiverseCore core)
Sets the reference to MultiverseCore.void
setLocationManipulation(LocationManipulation locationManipulation)
Sets theLocationManipulation
thisCore
is using.void
setSafeTTeleporter(SafeTTeleporter safeTTeleporter)
Sets theSafeTTeleporter
thisCore
is using.void
setServerFolder(java.io.File newServerFolder)
Sets this server's root-folder.void
showNotMVWorldMessage(org.bukkit.command.CommandSender sender, java.lang.String worldName)
Shows a message that the given world is not a MultiverseWorld.static void
staticDebugLog(java.util.logging.Level level, java.lang.String msg)
Deprecated.Replaced byLogging
.static void
staticLog(java.util.logging.Level level, java.lang.String msg)
Deprecated.Replaced byLogging
.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.-
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.onarandombox.MultiverseCore.api.LoggablePlugin
getServer
-
-
-
-
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 withMVVersionEvent
.Adds This plugin's version information to the buffer and returns the new string.- Specified by:
dumpVersionInfo
in interfaceMVPlugin
- Parameters:
buffer
- The string that contains Core and all other MV plugins' versions.- Returns:
- A modified buffer that contains this MVPlugin's version information.
-
getCore
public MultiverseCore getCore()
Description copied from interface:MVPlugin
Gets the reference to MultiverseCore.- Specified by:
getCore
in interfaceMVPlugin
- Returns:
- A valid
com.onarandombox.MultiverseCore
.
-
setCore
public void setCore(MultiverseCore core)
Description copied from interface:MVPlugin
Sets the reference to MultiverseCore.- Specified by:
setCore
in interfaceMVPlugin
- Parameters:
core
- A validcom.onarandombox.MultiverseCore
.
-
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 interfaceMVPlugin
- Returns:
- The Integer protocol version.
-
onLoad
public void onLoad()
- Specified by:
onLoad
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.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 interfaceCore
- 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 interfaceCore
- Returns:
- the economy manager for Multiverse.
-
onEnable
public void onEnable()
- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
loadConfigs
public void loadConfigs()
Reloads the Multiverse Configuration files: worlds.yml and config.yml.- Specified by:
loadConfigs
in interfaceCore
-
getMessaging
public MultiverseMessaging getMessaging()
Gets the Multiverse message system. This allows you to send messages to users at specified intervals.- Specified by:
getMessaging
in interfaceCore
- Returns:
- The loaded
MultiverseMessaging
.
-
onDisable
public void onDisable()
- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
getPlayerSession
public MVPlayerSession getPlayerSession(org.bukkit.entity.Player player)
Gets theMVPlayerSession
for the given player. This will also create a player session if one does not exist for a player.- Specified by:
getPlayerSession
in interfaceCore
- 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 interfaceCore
- 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 interfaceorg.bukkit.command.CommandExecutor
- Overrides:
onCommand
in classorg.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 withLogging
.Logs a message at the specified level.- Specified by:
log
in interfaceLoggablePlugin
- 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 byLogging
. 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 byLogging
. 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 interfaceCore
- Returns:
- The readable authors-
String
-
getCommandHandler
public com.pneumaticraft.commandhandler.CommandHandler getCommandHandler()
Multiverse usesCommandHandler
to make adding and using commands a piece of cake.- Specified by:
getCommandHandler
in interfaceCore
- Returns:
- A non-null
CommandHandler
.
-
getCommandQueueManager
@Deprecated public CommandQueueManager getCommandQueueManager()
Deprecated.Manager for command that requires /mv confirm before execution.- Specified by:
getCommandQueueManager
in interfaceCore
- Returns:
- A non-null
CommandQueueManager
.
-
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
- TheCommandSender
that should receive the messageworldName
- The name of the invalid world
-
removePlayerSession
public void removePlayerSession(org.bukkit.entity.Player player)
Removes a player-session.- Parameters:
player
- ThePlayer
that owned the session.
-
getPluginCount
public int getPluginCount()
Returns the number of plugins that have specifically hooked into core.- Specified by:
getPluginCount
in interfaceCore
- 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 interfaceCore
-
decrementPluginCount
public void decrementPluginCount()
Decrements the number of plugins that have specifically hooked into core.- Specified by:
decrementPluginCount
in interfaceCore
-
getDestFactory
public DestinationFactory getDestFactory()
Gets the factory class responsible for loading many different destinations on demand.- Specified by:
getDestFactory
in interfaceCore
- Returns:
- A valid
DestinationFactory
.
-
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 asFile
.- 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
-
getMVWorldManager
public MVWorldManager getMVWorldManager()
Gets the primary class responsible for managing Multiverse Worlds.- Specified by:
getMVWorldManager
in interfaceCore
- Returns:
MVWorldManager
.
-
getPlayerListener
public MVPlayerListener getPlayerListener()
Gets theMVPlayerListener
.- Returns:
- The
MVPlayerListener
.
-
getChatListener
public MVChatListener getChatListener()
Gets theMVChatListener
.- Returns:
- The
MVChatListener
.
-
getEntityListener
public MVEntityListener getEntityListener()
Gets theMVEntityListener
.- Returns:
- The
MVEntityListener
.
-
getWeatherListener
public MVWeatherListener getWeatherListener()
Gets theMVWeatherListener
.- Returns:
- The
MVWeatherListener
.
-
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 interfaceCore
- 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 copynewName
- World to creategenerator
- 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 interfaceCore
- Parameters:
name
- Name of the world to regenerateuseNewSeed
- If a new seed should be usedrandomSeed
- If the new seed should be randomseed
- 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 interfaceCore
- Parameters:
name
- Name of the world to regenerateuseNewSeed
- If a new seed should be usedrandomSeed
- If the new seed should be randomseed
- The seed of the world.keepGameRules
- If GameRules should be kept on world regen.- Returns:
- True if success, false if fail.
-
getAnchorManager
public AnchorManager getAnchorManager()
Gets theAnchorManager
.- Specified by:
getAnchorManager
in interfaceCore
- Returns:
- The
AnchorManager
-
getBlockSafety
public BlockSafety getBlockSafety()
Gets theBlockSafety
thisCore
is using.- Specified by:
getBlockSafety
in interfaceCore
- Returns:
- The
BlockSafety
thisCore
is using. - See Also:
BlockSafety
,SimpleBlockSafety
-
setBlockSafety
public void setBlockSafety(BlockSafety bs)
Sets theBlockSafety
thisCore
is using.- Specified by:
setBlockSafety
in interfaceCore
- Parameters:
bs
- The newBlockSafety
.- See Also:
BlockSafety
,SimpleBlockSafety
-
getLocationManipulation
public LocationManipulation getLocationManipulation()
Gets theLocationManipulation
thisCore
is using.- Specified by:
getLocationManipulation
in interfaceCore
- Returns:
- The
LocationManipulation
thisCore
is using. - See Also:
LocationManipulation
,SimpleLocationManipulation
-
setLocationManipulation
public void setLocationManipulation(LocationManipulation locationManipulation)
Sets theLocationManipulation
thisCore
is using.- Specified by:
setLocationManipulation
in interfaceCore
- Parameters:
locationManipulation
- The newLocationManipulation
.- See Also:
LocationManipulation
,SimpleLocationManipulation
-
getSafeTTeleporter
public SafeTTeleporter getSafeTTeleporter()
Gets theSafeTTeleporter
thisCore
is using.- Specified by:
getSafeTTeleporter
in interfaceCore
- Returns:
- The
SafeTTeleporter
thisCore
is using. - See Also:
SafeTTeleporter
,SimpleSafeTTeleporter
-
setSafeTTeleporter
public void setSafeTTeleporter(SafeTTeleporter safeTTeleporter)
Sets theSafeTTeleporter
thisCore
is using.- Specified by:
setSafeTTeleporter
in interfaceCore
- Parameters:
safeTTeleporter
- The newSafeTTeleporter
.- See Also:
SafeTTeleporter
,SimpleSafeTTeleporter
-
getMVConfig
public MultiverseCoreConfig getMVConfig()
Gets theMultiverseCoreConfig
.- Specified by:
getMVConfig
in interfaceCore
- Returns:
- The configuration.
-
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 interfaceCore
- Returns:
- The Multiverse buscript object.
-
getUnsafeCallWrapper
public UnsafeCallWrapper getUnsafeCallWrapper()
-
-