AutoReferee  2.5
 All Classes Functions Variables
org.mctourney.autoreferee.AutoRefMap Class Reference

Represents a map object, available to be loaded by AutoReferee. More...

Inherits Comparable< AutoRefMap >.

Public Member Functions

String getName ()
 Gets the name of the map. More...
 
String getVersion ()
 Gets the version of the map. More...
 
String getVersionString ()
 Gets human-readable name of map, including version number. More...
 
File getZip () throws IOException
 Gets root zip for this map, downloading if necessary. More...
 
void install ()
 Installs the map if it is not already installed.
 
boolean isInstalled ()
 Gets whether the map has been installed. More...
 

Static Public Member Functions

static AutoRefMatch createMatch (String map, String world) throws IOException
 Creates match object given map name and an optional custom world name. More...
 
static AutoRefMatch createMatch (AutoRefMap map, String world) throws IOException
 Creates match object given map name and an optional custom world name. More...
 
static AutoRefMatch createMatch (AutoRefMatch.MatchParams params) throws IOException
 Generates a match from the given match parameters. More...
 
static Set< AutoRefMapgetAvailableMaps ()
 Gets all maps available to be loaded. More...
 
static Set< AutoRefMapgetInstalledMaps ()
 Gets maps installed locally on server. More...
 
static AutoRefMap getMap (String name)
 Gets map object associated with given map name. More...
 
static AutoRefMap getMapFromURL (String url) throws IOException
 Gets map object associated with the zip file at the provided URL. More...
 
static AutoRefMap getMapInfo (File zip)
 Get map info object associated with a zip. More...
 
static File getMapLibrary ()
 Gets root folder of map library, generating folder if necessary. More...
 
static Set< AutoRefMapgetRemoteMaps ()
 Gets maps that are not installed, but may be downloaded. More...
 
static void getUpdates (CommandSender sender, boolean force)
 Downloads updates to all maps installed on the server. More...
 
static void loadMap (CommandSender sender, String name, String worldname)
 Loads a map by name. More...
 
static void loadMap (CommandSender sender, AutoRefMap map, String worldname)
 Loads a map by name. More...
 
static void loadMapFromURL (CommandSender sender, String url, String worldname)
 Loads a map by URL. More...
 
static boolean parseMatchInitialization (String json)
 Handles JSON object to initialize matches. More...
 

Detailed Description

Represents a map object, available to be loaded by AutoReferee.

Author
authorblues

Member Function Documentation

static AutoRefMatch org.mctourney.autoreferee.AutoRefMap.createMatch ( String  map,
String  world 
) throws IOException
static

Creates match object given map name and an optional custom world name.

Parameters
mapname of map, to be downloaded if necessary
worldcustom name for world folder, or null
Returns
match object for the loaded world
Exceptions
IOExceptionif map download fails
static AutoRefMatch org.mctourney.autoreferee.AutoRefMap.createMatch ( AutoRefMap  map,
String  world 
) throws IOException
static

Creates match object given map name and an optional custom world name.

Parameters
mapmap object, to be downloaded if necessary
worldcustom name for world folder, or null
Returns
match object for the loaded world
Exceptions
IOExceptionif map download fails
static AutoRefMatch org.mctourney.autoreferee.AutoRefMap.createMatch ( AutoRefMatch.MatchParams  params) throws IOException
static

Generates a match from the given match parameters.

Parameters
paramsmatch parameters object
Returns
generated match object
Exceptions
IOExceptionif map download fails
static Set<AutoRefMap> org.mctourney.autoreferee.AutoRefMap.getAvailableMaps ( )
static

Gets all maps available to be loaded.

Returns
Set of all maps available to be loaded
static Set<AutoRefMap> org.mctourney.autoreferee.AutoRefMap.getInstalledMaps ( )
static

Gets maps installed locally on server.

Returns
set of all maps available to load immediately
static AutoRefMap org.mctourney.autoreferee.AutoRefMap.getMap ( String  name)
static

Gets map object associated with given map name.

Parameters
namename of map
Returns
map object associated with the name
static AutoRefMap org.mctourney.autoreferee.AutoRefMap.getMapFromURL ( String  url) throws IOException
static

Gets map object associated with the zip file at the provided URL.

Parameters
urlURL of map zip to be downloaded.
Returns
generated map object
Exceptions
IOExceptionif map cannot be unpackaged
static AutoRefMap org.mctourney.autoreferee.AutoRefMap.getMapInfo ( File  zip)
static

Get map info object associated with a zip.

Parameters
zipzip file containing a configuration file
Returns
map info object if zip contains a map, otherwise null
static File org.mctourney.autoreferee.AutoRefMap.getMapLibrary ( )
static

Gets root folder of map library, generating folder if necessary.

Returns
root folder of map library
String org.mctourney.autoreferee.AutoRefMap.getName ( )

Gets the name of the map.

Returns
map name
static Set<AutoRefMap> org.mctourney.autoreferee.AutoRefMap.getRemoteMaps ( )
static

Gets maps that are not installed, but may be downloaded.

Returns
set of all maps available for download
static void org.mctourney.autoreferee.AutoRefMap.getUpdates ( CommandSender  sender,
boolean  force 
)
static

Downloads updates to all maps installed on the server.

Parameters
senderuser receiving progress updates
forceforce re-download of maps, irrespective of version
String org.mctourney.autoreferee.AutoRefMap.getVersion ( )

Gets the version of the map.

Returns
map version
String org.mctourney.autoreferee.AutoRefMap.getVersionString ( )

Gets human-readable name of map, including version number.

Returns
map version string
File org.mctourney.autoreferee.AutoRefMap.getZip ( ) throws IOException

Gets root zip for this map, downloading if necessary.

Returns
root zip for map
Exceptions
IOExceptionif map download fails
boolean org.mctourney.autoreferee.AutoRefMap.isInstalled ( )

Gets whether the map has been installed.

Returns
true if map is installed, otherwise false
static void org.mctourney.autoreferee.AutoRefMap.loadMap ( CommandSender  sender,
String  name,
String  worldname 
)
static

Loads a map by name.

Parameters
senderuser receiving progress updates
namename of map to be loaded
worldnamename of custom world folder, possibly null
static void org.mctourney.autoreferee.AutoRefMap.loadMap ( CommandSender  sender,
AutoRefMap  map,
String  worldname 
)
static

Loads a map by name.

Parameters
senderuser receiving progress updates
mapmap to be loaded
worldnamename of custom world folder, possibly null
static void org.mctourney.autoreferee.AutoRefMap.loadMapFromURL ( CommandSender  sender,
String  url,
String  worldname 
)
static

Loads a map by URL.

Parameters
senderuser receiving progress updates
urlURL of map zip to be downloaded
worldnamename of custom world folder, possibly null
static boolean org.mctourney.autoreferee.AutoRefMap.parseMatchInitialization ( String  json)
static

Handles JSON object to initialize matches.

Parameters
jsonmatch parameters to be loaded
Returns
true if matches were loaded, otherwise false
See Also
AutoRefMatch.MatchParams

The documentation for this class was generated from the following file: