Skip to content

Commit

Permalink
Fix entity damage in NeoForge.
Browse files Browse the repository at this point in the history
A part of #1468 .

Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Sep 18, 2024
1 parent f03c588 commit 8041d80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class LivingEntityMixin_NeoForge extends EntityMixin_NeoForge im

@Inject(method = "hurt", cancellable = true, at = @At("HEAD"))
private void arclight$livingHurt(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
if (!CommonHooks.onEntityIncomingDamage((LivingEntity) (Object) this, new DamageContainer(source, amount))) {
if (CommonHooks.onEntityIncomingDamage((LivingEntity) (Object) this, new DamageContainer(source, amount))) {
cir.setReturnValue(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract class PlayerMixin_NeoForge extends LivingEntityMixin_NeoForge im

@Inject(method = "hurt", cancellable = true, at = @At("HEAD"))
private void arclight$onPlayerAttack(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
if (!CommonHooks.onEntityIncomingDamage((Player) (Object) this, new DamageContainer(source, amount))) {
if (CommonHooks.onEntityIncomingDamage((Player) (Object) this, new DamageContainer(source, amount))) {
cir.setReturnValue(false);
}
}
Expand Down

0 comments on commit 8041d80

Please sign in to comment.