MatchInstance

public abstract class MatchInstance extends Match

EliteMobs' instance API, running on MagmaCore's match core. The core owns admission, movement, rescue, death and teardown; this class keeps every member add-ons and EliteMobs' own subclasses use, mirroring the core's state into the familiar fields and firing EliteMobs' events at the moments they always fired.

Inheritors

Constructors

Link copied to clipboard
public void MatchInstance(Location startLocation, Location exitLocation, int minPlayers, int maxPlayers)

Types

Link copied to clipboard
Link copied to clipboard
public class MatchInstanceEvents implements Listener
Kept so existing registrations compile.

Properties

Link copied to clipboard
protected boolean cancelled
Link copied to clipboard
protected final HashMap<Block, InstanceDeathLocation> deathBanners
Link copied to clipboard
protected boolean destroyingMatch
Link copied to clipboard
protected Location exitLocation
Link copied to clipboard
protected final static HashSet<MatchInstance> instances
Link copied to clipboard
protected Location lobbyLocation
Link copied to clipboard
protected int maxPlayers
Link copied to clipboard
protected int minPlayers
Link copied to clipboard
protected HashSet<Player> participants
Link copied to clipboard
protected String permission
Link copied to clipboard
protected HashMap<Player, Integer> playerLives
Link copied to clipboard
protected HashSet<Player> players
Link copied to clipboard
protected final Map<Player, Location> previousPlayerLocations
Link copied to clipboard
protected HashSet<Player> spectators
Link copied to clipboard
protected final HashSet<UUID> startingParticipantIds
Link copied to clipboard
protected Location startLocation
Link copied to clipboard
Link copied to clipboard
protected World world

Inherited properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public final UUID runtimeId
Link copied to clipboard
public final MatchSettings settings
Link copied to clipboard
public final Set<UUID> startingRoster

Functions

Link copied to clipboard
protected boolean acceptsPlayers()
Link copied to clipboard
protected boolean acceptsSpectator(Player player)
Link copied to clipboard
public boolean addNewPlayer(Player player)
Link copied to clipboard
public void addSpectator(Player player, boolean wasPlayer)
Spectating after death is the core's job; this admits outsiders who want to watch.
Link copied to clipboard
protected void announce(String message)
Link copied to clipboard
public final boolean authorizesCombatTarget(Player player, Location targetLocation)
True only when both the active participant and a prospective combat target remain inside this ongoing instance.
Link copied to clipboard
protected void cancelScheduledTasks()
Subclasses cancel their own tasks here; the match core owns the watchdog and countdown.
Link copied to clipboard
public void countdownMatch()
Link copied to clipboard
protected MatchPlayer createPlayer(Player player)
Link copied to clipboard
protected void defeat()
Link copied to clipboard
protected void destroyMatch()
Removes everyone and returns the instance to WAITING.
Link copied to clipboard
protected void endMatch()
Link copied to clipboard
protected Location entryDestination(MatchPlayer participant)
Link copied to clipboard
protected Location exitDestination(MatchPlayer participant)
Link copied to clipboard
public static MatchInstance getAnyPlayerInstance(Player player)
Link copied to clipboard
public HashMap<Block, InstanceDeathLocation> getDeathBanners()
Link copied to clipboard
Link copied to clipboard
public HashSet<Player> getParticipants()
Link copied to clipboard
public String getPermission()
Link copied to clipboard
public static MatchInstance getPlayerInstance(Player player)
Link copied to clipboard
public HashSet<Player> getPlayers()
Link copied to clipboard
public Map<Player, Location> getPreviousPlayerLocations()
Link copied to clipboard
public Integer getRemainingLives(Player player)
Returns this participant's remaining dungeon/arena lives, or null when no counter is active.
Link copied to clipboard
public static MatchInstance getSpectatorInstance(Player player)
Link copied to clipboard
public HashSet<UUID> getStartingParticipantIds()
Link copied to clipboard
Link copied to clipboard
protected boolean guardsEntryDuring(MatchPhase phase)
Whether non-participants are kept from teleporting into this instance during the phase.
Link copied to clipboard
protected boolean hasJoinPermission(Player player)
Link copied to clipboard
protected boolean hasMatchDestroyEventFired()
Link copied to clipboard
protected Location intruderDestination(Player player)
Link copied to clipboard
public boolean isAcceptingNewPlayers()
The single admission predicate.
Link copied to clipboard
protected boolean isAcceptingSpectator(Player player, boolean wasPlayer)
Link copied to clipboard
public boolean isCancelled()
Link copied to clipboard
public boolean isDefunct()
True when this match object is a corpse: cancelled at construction, or already evicted from instances.
Link copied to clipboard
public boolean isDestroyingMatch()
Link copied to clipboard
protected abstract boolean isInRegion(Location location)
Link copied to clipboard
public boolean isSpectator(Player player)
True for a player currently waiting in this match's spectator/downed state.
Link copied to clipboard
public final boolean isWaitingPlayer(Player player)
Admitted players whose entry task has reached the lobby, including the start countdown.
Link copied to clipboard
protected void onAdmissionRolledBack(MatchPlayer participant)
Link copied to clipboard
protected void onDeath(MatchPlayer participant)
Link copied to clipboard
protected void onReset()
Link copied to clipboard
protected void onRevive(MatchPlayer participant)
Link copied to clipboard
protected void onSpectating(MatchPlayer participant)
Link copied to clipboard
protected void onStart()
Link copied to clipboard
protected Location participantExitLocation(Player player)
Participant exits are independent of the boundary used to eject intruders.
Link copied to clipboard
public void playerDeath(Player player)
Link copied to clipboard
protected Location previousLocationOrExit(Player player)
Link copied to clipboard
public void removeAnyKind(Player player)
Link copied to clipboard
public void removePlayer(Player player)
Link copied to clipboard
public void removeSpectator(Player player)
Link copied to clipboard
protected void requestEnd(MatchOutcome outcome)
Automatic endings go through the overridable methods EliteMobs subclasses intercept.
Link copied to clipboard
protected String requiredPermission()
Link copied to clipboard
protected final void retireInstance()
Takes the instance out of EliteMobs' registry and destroys its match for good.
Link copied to clipboard
public void revivePlayer(Player player, InstanceDeathLocation deathLocation)
Link copied to clipboard
public static void shutdown()
Link copied to clipboard
protected Location startDestination()
Link copied to clipboard
protected void startMatch()
Link copied to clipboard
protected void victory()

