Skip to content

Commit

Permalink
Corrected code
Browse files Browse the repository at this point in the history
Faboslav committed Jul 12, 2023
1 parent 35cc345 commit e83abed
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -282,9 +282,11 @@ public boolean damage(
DamageSource source,
float amount
) {
Entity attacker = source.getAttacker();

if (
source.getAttacker() == null
|| source.getAttacker() instanceof LightningEntity
attacker == null
|| attacker instanceof LightningEntity
|| source == DamageSource.SWEET_BERRY_BUSH
) {
return false;
Original file line number Diff line number Diff line change
@@ -696,9 +696,11 @@ public boolean damage(
DamageSource source,
float amount
) {
Entity attacker = source.getAttacker();

if (
source.getAttacker() == null
|| source.getAttacker() instanceof LightningEntity
attacker == null
|| attacker instanceof LightningEntity
|| source == DamageSource.SWEET_BERRY_BUSH
) {
return false;
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ public boolean damage(
return false;
}

if (this.hasActiveShields() && source.getAttacker() != null) {
if (this.hasActiveShields()) {
this.damageAmountCounter += amount;
float shieldBreakDamageThreshold = (float) this.getAttributeValue(EntityAttributes.GENERIC_MAX_HEALTH) * 0.25F;

0 comments on commit e83abed

Please sign in to comment.