Prevent Test Dummies from giving Artifact EXP and Tactics EXP.

This commit is contained in:
sigonasr2 2017-04-18 21:27:06 -05:00
parent bf62dccbdb
commit 25bb73a670
2 changed files with 7 additions and 3 deletions

Binary file not shown.

View File

@ -164,7 +164,9 @@ public class CustomDamage {
TwosideKeeper.logHealth(target,target.getHealth(),dmg,damager); TwosideKeeper.logHealth(target,target.getHealth(),dmg,damager);
} }
EntityDamagedEvent ev = new EntityDamagedEvent(target,damager,dmg,reason,flags); EntityDamagedEvent ev = new EntityDamagedEvent(target,damager,dmg,reason,flags);
Bukkit.getPluginManager().callEvent(ev); if (!Dummy.isDummy(target)) {
Bukkit.getPluginManager().callEvent(ev);
}
if (!ev.isCancelled()) { if (!ev.isCancelled()) {
//TwosideKeeper.log("Inside of here.", 0); //TwosideKeeper.log("Inside of here.", 0);
DealDamageToEntity(dmg, damager, target, weapon, reason, flags); DealDamageToEntity(dmg, damager, target, weapon, reason, flags);
@ -605,7 +607,7 @@ public class CustomDamage {
double ratio = 1.0-CalculateDamageReduction(1,target,p); double ratio = 1.0-CalculateDamageReduction(1,target,p);
if (p.getEquipment().getItemInMainHand().getType()!=Material.BOW) { if (p.getEquipment().getItemInMainHand().getType()!=Material.BOW) {
//Do this with a 1 tick delay, that way it can account for items that are dropped one tick earlier and still work. //Do this with a 1 tick delay, that way it can account for items that are dropped one tick earlier and still work.
if (!isFlagSet(flags,NOAOE)) { if (!isFlagSet(flags,NOAOE) && !Dummy.isDummy(target)) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
@Override @Override
public void run() { public void run() {
@ -619,7 +621,9 @@ public class CustomDamage {
} }
List<LivingEntity> hitlist = new ArrayList<LivingEntity>(); List<LivingEntity> hitlist = new ArrayList<LivingEntity>();
if (!isFlagSet(flags,NOAOE)) { if (!isFlagSet(flags,NOAOE)) {
increaseArtifactArmorXP(p,(int)(ratio*10)+1); if (!Dummy.isDummy(target)) {
increaseArtifactArmorXP(p,(int)(ratio*10)+1);
}
hitlist = getAOEList(weapon,target); hitlist = getAOEList(weapon,target);
} }