Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/api-12' into api-13
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Dec 14, 2024
2 parents f590e8e + fcf2d0f commit bb21ed1
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
Expand Down Expand Up @@ -218,6 +220,14 @@ public abstract class PlayerMixin_Attack_Impl extends LivingEntityMixin_Attack_I
return this.attackImpl$attackEvent.knockbackModifier();
}

@ModifyConstant(method = "attack", constant = @Constant(floatValue = 1.0F), slice = @Slice(
from = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;getKnockback(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;)F"),
to = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;knockback(DDD)V"))
)
private float attackImpl$noDoubleAddKb(final float constant) {
return 0.0F;
}

/**
* Prevents the {@link SoundEvents#PLAYER_ATTACK_NODAMAGE} when event was canceled
*/
Expand Down

0 comments on commit bb21ed1

Please sign in to comment.