public class Duel extends AbstractFight implements Recordable, BestOfFight
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.util.UUID,java.util.List<EloChange>> |
eloFights |
int |
loserEloChange |
int |
winnerEloChange |
arena, bed1Broken, bed2Broken, blockChanges, blockLimitReached, currentFight, durationLimit, kit, maxBlockChanges, started, statistics
Constructor and Description |
---|
Duel(StrikePractice plugin,
java.lang.String p1,
java.lang.String p2)
Create a new Duel with the given values.
|
Duel(StrikePractice plugin,
java.lang.String p1,
java.lang.String p2,
BattleKit kit)
Create a new Duel with the given values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowSpectating()
Gets if specatting is allowed in the fight.
|
boolean |
canStart()
Checks if the duel can start.
|
void |
forceEnd(java.lang.String reason) |
BestOf |
getBestOf() |
java.util.List<java.lang.String> |
getOpponents(Player p)
Dead players should be included in the list if online.
|
java.lang.String |
getP1()
Gets the first player of this duel.
|
java.lang.String |
getP2()
Gets the second player of this duel.
|
FightRecorder |
getRecorder() |
java.util.List<java.lang.String> |
getTeammates(Player p)
The given player should be included in the list.
|
void |
handleDeath(Player p)
Handles the death of a player in this duel.
|
void |
handleStart()
Handles the start.
|
boolean |
hasEnded()
Gets if this fight has ended.
|
boolean |
isBreakTime()
Whether the fight is waiting for the arena to reset before next round
|
boolean |
isDoNotTeleport()
Gets if the duel won't teleport the winner after the fight.
|
boolean |
isPremiumQueue() |
boolean |
isQueue()
Gets if this duel is a queue fight.
|
boolean |
playersAreOpponents(Player one,
Player two) |
boolean |
playersAreTeammates(Player one,
Player two) |
LegacySavedFight |
saveFight(java.util.List<java.util.UUID> winners,
java.util.List<java.util.UUID> losers,
java.util.List<FightInventory> winnersInventories,
java.util.List<FightInventory> losersInventories,
java.util.UUID playbackUUID) |
void |
setArena(Arena arena)
Sets the arena of this duel.
|
void |
setBestOf(BestOf bestOf) |
void |
setDoNotTeleport(boolean doNotTeleport)
Whether to teleport the player back to spawn after this duel has been ended.
|
void |
setKit(BattleKit kit)
Sets the kit of this duel.
|
void |
setPremiumQueue(boolean premiumQueue) |
void |
setQueue(boolean queue)
Sets if this duel is a queue fight.
|
void |
start()
Starts the Duel.
|
java.lang.String |
toString()
Deprecated.
because only for debugging, will remove later
|
addBlockChange, clearBlockChanges, getArena, getBlockChanges, getBlockChangesMap, getCurrentFight, getDuration, getDurationLimit, getEnded, getFights, getKit, getMaxBlockChanges, getStarted, getStatistics, getStatistics, getStatistics, handleDisappear, isBed1Broken, isBed2Broken, isInFight, sendSpectatorMessages, sendSpectatorMessages, setBed1Broken, setBed2Broken, setCurrentFight, setMaxBlockChanges, setStartedAfterCountdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addBlockChange, clearBlockChanges, forceEndDelayed, getArena, getBlockChanges, getBlockChangesMap, getDuration, getDurationLimit, getEnded, getFightStatistics, getFightStatistics, getKit, getPlayerNames, getPlayersInFight, getSpectators, getStarted, getStatistics, getStatistics, getStatistics, hasStarted, setStartedAfterCountdown
public static final java.util.Map<java.util.UUID,java.util.List<EloChange>> eloFights
public int winnerEloChange
public int loserEloChange
public Duel(StrikePractice plugin, java.lang.String p1, java.lang.String p2, BattleKit kit)
plugin
- StrikePractice plugin.p1
- the first player.p2
- the second player.kit
- the BattleKit that is used in this Duel.public Duel(StrikePractice plugin, java.lang.String p1, java.lang.String p2)
public void handleStart()
public void start()
start
in interface Fight
start
in class AbstractFight
public boolean allowSpectating()
Fight
allowSpectating
in interface Fight
public void setArena(Arena arena)
setArena
in interface Fight
setArena
in class AbstractFight
arena
- the new arena.public void setKit(BattleKit kit)
setKit
in interface Fight
setKit
in class AbstractFight
kit
- BattleKit will be the kit in this duel.public boolean hasEnded()
public boolean canStart()
public void handleDeath(Player p)
handleDeath
in interface Fight
p
- player who died.public LegacySavedFight saveFight(java.util.List<java.util.UUID> winners, java.util.List<java.util.UUID> losers, java.util.List<FightInventory> winnersInventories, java.util.List<FightInventory> losersInventories, java.util.UUID playbackUUID)
public java.util.List<java.lang.String> getTeammates(Player p)
Fight
getTeammates
in interface Fight
public java.util.List<java.lang.String> getOpponents(Player p)
Fight
getOpponents
in interface Fight
public boolean playersAreTeammates(Player one, Player two)
playersAreTeammates
in interface Fight
public boolean playersAreOpponents(Player one, Player two)
playersAreOpponents
in interface Fight
public FightRecorder getRecorder()
getRecorder
in interface Recordable
public java.lang.String getP1()
public boolean isPremiumQueue()
public void setPremiumQueue(boolean premiumQueue)
public java.lang.String getP2()
public BestOf getBestOf()
getBestOf
in interface BestOfFight
public void setBestOf(BestOf bestOf)
setBestOf
in interface BestOfFight
public boolean isQueue()
public void setQueue(boolean queue)
queue
- true for a queue fight, false for not a queue duel.public boolean isDoNotTeleport()
public void setDoNotTeleport(boolean doNotTeleport)
doNotTeleport
- if true the winner won't be teleported back to spawn, if false the winner will be
teleported.public boolean isBreakTime()
BestOfFight
isBreakTime
in interface BestOfFight
@Deprecated public java.lang.String toString()
toString
in class java.lang.Object