adding damage outsid ethe loop

This commit is contained in:
xXVevzZXx 2016-07-15 04:57:44 +02:00
parent 3070835662
commit 728a91da0f

View File

@ -1026,24 +1026,25 @@ public class GunModule implements Listener
if (EnableNormalArmor)
{
double armomrDamage = 0;
for (ItemStack item : event.GetDamageePlayer().getInventory().getArmorContents())
{
if (item == null)
continue;
double armomrDamage = 0;
if (item.getType().toString().contains("DIAMOND")) armomrDamage -= 1;
if (item.getType().toString().contains("GOLD")) armomrDamage -= 0.5;
if (item.getType().toString().contains("IRON")) armomrDamage -= 0.75;
if (item.getType().toString().contains("LEATHER")) armomrDamage -= 0.25;
if (item.getType().toString().contains("CHAIN")) armomrDamage -= 0.5;
if (event.GetDamage() - armomrDamage <= 0)
armomrDamage = -(event.GetDamage() - 1);
event.AddMod(event.GetDamageePlayer().getName(), "Armor", armomrDamage, false);
}
if (event.GetDamage() - armomrDamage <= 0)
armomrDamage = -(event.GetDamage() - 1);
event.AddMod(event.GetDamageePlayer().getName(), "Armor", armomrDamage, false);
}
event.SetKnockback(false);