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 voidaddPlayerToTeleportQueue(java.lang.String teleporter, java.lang.String teleportee)This method is used to add a teleportation to the teleportQueue.java.lang.BooleancloneWorld(java.lang.String oldName, java.lang.String newName, java.lang.String generator)NOT deprecated for the time as queued commands use this.voiddecrementPluginCount()Decrements the number of plugins that have specifically hooked into core.java.lang.BooleandeleteWorld(java.lang.String name)NOT deprecated for the time as queued commands use this.java.lang.StringdumpVersionInfo(java.lang.String buffer)Deprecated.This is now deprecated, nobody needs it any longer.AnchorManagergetAnchorManager()Gets theAnchorManager.java.lang.StringgetAuthors()Parse the Authors Array into a readable String with ',' and 'and'.BlockSafetygetBlockSafety()Gets theBlockSafetythisCoreis using.MVChatListenergetChatListener()Gets theMVChatListener.com.pneumaticraft.commandhandler.CommandHandlergetCommandHandler()Multiverse usesCommandHandlerto make adding and using commands a piece of cake.CommandQueueManagergetCommandQueueManager()Deprecated.MultiverseCoregetCore()Gets the reference to MultiverseCore.DestinationFactorygetDestFactory()Gets the factory class responsible for loading many different destinations on demand.MVEconomistgetEconomist()Retrieves Multiverse's friendly economist.MVEntityListenergetEntityListener()Gets theMVEntityListener.LocationManipulationgetLocationManipulation()Gets theLocationManipulationthisCoreis using.MultiverseMessaginggetMessaging()Gets the Multiverse message system.MultiverseCoreConfiggetMVConfig()Gets theMultiverseCoreConfig.MVPermissionsgetMVPerms()Multiverse uses an advanced permissions setup, this object simplifies getting/setting permissions.MVWorldManagergetMVWorldManager()Gets the primary class responsible for managing Multiverse Worlds.MVPlayerListenergetPlayerListener()Gets theMVPlayerListener.MVPlayerSessiongetPlayerSession(org.bukkit.entity.Player player)Gets theMVPlayerSessionfor the given player.static java.lang.StringgetPlayerTeleporter(java.lang.String playerName)This method is used to find out who is teleporting a player.intgetPluginCount()Returns the number of plugins that have specifically hooked into core.intgetProtocolVersion()Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is.SafeTTeleportergetSafeTTeleporter()Gets theSafeTTeleporterthisCoreis using.buscript.BuscriptgetScriptAPI()Gets the buscript object for Multiverse.java.io.FilegetServerFolder()Gets the server's root-folder asFile.static MultiverseCoreConfigurationgetStaticConfig()Deprecated.This is deprecated.java.lang.StringgetTag()Gets the log-tag.UnsafeCallWrappergetUnsafeCallWrapper()VaultHandlergetVaultHandler()Deprecated.MVWeatherListenergetWeatherListener()Gets theMVWeatherListener.voidincrementPluginCount()Increments the number of plugins that have specifically hooked into core.voidloadConfigs()Reloads the Multiverse Configuration files: worlds.yml and config.yml.voidlog(java.util.logging.Level level, java.lang.String msg)Deprecated.This is now deprecated, nobody needs it any longer.booleanonCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, java.lang.String commandLabel, java.lang.String[] args)voidonDisable()voidonEnable()voidonLoad()java.lang.BooleanregenWorld(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.BooleanregenWorld(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!voidremovePlayerSession(org.bukkit.entity.Player player)Removes a player-session.booleansaveMVConfig()Saves the Multiverse-Config.booleansaveMVConfigs()Saves all configs.booleansaveWorldConfig()Saves the world config.voidsetBlockSafety(BlockSafety bs)Sets theBlockSafetythisCoreis using.voidsetCore(MultiverseCore core)Sets the reference to MultiverseCore.voidsetLocationManipulation(LocationManipulation locationManipulation)Sets theLocationManipulationthisCoreis using.voidsetSafeTTeleporter(SafeTTeleporter safeTTeleporter)Sets theSafeTTeleporterthisCoreis using.voidsetServerFolder(java.io.File newServerFolder)Sets this server's root-folder.voidshowNotMVWorldMessage(org.bukkit.command.CommandSender sender, java.lang.String worldName)Shows a message that the given world is not a MultiverseWorld.static voidstaticDebugLog(java.util.logging.Level level, java.lang.String msg)Deprecated.Replaced byLogging.static voidstaticLog(java.util.logging.Level level, java.lang.String msg)Deprecated.Replaced byLogging.voidteleportPlayer(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:
dumpVersionInfoin 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:MVPluginGets the reference to MultiverseCore.- Specified by:
getCorein interfaceMVPlugin- Returns:
- A valid
com.onarandombox.MultiverseCore.
-
setCore
public void setCore(MultiverseCore core)
Description copied from interface:MVPluginSets the reference to MultiverseCore.- Specified by:
setCorein interfaceMVPlugin- Parameters:
core- A validcom.onarandombox.MultiverseCore.
-
getProtocolVersion
public int getProtocolVersion()
Description copied from interface:MVPluginAllows 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:
getProtocolVersionin interfaceMVPlugin- Returns:
- The Integer protocol version.
-
onLoad
public void onLoad()
- Specified by:
onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
onLoadin classorg.bukkit.plugin.java.JavaPlugin
-
getVaultHandler
@Deprecated public VaultHandler getVaultHandler()
Deprecated.Description copied from interface:CoreReturns the Vault handler used by Multiverse. The returned object will have all methods necessary for interfacing with Vault.- Specified by:
getVaultHandlerin interfaceCore- Returns:
- the Vault handler for Multiverse.
-
getEconomist
public MVEconomist getEconomist()
Description copied from interface:CoreRetrieves Multiverse's friendly economist. The economist can be used for dealing with economies without worrying about any of the messy details.- Specified by:
getEconomistin interfaceCore- Returns:
- the economy manager for Multiverse.
-
onEnable
public void onEnable()
- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
loadConfigs
public void loadConfigs()
Reloads the Multiverse Configuration files: worlds.yml and config.yml.- Specified by:
loadConfigsin interfaceCore
-
getMessaging
public MultiverseMessaging getMessaging()
Gets the Multiverse message system. This allows you to send messages to users at specified intervals.- Specified by:
getMessagingin interfaceCore- Returns:
- The loaded
MultiverseMessaging.
-
onDisable
public void onDisable()
- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
getPlayerSession
public MVPlayerSession getPlayerSession(org.bukkit.entity.Player player)
Gets theMVPlayerSessionfor the given player. This will also create a player session if one does not exist for a player.- Specified by:
getPlayerSessionin 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:
getMVPermsin 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:
onCommandin interfaceorg.bukkit.command.CommandExecutor- Overrides:
onCommandin 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:
login 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-Levelmsg- The message
-
getAuthors
public java.lang.String getAuthors()
Parse the Authors Array into a readable String with ',' and 'and'.- Specified by:
getAuthorsin interfaceCore- Returns:
- The readable authors-
String
-
getCommandHandler
public com.pneumaticraft.commandhandler.CommandHandler getCommandHandler()
Multiverse usesCommandHandlerto make adding and using commands a piece of cake.- Specified by:
getCommandHandlerin interfaceCore- Returns:
- A non-null
CommandHandler.
-
getCommandQueueManager
@Deprecated public CommandQueueManager getCommandQueueManager()
Deprecated.Manager for command that requires /mv confirm before execution.- Specified by:
getCommandQueueManagerin 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- TheCommandSenderthat 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- ThePlayerthat owned the session.
-
getPluginCount
public int getPluginCount()
Returns the number of plugins that have specifically hooked into core.- Specified by:
getPluginCountin 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:
incrementPluginCountin interfaceCore
-
decrementPluginCount
public void decrementPluginCount()
Decrements the number of plugins that have specifically hooked into core.- Specified by:
decrementPluginCountin interfaceCore
-
getDestFactory
public DestinationFactory getDestFactory()
Gets the factory class responsible for loading many different destinations on demand.- Specified by:
getDestFactoryin 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:
getMVWorldManagerin 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:
saveMVConfigsin 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:
regenWorldin 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:
regenWorldin 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:
getAnchorManagerin interfaceCore- Returns:
- The
AnchorManager
-
getBlockSafety
public BlockSafety getBlockSafety()
Gets theBlockSafetythisCoreis using.- Specified by:
getBlockSafetyin interfaceCore- Returns:
- The
BlockSafetythisCoreis using. - See Also:
BlockSafety,SimpleBlockSafety
-
setBlockSafety
public void setBlockSafety(BlockSafety bs)
Sets theBlockSafetythisCoreis using.- Specified by:
setBlockSafetyin interfaceCore- Parameters:
bs- The newBlockSafety.- See Also:
BlockSafety,SimpleBlockSafety
-
getLocationManipulation
public LocationManipulation getLocationManipulation()
Gets theLocationManipulationthisCoreis using.- Specified by:
getLocationManipulationin interfaceCore- Returns:
- The
LocationManipulationthisCoreis using. - See Also:
LocationManipulation,SimpleLocationManipulation
-
setLocationManipulation
public void setLocationManipulation(LocationManipulation locationManipulation)
Sets theLocationManipulationthisCoreis using.- Specified by:
setLocationManipulationin interfaceCore- Parameters:
locationManipulation- The newLocationManipulation.- See Also:
LocationManipulation,SimpleLocationManipulation
-
getSafeTTeleporter
public SafeTTeleporter getSafeTTeleporter()
Gets theSafeTTeleporterthisCoreis using.- Specified by:
getSafeTTeleporterin interfaceCore- Returns:
- The
SafeTTeleporterthisCoreis using. - See Also:
SafeTTeleporter,SimpleSafeTTeleporter
-
setSafeTTeleporter
public void setSafeTTeleporter(SafeTTeleporter safeTTeleporter)
Sets theSafeTTeleporterthisCoreis using.- Specified by:
setSafeTTeleporterin interfaceCore- Parameters:
safeTTeleporter- The newSafeTTeleporter.- See Also:
SafeTTeleporter,SimpleSafeTTeleporter
-
getMVConfig
public MultiverseCoreConfig getMVConfig()
Gets theMultiverseCoreConfig.- Specified by:
getMVConfigin 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:CoreGets the buscript object for Multiverse. This is what handles Javascript processing.- Specified by:
getScriptAPIin interfaceCore- Returns:
- The Multiverse buscript object.
-
getUnsafeCallWrapper
public UnsafeCallWrapper getUnsafeCallWrapper()
-
-