Skip to content

Commit

Permalink
Remove two LivingEntity stat patches that did nothing (#1175) [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt authored Jun 24, 2024
1 parent 869077c commit e6b59aa
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions patches/net/minecraft/world/entity/LivingEntity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@
this.lastHurtByPlayer = player;
} else {
this.lastHurtByPlayer = null;
@@ -1212,7 +_,7 @@
if (this instanceof ServerPlayer) {
CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer)this, p_21016_, f, p_21017_, flag);
if (f1 > 0.0F && f1 < 3.4028235E37F) {
- ((ServerPlayer)this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(f1 * 10.0F));
+ ((ServerPlayer)this).awardStat(Stats.CUSTOM.get(Stats.DAMAGE_BLOCKED_BY_SHIELD), Math.round(f1 * 10.0F));
}
}

@@ -1220,6 +_,7 @@
CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer)entity, this, p_21016_, f, p_21017_, flag);
}
Expand Down Expand Up @@ -396,20 +387,14 @@
for (EquipmentSlot equipmentslot : p_331314_) {
ItemStack itemstack = this.getItemBySlot(equipmentslot);
if (itemstack.getItem() instanceof ArmorItem && itemstack.canBeHurtBy(p_330843_)) {
@@ -1648,10 +_,11 @@
@@ -1648,6 +_,7 @@
p_21194_ = Math.max(f / 25.0F, 0.0F);
float f2 = f1 - p_21194_;
if (f2 > 0.0F && f2 < 3.4028235E37F) {
+ this.damageContainers.peek().setReduction(net.neoforged.neoforge.common.damagesource.DamageContainer.Reduction.MOB_EFFECTS, f2);
if (this instanceof ServerPlayer) {
- ((ServerPlayer)this).awardStat(Stats.DAMAGE_RESISTED, Math.round(f2 * 10.0F));
+ ((ServerPlayer)this).awardStat(Stats.CUSTOM.get(Stats.DAMAGE_RESISTED), Math.round(f2 * 10.0F));
((ServerPlayer)this).awardStat(Stats.DAMAGE_RESISTED, Math.round(f2 * 10.0F));
} else if (p_21193_.getEntity() instanceof ServerPlayer) {
- ((ServerPlayer)p_21193_.getEntity()).awardStat(Stats.DAMAGE_DEALT_RESISTED, Math.round(f2 * 10.0F));
+ ((ServerPlayer)p_21193_.getEntity()).awardStat(Stats.CUSTOM.get(Stats.DAMAGE_DEALT_RESISTED), Math.round(f2 * 10.0F));
}
}
}
@@ -1670,6 +_,7 @@

if (f3 > 0.0F) {
Expand Down

0 comments on commit e6b59aa

Please sign in to comment.