adding damage outsid ethe loop
This commit is contained in:
parent
3070835662
commit
728a91da0f
@ -1026,25 +1026,26 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
event.SetKnockback(false);
|
||||
event.SetIgnoreRate(true);
|
||||
|
Loading…
Reference in New Issue
Block a user