Fixexd bug with poison killing players. Possibly fixed bug with double

death messages relating to poison.
testdev
sigonasr2 8 years ago
parent f1cc45e9e5
commit cee9753b7f
  1. BIN
      TwosideKeeper.jar
  2. 18
      src/sig/plugin/TwosideKeeper/CustomDamage.java

Binary file not shown.

@ -1252,6 +1252,9 @@ public class CustomDamage {
GenericFunctions.updateNoDamageTickMap(target, damager);
return true;
}
if (LowEnoughToResistPoison(target,reason)) {
return true;
}
if (isFlagSet(flags,IGNOREDODGE) || !PassesIframeCheck(target,damager)) {
@ -1287,6 +1290,15 @@ public class CustomDamage {
return true;
}
private static boolean LowEnoughToResistPoison(LivingEntity target, String reason) {
TwosideKeeper.log("Target health: "+target.getHealth(), 5);
if (reason!=null && reason.equalsIgnoreCase("POISON") && target.getHealth()<=2) {
return true;
} else {
return false;
}
}
public static boolean CanResistExplosionsWithExperienceSet(Entity damager, LivingEntity target, String reason) {
return target instanceof Player && ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(target), (Player)target, ItemSet.ALUSTINE, 2) &&
((reason!=null && (reason.equalsIgnoreCase("explosion") || reason.equalsIgnoreCase("entity_explosion")))
@ -2466,12 +2478,6 @@ public class CustomDamage {
if (damage<0) {
damage=0;
}
if (reason.equalsIgnoreCase("POISON")) {
if (damage>=target.getHealth()) {
damage=0;
target.setHealth(Math.min(target.getHealth(),1));
}
}
return Math.min(damage, TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER-1);
}

Loading…
Cancel
Save