Constructor and Description |
---|
ThreatTable() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableMap<AbstractEntity,Double> |
asMap() |
void |
clearTarget()
Clears the threat of the top threat-holder and stops targeting them
|
ActiveMob.ThreatTable |
clone() |
void |
decayTargetThreat()
Decays the current target's threat
|
void |
dropCombat()
Forces the mob to drop combat
|
Set<AbstractEntity> |
getAllThreatTargets() |
double |
getThreat(AbstractEntity entity) |
double |
getTopTargetThreat() |
AbstractEntity |
getTopThreatHolder() |
double |
getTotalThreat() |
boolean |
inCombat() |
void |
observeChangeWorld(AbstractEntity entity)
Called when an entity changes worlds
|
void |
observeDeath(AbstractEntity entity)
Called when an entity dies
|
void |
setParent(ActiveMob am) |
int |
size() |
void |
targetDeath()
Called when the mob's current target dies
|
boolean |
targetEvent(AbstractEntity entity)
Evaluates a new target and targets them if there isn't currently a better target
|
void |
targetHighestThreat()
Recalculates the current highest threat holder and targets them, or drops combat if the table is empty
|
boolean |
targetThreateningEntity(AbstractEntity entity)
Forces the mob to target a particular entity on their threat table
|
boolean |
Taunt(AbstractEntity target)
Taunts the mob, forcing it to target the taunter and setting their threat to 110%
|
void |
threatGain(AbstractEntity entity,
double amount)
Adds an amount of threat to the target entity
|
void |
threatLoss(AbstractEntity entity,
double amount)
Removes an amount of threat to the target entity
|
void |
threatSet(AbstractEntity entity,
double amount)
Sets an entity's threat value
|
void |
tickThreat() |
public void setParent(ActiveMob am)
public void tickThreat()
public boolean inCombat()
public boolean targetEvent(AbstractEntity entity)
entity
- The entity to try and targetpublic boolean Taunt(AbstractEntity target)
target
- The entity that is taunting this mobpublic void dropCombat()
public void observeDeath(AbstractEntity entity)
entity
- The entity that diedpublic void observeChangeWorld(AbstractEntity entity)
entity
- The entity that changed worldspublic boolean targetThreateningEntity(AbstractEntity entity)
entity
- The entity to targetpublic void targetHighestThreat()
public void clearTarget()
public void targetDeath()
public void threatSet(AbstractEntity entity, double amount)
entity
- The entity to setamount
- The amount of threat to setpublic void threatGain(AbstractEntity entity, double amount)
entity
- The entity that gained threatamount
- The amount of threat to gainpublic void threatLoss(AbstractEntity entity, double amount)
entity
- The entity that lost threatamount
- The amount of threat to losepublic void decayTargetThreat()
public AbstractEntity getTopThreatHolder()
public double getTopTargetThreat()
public double getThreat(AbstractEntity entity)
entity
- public double getTotalThreat()
public Set<AbstractEntity> getAllThreatTargets()
public int size()
public com.google.common.collect.ImmutableMap<AbstractEntity,Double> asMap()
public ActiveMob.ThreatTable clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2020. All rights reserved.