mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
move namefix to monitor
This commit is contained in:
parent
8fc3643803
commit
e8021e81e6
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.1.125</version>
|
||||
<version>2.1.126-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
|
@ -410,6 +410,7 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This was put here to solve a plugin conflict with a mod called Project Korra
|
||||
* Project Korra sends out a damage event with exactly 0 damage
|
||||
@ -425,20 +426,21 @@ public class EntityListener implements Listener {
|
||||
|
||||
CombatUtils.processCombatAttack(event, attacker, target);
|
||||
CombatUtils.handleHealthbars(attacker, target, event.getFinalDamage(), plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets entity names back to whatever they are supposed to be
|
||||
*/
|
||||
if(event.getFinalDamage() >= target.getHealth())
|
||||
{
|
||||
if(attacker instanceof LivingEntity)
|
||||
{
|
||||
CombatUtils.fixNames((LivingEntity) attacker);
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
||||
public void onEntityDamageMonitor(EntityDamageByEntityEvent entityDamageEvent) {
|
||||
if(entityDamageEvent.getEntity() instanceof LivingEntity) {
|
||||
LivingEntity livingEntity = (LivingEntity) entityDamageEvent.getEntity();
|
||||
|
||||
if(entityDamageEvent.getFinalDamage() >= livingEntity.getHealth()) {
|
||||
|
||||
/*
|
||||
* This sets entity names back to whatever they are supposed to be
|
||||
*/
|
||||
CombatUtils.fixNames(livingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
CombatUtils.fixNames(target);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean checkParties(Cancellable event, Player defendingPlayer, Player attackingPlayer) {
|
||||
|
Loading…
Reference in New Issue
Block a user