Klasse ThreatTable
java.lang.Object
de.delinkedde.mobarenareborn.threat.ThreatTable
Tracks accumulated threat each player has generated against each mob.
This is pure bookkeeping with no game dependency: it maps a mob id to a per-player threat
total and answers which player currently holds the most threat on a mob. The
ThreatService turns those answers into mob targeting.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAdds threat for a player on a mob.voidclear()Removes all threat records.mobs()voidRemoves all threat recorded for a mob.voidremovePlayer(@NotNull UUID player) Removes a player from every mob's threat record.voidSets a player's threat on a mob to an absolute value (used by taunt).Returns the player holding the most threat on a mob.int
-
Konstruktordetails
-
ThreatTable
public ThreatTable()
-
-
Methodendetails
-
add
Adds threat for a player on a mob.- Parameter:
mob- the mob idplayer- the player idamount- the threat to add
-
set
Sets a player's threat on a mob to an absolute value (used by taunt).- Parameter:
mob- the mob idplayer- the player idamount- the threat value to set
-
top
Returns the player holding the most threat on a mob.- Parameter:
mob- the mob id- Gibt zurück:
- the top-threat player id, or empty if the mob has no threat recorded
-
removeMob
Removes all threat recorded for a mob.- Parameter:
mob- the mob id
-
removePlayer
Removes a player from every mob's threat record.- Parameter:
player- the player id
-
trackedMobs
public int trackedMobs()- Gibt zurück:
- the number of mobs currently tracked
-
mobs
- Gibt zurück:
- a copy of the currently tracked mob ids
-
clear
public void clear()Removes all threat records.
-