public class Minigame
extends java.lang.Object
Building against this version of the library is highly discouraged. This is a development build, and as such, is very prone to change. Methods may be in this version that will disappear in the next release, and existing methods may be temporarily refactored.
Modifier and Type | Method and Description |
---|---|
void |
createArena(java.lang.String name,
org.bukkit.Location spawn)
Deprecated.
|
void |
createArena(java.lang.String name,
Location3D spawn)
Creates an arena for use with MGLib.
|
ArenaFactory |
createArena(java.lang.String name,
Location3D spawn,
Location3D corner1,
Location3D corner2)
Creates an arena for use with MGLib.
|
ArenaFactory |
createArena(java.lang.String name,
org.bukkit.Location spawn,
org.bukkit.Location corner1,
org.bukkit.Location corner2)
Deprecated.
|
Round |
createRound(java.lang.String arena)
Creates and stores a new round with the given parameters.
|
void |
debug(java.lang.String message)
Logs the given message at
LogLevel.DEBUG . |
void |
deleteArena(java.lang.String name)
Removes an arena from the plugin's config, effectively deleting it.
|
ArenaFactory |
getArenaFactory(java.lang.String arena)
Retrieves an
ArenaFactory for the arena of the specified name. |
ConfigManager |
getConfigManager()
Retrieves this minigame's config manager.
|
LobbyManager |
getLobbyManager()
Retrieves this minigame's lobby manager.
|
Locale |
getLocale()
Returns the
Locale for this minigame. |
MGPlayer |
getMGPlayer(java.lang.String player)
Returns the
MGPlayer associated with the given username. |
static Minigame |
getMinigameInstance(org.bukkit.plugin.java.JavaPlugin plugin)
Deprecated.
|
static Minigame |
getMinigameInstance(java.lang.String plugin)
Finds the instance of the MGLib API associated with a given plugin.
|
static java.util.List<Minigame> |
getMinigameInstances()
Retrieves a
list of all registered minigame
instances. |
static java.util.HashMap<java.lang.String,java.util.UUID> |
getOnlineUUIDs()
Retrieves a hashmap mapping the names of online players to their
respective UUIDs.
|
org.bukkit.plugin.java.JavaPlugin |
getPlugin()
Deprecated.
Depends on Bukkit
|
RollbackManager |
getRollbackManager()
Retrieves this minigame's rollback manager.
|
Round |
getRound(java.lang.String name)
Retrieves the instance of the round associated with the given arena.
|
java.util.List<Round> |
getRoundList()
Retrieves a list containing all rounds associated with the instance which
registered this API instance.
|
java.util.HashMap<java.lang.String,Round> |
getRounds()
Retrieves a hashmap containing all rounds associated with the instance
which registered this API instance.
|
void |
info(java.lang.String message)
Logs the given message at
LogLevel.INFO . |
static boolean |
isMGLibCompatible(java.lang.String minReqVersion)
Determines whether this version of MGLib is compatibile with the
specified minimum required version.
|
boolean |
isPlayer(java.lang.String p)
Convenience method for checking if an
MGPlayer is associated with
the given username. |
void |
log(java.lang.String message,
LogLevel level)
Logs the given message at the specified logging level.
|
static Minigame |
registerPlugin(org.bukkit.plugin.java.JavaPlugin plugin)
Registers a plugin with the MGLib API.
|
void |
severe(java.lang.String message)
Logs the given message at
LogLevel.SEVERE . |
static void |
uninitialize()
Unsets all static objects in this class.
|
void |
verbose(java.lang.String message)
Logs the given message at
LogLevel.VERBOSE . |
void |
warning(java.lang.String message)
Logs the given message at
LogLevel.WARNING . |
public static Minigame registerPlugin(org.bukkit.plugin.java.JavaPlugin plugin)
plugin
- an instance of your plugin (can be substituted with this if
called from your main class)@Deprecated public org.bukkit.plugin.java.JavaPlugin getPlugin()
JavaPlugin
associated with this Minigame
instance.JavaPlugin
associated with this Minigame
instancepublic static java.util.List<Minigame> getMinigameInstances()
list
of all registered minigame
instances.list
of all registered minigame
instancespublic static Minigame getMinigameInstance(java.lang.String plugin)
plugin
- the name of the plugin to search for@Deprecated public static Minigame getMinigameInstance(org.bukkit.plugin.java.JavaPlugin plugin)
getMinigameInstance(String)
plugin
- the plugin to search forpublic java.util.HashMap<java.lang.String,Round> getRounds()
public java.util.List<Round> getRoundList()
public Round createRound(java.lang.String arena) throws NoSuchArenaException
arena
- the name of the arena to create the round inNoSuchArenaException
- if the given arena does not existpublic Round getRound(java.lang.String name)
name
- the name of the round to retrievepublic ArenaFactory createArena(java.lang.String name, Location3D spawn, Location3D corner1, Location3D corner2) throws InvalidLocationException, ArenaExistsException
name
- the name of the arena (used to identify it)spawn
- the initial spawn point of the arena (more may be added
later)corner1
- a corner of the arenacorner2
- the corner of the arena opposite corner1
ArenaFactory
InvalidLocationException
- if the given locations are not in the
same worldArenaExistsException
- if an arena of the same name already
exists@Deprecated public ArenaFactory createArena(java.lang.String name, org.bukkit.Location spawn, org.bukkit.Location corner1, org.bukkit.Location corner2) throws InvalidLocationException, ArenaExistsException
createArena(String, Location3D, Location3D, Location3D)
name
- the name of the arena (used to identify it)spawn
- the initial spawn point of the arena (more may be added
later)corner1
- a corner of the arenacorner2
- the corner of the arena opposite corner1
ArenaFactory
InvalidLocationException
- if the given locations are not in the
same worldArenaExistsException
- if an arena of the same name already
existspublic void createArena(java.lang.String name, Location3D spawn) throws ArenaExistsException
name
- the name of the arena (used to identify it)spawn
- the initial spawn point of the arena (more may be added
later)ArenaExistsException
- if an arena of the same name already exists@Deprecated public void createArena(java.lang.String name, org.bukkit.Location spawn) throws ArenaExistsException
createArena(String, Location3D)
name
- the name of the arena (used to identify it)spawn
- the initial spawn point of the arena (more may be added
later)ArenaExistsException
- if an arena of the same name already existspublic void deleteArena(java.lang.String name) throws NoSuchArenaException
name
- the arena to deleteNoSuchArenaException
- if an arena by the specified name does not
existpublic MGPlayer getMGPlayer(java.lang.String player)
MGPlayer
associated with the given username.player
- the username to search forMGPlayer
associated with the given username, or
null
if none is foundpublic boolean isPlayer(java.lang.String p)
MGPlayer
is associated with
the given username.
This method simply checks if Minigame#getMGPlayer(p)
is null
.
p
- the username to search forMGPlayer
was foundpublic ArenaFactory getArenaFactory(java.lang.String arena) throws NoSuchArenaException
ArenaFactory
for the arena of the specified name.arena
- the name of the arena to retrieve an ArenaFactory
forArenaFactory
NoSuchArenaException
- if the given arena does not exist. In this
case, you should instead use ArenaFactory.createArenaFactory(String,
String, String)
.public RollbackManager getRollbackManager()
public LobbyManager getLobbyManager()
public ConfigManager getConfigManager()
public Locale getLocale()
Locale
for this minigame.Locale
for this minigamepublic void log(java.lang.String message, LogLevel level)
message
- the message to loglevel
- the level at which to log the messagepublic void severe(java.lang.String message)
LogLevel.SEVERE
.message
- the message to logpublic void warning(java.lang.String message)
LogLevel.WARNING
.message
- the message to logpublic void info(java.lang.String message)
LogLevel.INFO
.message
- the message to logpublic void debug(java.lang.String message)
LogLevel.DEBUG
.message
- the message to logpublic void verbose(java.lang.String message)
LogLevel.VERBOSE
.message
- the message to logpublic static java.util.HashMap<java.lang.String,java.util.UUID> getOnlineUUIDs()
public static void uninitialize()
java.lang.UnsupportedOperationException
- if MGLib is not currently
disablingpublic static boolean isMGLibCompatible(java.lang.String minReqVersion)
minReqVersion
- the minimum required version of MGLib