Skip to content

Commit bb21ed1

Browse files
committed
Merge remote-tracking branch 'origin/api-12' into api-13
2 parents f590e8e + fcf2d0f commit bb21ed1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mixins/java/org/spongepowered/common/mixin/core/world/entity/player/PlayerMixin_Attack_Impl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
import org.spongepowered.asm.mixin.Mixin;
4545
import org.spongepowered.asm.mixin.Shadow;
4646
import org.spongepowered.asm.mixin.injection.At;
47+
import org.spongepowered.asm.mixin.injection.Constant;
4748
import org.spongepowered.asm.mixin.injection.Inject;
49+
import org.spongepowered.asm.mixin.injection.ModifyConstant;
4850
import org.spongepowered.asm.mixin.injection.ModifyVariable;
4951
import org.spongepowered.asm.mixin.injection.Redirect;
5052
import org.spongepowered.asm.mixin.injection.Slice;
@@ -218,6 +220,14 @@ public abstract class PlayerMixin_Attack_Impl extends LivingEntityMixin_Attack_I
218220
return this.attackImpl$attackEvent.knockbackModifier();
219221
}
220222

223+
@ModifyConstant(method = "attack", constant = @Constant(floatValue = 1.0F), slice = @Slice(
224+
from = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;getKnockback(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;)F"),
225+
to = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;knockback(DDD)V"))
226+
)
227+
private float attackImpl$noDoubleAddKb(final float constant) {
228+
return 0.0F;
229+
}
230+
221231
/**
222232
* Prevents the {@link SoundEvents#PLAYER_ATTACK_NODAMAGE} when event was canceled
223233
*/

0 commit comments

Comments
 (0)