修改混伤逻辑
This commit is contained in:
parent
3f2742efbe
commit
ba4d1835dc
1 changed files with 3 additions and 0 deletions
|
@ -570,11 +570,14 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
float normalDamage = damage * Mth.clamp(1 - bypassArmorRate, 0, 1);
|
float normalDamage = damage * Mth.clamp(1 - bypassArmorRate, 0, 1);
|
||||||
float absoluteDamage = damage * Mth.clamp(bypassArmorRate, 0, 1);
|
float absoluteDamage = damage * Mth.clamp(bypassArmorRate, 0, 1);
|
||||||
|
|
||||||
|
entity.invulnerableTime = 0;
|
||||||
if (headshot) {
|
if (headshot) {
|
||||||
entity.hurt(ModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), normalDamage * this.headShot);
|
entity.hurt(ModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), normalDamage * this.headShot);
|
||||||
|
entity.invulnerableTime = 0;
|
||||||
entity.hurt(ModDamageTypes.causeGunFireHeadshotAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * this.headShot);
|
entity.hurt(ModDamageTypes.causeGunFireHeadshotAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * this.headShot);
|
||||||
} else {
|
} else {
|
||||||
entity.hurt(ModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), normalDamage);
|
entity.hurt(ModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), normalDamage);
|
||||||
|
entity.invulnerableTime = 0;
|
||||||
entity.hurt(ModDamageTypes.causeGunFireAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage);
|
entity.hurt(ModDamageTypes.causeGunFireAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue