AutoReferee
2.5
|
Represents a game world controlled by AutoReferee. More...
Inherits org.mctourney.autoreferee.util.Metadatable.
Inherited by org.mctourney.autoreferee.FreeForAllMatch.
Classes | |
enum | MatchStatus |
Represents the status of a match. More... | |
Public Member Functions | |
void | addEvent (TranscriptEvent event) |
Adds an event to the match transcript. More... | |
void | addExpectedPlayer (OfflinePlayer opl) |
Adds a player to the list of expected players, without a team affiliation. | |
void | addIllegalCraft (BlockData blockdata) |
Prohibits an item from being crafted during a match. More... | |
boolean | allowFriendlyFire () |
Checks if friendly fire is allowed in this match. More... | |
boolean | allowObjectiveCraft () |
Checks if players are allowed to craft objectives in this match. More... | |
void | broadcast (String...msgs) |
Sends a message to all players in this match, including referees and streamers. More... | |
void | broadcastSync (String...msgs) |
Force a broadcast to be sent synchronously. More... | |
void | cancelCountdown () |
Cancels the match countdown in progress. | |
boolean | canCraft (BlockData blockdata) |
Checks if a item is prohibited from crafting. More... | |
void | checkTeamsReady () |
Checks if teams have any players missing and are ready to play. | |
void | checkTeamsStart () |
Checks if teams and referees are ready for the match to start. | |
void | checkWinConditions () |
Checks if any team has satisfied the win conditions. | |
void | clearEntities () |
Removes unprotected entities from the world. | |
String | colorMessage (String message) |
Colors a message with team and objective colors. More... | |
void | destroy (MatchUnloadEvent.Reason reason) |
Unloads and cleans up this match. More... | |
double | distanceToClosestRegion (Player player) |
Gets distance player is from their team's nearest region. More... | |
File | distributeMap () throws IOException |
Packages and compresses (zip) map folder for easy distribution. More... | |
void | eliminatePlayer (Player player) |
Eliminates player from the match. | |
void | endMatch () |
Ends match, allowing AutoReferee to break ties according to its own policies. | |
void | endMatch (AutoRefTeam team) |
Ends match in favor of a specified team. More... | |
AutoRefTeam | expectedTeam (OfflinePlayer opl) |
Gets the team the specified player is expected to join. More... | |
AutoRefTeam | getArbitraryTeam () |
Gets an arbitrary team, attempting to maintain balanced teams if possible. More... | |
String | getAuthorList () |
Gets the creators of the map for this match. More... | |
MatchStatus | getCurrentState () |
Gets the current status of this match. More... | |
String | getDisplayName (Player player) |
Gets colored player name for a specified player. More... | |
long | getElapsedSeconds () |
Gets the number of seconds elapsed in this match. More... | |
int | getInexactRange () |
Gets the distance an objective may be placed from its target location. More... | |
Collection< String > | getMapAuthors () |
Gets the creators of the map for this match. More... | |
String | getMapName () |
Gets the name of the map for this match. More... | |
String | getMapVersion () |
Gets the version number of the map for this match. More... | |
ItemStack | getMatchInfoBook () |
Gets the book given to players upon joining this match. | |
String | getMatchName () |
Gets the name of this match. More... | |
AutoRefPlayer | getNearestPlayer (Location loc) |
Gets the player nearest to a specified location. More... | |
AutoRefPlayer | getPlayer (String name) |
Gets AutoRefPlayer object associated with a given player. More... | |
AutoRefPlayer | getPlayer (OfflinePlayer player) |
Gets AutoRefPlayer object associated with a given player. More... | |
Location | getPlayerSpawn (Player player) |
Gets spawn location for the specified player, based on team. More... | |
AutoRefTeam | getPlayerTeam (Player player) |
Gets the team for a specified player. More... | |
int | getReadyDelay () |
Gets number of seconds between start of countdown and match starting. More... | |
Set< Player > | getReferees () |
Gets all non-streamer referees present in this match. More... | |
Set< Player > | getReferees (boolean excludeStreamers) |
Gets referees present in this match, possibly excluding streamers. More... | |
ReportGenerator | getReportGenerator () |
Gets the mutable report generator object. More... | |
Role | getRole (OfflinePlayer player) |
Gets the role that this player has in this match. More... | |
Set< Player > | getSpectators () |
Gets all match spectators (spectators, referees, and streamers). More... | |
Location | getSpectatorSpawn () |
Gets the global spawn location for this match. More... | |
long | getStartClock () |
Gets the time to set the world to at the start of the match. More... | |
StartMechanism | getStartMechanism (Block block) |
Gets the start mechanism associated with this location. More... | |
Set< AutoRefRegion > | getStartRegions () |
Gets the region designated as the start platform. More... | |
Set< Player > | getStreamers () |
Gets streamers present in this match. More... | |
AutoRefTeam | getTeam (String name) |
Finds a team whose name matches the given string. More... | |
Set< AutoRefTeam > | getTeams () |
Gets the teams participating in this match. More... | |
long | getTimeLimit () |
Gets the match time limit in seconds. More... | |
long | getTimeRemaining () |
Gets the number of seconds remaining in this match. More... | |
String | getTimestamp () |
Gets current match time, default value separator (colon). More... | |
String | getTimestamp (String sep) |
Gets current match time, with value separator. More... | |
List< TranscriptEvent > | getTranscript () |
Gets the current match transcript up to this point in time. More... | |
int | getUserCount () |
Gets number of users (players and spectators) present in this match. More... | |
String | getVersionString () |
Gets the shorthand version string of the map for this match. More... | |
AutoRefTeam | getWinningTeam () |
Gets the team that won this match. More... | |
World | getWorld () |
Gets the world associated with this match. More... | |
Location | getWorldSpawn () |
Gets the global spawn location for this match. More... | |
boolean | hasFlag (Location loc, AutoRefRegion.Flag flag) |
Checks if a region is marked with a specific region flag. More... | |
boolean | hasTimeLimit () |
Checks if this match has a set time limit. More... | |
boolean | inStartRegion (Location loc) |
Checks if a specified location is within the start region. More... | |
boolean | isCountdownRunning () |
Checks if the match start countdown is running. More... | |
boolean | isPlayer (OfflinePlayer pl) |
Checks if the specified player is on a team. More... | |
boolean | isPlayerExpected (OfflinePlayer opl) |
Checks if the specified player is expected to join this match. More... | |
boolean | isReferee (Player player) |
Checks if the specified player is a referee for this match. More... | |
boolean | isRefereeReady () |
Checks if the referees are ready for the match to start. More... | |
boolean | isSpectator (Player player) |
Checks if the specified player is a spectator for this match. More... | |
boolean | isStartMechanism (Block block) |
Checks if a specified block location is a start mechanism for this match. More... | |
boolean | isStreamer (Player player) |
Checks if the specified player is a streamer for this match. More... | |
void | joinMatch (Player player) |
Teleports a player to a match they have been added to, joining the team inviting them. | |
boolean | joinTeam (Player player, AutoRefTeam team, PlayerTeamJoinEvent.Reason reason, boolean force) |
Adds a player to the specified team. More... | |
void | leaveTeam (Player player, boolean force) |
Removes player from all teams. More... | |
void | messageReferees (String...parts) |
Sends a referee plugin channel message to all referees, properly delimited. | |
void | reload () |
Reloads world configuration from config file. | |
void | removeExpectedPlayer (OfflinePlayer opl) |
Removes a specified player from any expected player lists for this match. | |
void | saveWorldConfiguration () |
Saves copy of autoreferee.xml back to the world folder. | |
void | sendMatchInfo (CommandSender sender) |
Send updated match information to a player. | |
void | setCurrentState (MatchStatus status) |
Sets the current status of this match. More... | |
void | setCustomMatchInfoBook (ItemStack book) |
Sets a custom book given to players upon joining this match. More... | |
void | setFriendlyFire (boolean b) |
Sets whether friendly fire is allowed in this match. | |
void | setLastNotificationLocation (Location loc) |
Sets a notification location for referees and streamers. More... | |
void | setMatchName (String name) |
Sets the custom name for this match. More... | |
void | setObjectiveCraft (boolean b) |
Sets whether players are allowed to craft objectives in this match. | |
void | setReadyDelay (int delay) |
Sets number of seconds between start of countdown and match starting. | |
void | setRefereeReady (boolean r) |
Sets whether the referees are ready for the match to start. | |
void | setSpectatorMode (Player player, boolean spec) |
Sets whether a specified player is in spectator mode, explicitly setting gamemode. More... | |
void | setStartClock (long time) |
Sets the time that will be set at the start of the match. More... | |
void | setTimeLimit (long limit) |
Sets match time limit in seconds. More... | |
void | setupSpectators () |
Reconfigures spectator mode for all connected players. | |
void | setupSpectators (Player player) |
Reconfigures spectator mode for a single player. More... | |
void | setupVisibility (Player player) |
Reconfigures visibility, to and from the specified player. | |
void | setWinningTeam (AutoRefTeam team) |
Sets the team that won this match. | |
void | startCountdown (int delay, boolean start) |
Starts a countdown. More... | |
StartMechanism | toggleStartMech (Block block, boolean state) |
Adds a new start mechanism for this map. More... | |
void | updateReferee (Player ref) |
Sends all information to a single referee necessary to sync a match's current status. More... | |
Static Public Member Functions | |
static boolean | areTiesAllowed () |
Checks if ties are allowed on this server. More... | |
static void | changeMapRepo (String url) |
Sets a new map repository for the plugin to download maps. More... | |
static String | getMapRepo () |
Get the base url for the map repository. More... | |
static boolean | isCompatible (World world) |
Checks if the given world is compatible with AutoReferee. More... | |
static void | messageReferee (Player ref, String...parts) |
Sends a referee plugin channel message to a specific referee, properly delimited. More... | |
static String | normalizeMapName (String name) |
Removes any non-alphanumeric characters from a map name. More... | |
static long | parseTimeString (String time) |
Converts a human-readable time to a clock tick in Minecraft. More... | |
static void | setAllowTies (boolean b) |
Sets whether ties are allowed on this server. | |
static void | setupWorld (World world, boolean tmp) |
Assigns a world a match object. More... | |
Protected Member Functions | |
void | _startMatch () |
Starts the match. | |
Represents a game world controlled by AutoReferee.
void org.mctourney.autoreferee.AutoRefMatch.addEvent | ( | TranscriptEvent | event) |
Adds an event to the match transcript.
Announces the event to the appropriate recipients.
event | event to be added to the transcript |
void org.mctourney.autoreferee.AutoRefMatch.addIllegalCraft | ( | BlockData | blockdata) |
Prohibits an item from being crafted during a match.
blockdata | block data object for the prohibited item |
boolean org.mctourney.autoreferee.AutoRefMatch.allowFriendlyFire | ( | ) |
Checks if friendly fire is allowed in this match.
boolean org.mctourney.autoreferee.AutoRefMatch.allowObjectiveCraft | ( | ) |
Checks if players are allowed to craft objectives in this match.
|
static |
Checks if ties are allowed on this server.
void org.mctourney.autoreferee.AutoRefMatch.broadcast | ( | String... | msgs) |
Sends a message to all players in this match, including referees and streamers.
msgs | messages to be sent |
void org.mctourney.autoreferee.AutoRefMatch.broadcastSync | ( | String... | msgs) |
Force a broadcast to be sent synchronously.
Safe to use from an asynchronous task.
msgs | messages to be sent |
boolean org.mctourney.autoreferee.AutoRefMatch.canCraft | ( | BlockData | blockdata) |
Checks if a item is prohibited from crafting.
blockdata | block data object for the item being queried |
|
static |
Sets a new map repository for the plugin to download maps.
url | url of new map repository to use |
String org.mctourney.autoreferee.AutoRefMatch.colorMessage | ( | String | message) |
Colors a message with team and objective colors.
Prepares a message for broadcasting to the chat, and should be used as a pre-processing step whenever a message needs to be pretty-printed.
message | plain message |
void org.mctourney.autoreferee.AutoRefMatch.destroy | ( | MatchUnloadEvent.Reason | reason) |
Unloads and cleans up this match.
Players will be teleported out or kicked, the map will be unloaded, and the map folder may be deleted.
double org.mctourney.autoreferee.AutoRefMatch.distanceToClosestRegion | ( | Player | player) |
Gets distance player is from their team's nearest region.
File org.mctourney.autoreferee.AutoRefMatch.distributeMap | ( | ) | throws IOException |
Packages and compresses (zip) map folder for easy distribution.
IOException | if map cannot be archived |
void org.mctourney.autoreferee.AutoRefMatch.endMatch | ( | AutoRefTeam | team) |
Ends match in favor of a specified team.
team | winning team, or null for no winner |
AutoRefTeam org.mctourney.autoreferee.AutoRefMatch.expectedTeam | ( | OfflinePlayer | opl) |
Gets the team the specified player is expected to join.
AutoRefTeam org.mctourney.autoreferee.AutoRefMatch.getArbitraryTeam | ( | ) |
Gets an arbitrary team, attempting to maintain balanced teams if possible.
String org.mctourney.autoreferee.AutoRefMatch.getAuthorList | ( | ) |
Gets the creators of the map for this match.
MatchStatus org.mctourney.autoreferee.AutoRefMatch.getCurrentState | ( | ) |
Gets the current status of this match.
String org.mctourney.autoreferee.AutoRefMatch.getDisplayName | ( | Player | player) |
Gets colored player name for a specified player.
long org.mctourney.autoreferee.AutoRefMatch.getElapsedSeconds | ( | ) |
Gets the number of seconds elapsed in this match.
int org.mctourney.autoreferee.AutoRefMatch.getInexactRange | ( | ) |
Gets the distance an objective may be placed from its target location.
Collection<String> org.mctourney.autoreferee.AutoRefMatch.getMapAuthors | ( | ) |
Gets the creators of the map for this match.
String org.mctourney.autoreferee.AutoRefMatch.getMapName | ( | ) |
Gets the name of the map for this match.
|
static |
Get the base url for the map repository.
String org.mctourney.autoreferee.AutoRefMatch.getMapVersion | ( | ) |
Gets the version number of the map for this match.
String org.mctourney.autoreferee.AutoRefMatch.getMatchName | ( | ) |
Gets the name of this match.
AutoRefPlayer org.mctourney.autoreferee.AutoRefMatch.getNearestPlayer | ( | Location | loc) |
Gets the player nearest to a specified location.
AutoRefPlayer org.mctourney.autoreferee.AutoRefMatch.getPlayer | ( | String | name) |
Gets AutoRefPlayer object associated with a given player.
name | player name |
AutoRefPlayer org.mctourney.autoreferee.AutoRefMatch.getPlayer | ( | OfflinePlayer | player) |
Gets AutoRefPlayer object associated with a given player.
Location org.mctourney.autoreferee.AutoRefMatch.getPlayerSpawn | ( | Player | player) |
Gets spawn location for the specified player, based on team.
AutoRefTeam org.mctourney.autoreferee.AutoRefMatch.getPlayerTeam | ( | Player | player) |
Gets the team for a specified player.
int org.mctourney.autoreferee.AutoRefMatch.getReadyDelay | ( | ) |
Gets number of seconds between start of countdown and match starting.
Set<Player> org.mctourney.autoreferee.AutoRefMatch.getReferees | ( | ) |
Gets all non-streamer referees present in this match.
Set<Player> org.mctourney.autoreferee.AutoRefMatch.getReferees | ( | boolean | excludeStreamers) |
Gets referees present in this match, possibly excluding streamers.
excludeStreamers | whether streamers should be included |
ReportGenerator org.mctourney.autoreferee.AutoRefMatch.getReportGenerator | ( | ) |
Gets the mutable report generator object.
Role org.mctourney.autoreferee.AutoRefMatch.getRole | ( | OfflinePlayer | player) |
Gets the role that this player has in this match.
Set<Player> org.mctourney.autoreferee.AutoRefMatch.getSpectators | ( | ) |
Gets all match spectators (spectators, referees, and streamers).
Location org.mctourney.autoreferee.AutoRefMatch.getSpectatorSpawn | ( | ) |
Gets the global spawn location for this match.
long org.mctourney.autoreferee.AutoRefMatch.getStartClock | ( | ) |
Gets the time to set the world to at the start of the match.
StartMechanism org.mctourney.autoreferee.AutoRefMatch.getStartMechanism | ( | Block | block) |
Gets the start mechanism associated with this location.
Set<AutoRefRegion> org.mctourney.autoreferee.AutoRefMatch.getStartRegions | ( | ) |
Gets the region designated as the start platform.
This region should contain the world spawn location. Players in this region are immune to damage from other players, and mobs will not spawn in this region.
Set<Player> org.mctourney.autoreferee.AutoRefMatch.getStreamers | ( | ) |
Gets streamers present in this match.
AutoRefTeam org.mctourney.autoreferee.AutoRefMatch.getTeam | ( | String | name) |
Finds a team whose name matches the given string.
name | team name to look up, either custom team name or base team name |
Set<AutoRefTeam> org.mctourney.autoreferee.AutoRefMatch.getTeams | ( | ) |
Gets the teams participating in this match.
long org.mctourney.autoreferee.AutoRefMatch.getTimeLimit | ( | ) |
Gets the match time limit in seconds.
long org.mctourney.autoreferee.AutoRefMatch.getTimeRemaining | ( | ) |
Gets the number of seconds remaining in this match.
String org.mctourney.autoreferee.AutoRefMatch.getTimestamp | ( | ) |
Gets current match time, default value separator (colon).
String org.mctourney.autoreferee.AutoRefMatch.getTimestamp | ( | String | sep) |
Gets current match time, with value separator.
sep | time value separator |
List<TranscriptEvent> org.mctourney.autoreferee.AutoRefMatch.getTranscript | ( | ) |
Gets the current match transcript up to this point in time.
int org.mctourney.autoreferee.AutoRefMatch.getUserCount | ( | ) |
Gets number of users (players and spectators) present in this match.
String org.mctourney.autoreferee.AutoRefMatch.getVersionString | ( | ) |
Gets the shorthand version string of the map for this match.
This string will have the format of "MapName-vX.Y"
AutoRefTeam org.mctourney.autoreferee.AutoRefMatch.getWinningTeam | ( | ) |
Gets the team that won this match.
World org.mctourney.autoreferee.AutoRefMatch.getWorld | ( | ) |
Gets the world associated with this match.
Location org.mctourney.autoreferee.AutoRefMatch.getWorldSpawn | ( | ) |
Gets the global spawn location for this match.
boolean org.mctourney.autoreferee.AutoRefMatch.hasFlag | ( | Location | loc, |
AutoRefRegion.Flag | flag | ||
) |
Checks if a region is marked with a specific region flag.
boolean org.mctourney.autoreferee.AutoRefMatch.hasTimeLimit | ( | ) |
Checks if this match has a set time limit.
boolean org.mctourney.autoreferee.AutoRefMatch.inStartRegion | ( | Location | loc) |
Checks if a specified location is within the start region.
|
static |
Checks if the given world is compatible with AutoReferee.
world | world to check |
boolean org.mctourney.autoreferee.AutoRefMatch.isCountdownRunning | ( | ) |
Checks if the match start countdown is running.
boolean org.mctourney.autoreferee.AutoRefMatch.isPlayer | ( | OfflinePlayer | pl) |
Checks if the specified player is on a team.
boolean org.mctourney.autoreferee.AutoRefMatch.isPlayerExpected | ( | OfflinePlayer | opl) |
Checks if the specified player is expected to join this match.
boolean org.mctourney.autoreferee.AutoRefMatch.isReferee | ( | Player | player) |
Checks if the specified player is a referee for this match.
boolean org.mctourney.autoreferee.AutoRefMatch.isRefereeReady | ( | ) |
Checks if the referees are ready for the match to start.
boolean org.mctourney.autoreferee.AutoRefMatch.isSpectator | ( | Player | player) |
Checks if the specified player is a spectator for this match.
boolean org.mctourney.autoreferee.AutoRefMatch.isStartMechanism | ( | Block | block) |
Checks if a specified block location is a start mechanism for this match.
boolean org.mctourney.autoreferee.AutoRefMatch.isStreamer | ( | Player | player) |
Checks if the specified player is a streamer for this match.
boolean org.mctourney.autoreferee.AutoRefMatch.joinTeam | ( | Player | player, |
AutoRefTeam | team, | ||
PlayerTeamJoinEvent.Reason | reason, | ||
boolean | force | ||
) |
Adds a player to the specified team.
Removes the player from any other teams first, if necessary. Roster changes are restricted while a match is in progress, unless forced.
player | player to be added to team |
team | team to add player to |
force | should player be added to team, even if match is in progress |
void org.mctourney.autoreferee.AutoRefMatch.leaveTeam | ( | Player | player, |
boolean | force | ||
) |
Removes player from all teams.
player | player to be removed |
force | should player be removed, even if match is in progress |
|
static |
Sends a referee plugin channel message to a specific referee, properly delimited.
ref | referee to recieve the plugin channel message |
|
static |
Removes any non-alphanumeric characters from a map name.
Prepares a map name to be used as a file name or a target in a chat command.
name | original map name |
|
static |
Converts a human-readable time to a clock tick in Minecraft.
Converts times such as "8am", "1600", or "3:45p" to a valid clock tick setting that can be used to change the world time.
time | A string representing a human-readable time. |
void org.mctourney.autoreferee.AutoRefMatch.setCurrentState | ( | MatchStatus | status) |
Sets the current status of this match.
status | new match status |
void org.mctourney.autoreferee.AutoRefMatch.setCustomMatchInfoBook | ( | ItemStack | book) |
Sets a custom book given to players upon joining this match.
book | book given to players, or null for default (generated) book. |
void org.mctourney.autoreferee.AutoRefMatch.setLastNotificationLocation | ( | Location | loc) |
Sets a notification location for referees and streamers.
This location should be the exact location of the event. The teleportation suite will find a suitable vantage point to observe the event.
loc | notification location |
void org.mctourney.autoreferee.AutoRefMatch.setMatchName | ( | String | name) |
Sets the custom name for this match.
name | custom match name |
void org.mctourney.autoreferee.AutoRefMatch.setSpectatorMode | ( | Player | player, |
boolean | spec | ||
) |
Sets whether a specified player is in spectator mode, explicitly setting gamemode.
player | player to set spectator mode for |
spec | true to set spectator mode on, false to set spectator mode off |
void org.mctourney.autoreferee.AutoRefMatch.setStartClock | ( | long | time) |
Sets the time that will be set at the start of the match.
time | world time in ticks to set at start of the match |
void org.mctourney.autoreferee.AutoRefMatch.setTimeLimit | ( | long | limit) |
Sets match time limit in seconds.
limit | new time limit in seconds |
void org.mctourney.autoreferee.AutoRefMatch.setupSpectators | ( | Player | player) |
Reconfigures spectator mode for a single player.
Useful for updating all players when one player logs in.
player | player to configure spectator mode for |
|
static |
Assigns a world a match object.
Best suited for retro-fitting worlds that have already been loaded.
world | loaded AutoReferee-compatible world |
tmp | whether this world should be unloaded when the match completes |
void org.mctourney.autoreferee.AutoRefMatch.startCountdown | ( | int | delay, |
boolean | start | ||
) |
Starts a countdown.
delay | number of seconds before end of countdown |
start | true if countdown should start match, otherwise false |
StartMechanism org.mctourney.autoreferee.AutoRefMatch.toggleStartMech | ( | Block | block, |
boolean | state | ||
) |
Adds a new start mechanism for this map.
These mechanisms are activated automatically at the start of a match when using SportBukkit, and players may interact with them normally in the start region when using vanilla CraftBukkit.
block | block containing the start mechanism |
state | whether this mechanism should be set powered or unpowered |
void org.mctourney.autoreferee.AutoRefMatch.updateReferee | ( | Player | ref) |
Sends all information to a single referee necessary to sync a match's current status.
ref | referee to receive the plugin channel messages |