Pass correct draw strength for EntityShootBowEvent (#12308)

This commit is contained in:
TonytheMacaroni
2025-05-02 16:05:50 -04:00
committed by GitHub
parent d637ae85dd
commit 1074237311
5 changed files with 31 additions and 3 deletions

View File

@@ -30,6 +30,15 @@
} else {
Projectile projectile = super.createProjectile(level, shooter, weapon, ammo, isCrit);
if (projectile instanceof AbstractArrow abstractArrow) {
@@ -163,7 +_,7 @@
if (level instanceof ServerLevel serverLevel) {
ChargedProjectiles chargedProjectiles = weapon.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.EMPTY);
if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) {
- this.shoot(serverLevel, shooter, hand, weapon, chargedProjectiles.getItems(), velocity, inaccuracy, shooter instanceof Player, target);
+ this.shoot(serverLevel, shooter, hand, weapon, chargedProjectiles.getItems(), velocity, inaccuracy, shooter instanceof Player, target, 1); // Paper - Pass draw strength
if (shooter instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.SHOT_CROSSBOW.trigger(serverPlayer, weapon);
serverPlayer.awardStat(Stats.ITEM_USED.get(weapon.getItem()));
@@ -211,7 +_,14 @@
);
}