Add CalculateDamage() to API.

This commit is contained in:
sigonasr2 2016-08-21 17:07:39 -05:00
parent ec10a46889
commit aefb3fedca
2 changed files with 14 additions and 0 deletions

Binary file not shown.

View File

@ -181,6 +181,20 @@ public final class TwosideKeeperAPI {
return CustomDamage.ApplyDamage(damage, damager, target, weapon, reason, flags);
}
/**
* Returns how much damage would be dealt with this particular calculation of damage dealt. Uses same exact arguments as applyDamage.
* @param damage
* @param damager
* @param target
* @param weapon
* @param reason
* @param flags
* @return
*/
public static double CalculateDamage(double damage, Entity damager, LivingEntity target, ItemStack weapon, String reason, int flags) {
return CustomDamage.CalculateDamage(damage, damager, target, weapon, reason, flags);
}
/**
* Returns the string of the last damage reason the player took. All attacks in the game except
* for basic attacks from monsters and projectiles (which makes this return null) have a reason.