Add damage check to the Enchantment Handler...
...to avoid performing calculations where it is not necessary
This commit is contained in:
parent
443576ba1a
commit
e8a1c9bcba
@ -378,6 +378,10 @@ public class DamageManager extends MiniPlugin
|
||||
Player damagee = event.GetDamageePlayer();
|
||||
if (damagee != null)
|
||||
{
|
||||
if (event.GetDamage() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()) > 0)
|
||||
{
|
||||
event.AddMult("Ench Prot", damagee.getName(), getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()), false);
|
||||
|
Loading…
Reference in New Issue
Block a user