Inherited functions

Link copied to clipboard
protected void abortAdmission()
Link copied to clipboard
public final AdmissionResult admit(Collection<? extends Player> players)
Link copied to clipboard
public final AdmissionResult admitSpectator(Player player)
Link copied to clipboard
public final boolean contains(Location location)
Link copied to clipboard
public final void destroy()
Link copied to clipboard
public final void destroyForShutdown()
Link copied to clipboard
public final void end(MatchOutcome outcome)
Link copied to clipboard
public final List<MatchPlayer> getActivePlayers()
Link copied to clipboard
public final MatchPlayer getMatchPlayer(Player player)
Link copied to clipboard
public final List<MatchPlayer> getMatchPlayers()
Link copied to clipboard
public final MatchOutcome getOutcome()
Link copied to clipboard
public final MatchPhase getPhase()
Link copied to clipboard
public UUID getRuntimeId()
Link copied to clipboard
public final MatchSettings getSettings()
Link copied to clipboard
public final Set<UUID> getStartingRoster()
Link copied to clipboard
protected final void handleDeath(Player player)
Link copied to clipboard
public final boolean isDestroyed()
Link copied to clipboard
public final boolean isOpen()
Link copied to clipboard
public final boolean leave(Player player, LeaveReason reason)
Link copied to clipboard
public final boolean moveParticipant(Player player, Location destination)
Link copied to clipboard
protected void onDestroy()
Link copied to clipboard
protected void onEnd(MatchOutcome outcome)
Link copied to clipboard
protected void onJoin(MatchPlayer player)
Link copied to clipboard
protected void onLeave(MatchPlayer player, LeaveReason reason)
Link copied to clipboard
public final boolean open()
Link copied to clipboard
protected final boolean releaseReviveBanner(Player dead, boolean revive)
Link copied to clipboard
protected boolean reserveAdmission()
Link copied to clipboard
public final void retire()
Link copied to clipboard
protected final void scheduleDestroy(long ticks)
Link copied to clipboard
protected Location spectatorDestination(MatchPlayer player)
Link copied to clipboard
public final StartResult start()