|
27 | 27 | if (damaged) { |
28 | 28 | this.removeEntitiesOnShoulder(); |
29 | 29 | } |
30 | | -@@ -1174,37 +_,39 @@ |
| 30 | +@@ -1174,15 +_,15 @@ |
31 | 31 | // Paper start - PlayerAttackEntityEvent |
32 | 32 | boolean willAttack = target.isAttackable() && !target.skipAttackInteraction(this); // Vanilla logic |
33 | 33 | io.papermc.paper.event.player.PrePlayerAttackEntityEvent playerAttackEntityEvent = new io.papermc.paper.event.player.PrePlayerAttackEntityEvent( |
|
47 | 47 | + float f = this.isAutoSpinAttack() ? this.autoSpinAttackDmg : (float) this.getAttributeValue(attackDamageType.advantage); // Papyrus - Add damage type |
48 | 48 | ItemStack weaponItem = this.getWeaponItem(); |
49 | 49 | DamageSource damageSource = Optional.ofNullable(weaponItem.getItem().getDamageSource(this)).orElse(this.damageSources().playerAttack(this)); |
50 | | -- float f1 = this.getEnchantedDamage(target, f, damageSource) - f; |
51 | | -+ float f1 = this.getEnchantedDamage(target, f, damageSource) - f; // Papyrus - Remove attack cooldown |
52 | | - float attackStrengthScale = this.getAttackStrengthScale(0.5F); |
| 50 | + float f1 = this.getEnchantedDamage(target, f, damageSource) - f; |
| 51 | +@@ -1190,16 +_,18 @@ |
53 | 52 | f *= 0.2F + attackStrengthScale * attackStrengthScale * 0.8F; |
54 | 53 | f1 *= attackStrengthScale; |
55 | 54 | // this.resetAttackStrengthTicker(); // CraftBukkit - Moved to EntityLiving to reset the cooldown after the damage is dealt |
|
77 | 76 | } |
78 | 77 | { |
79 | 78 | // CraftBukkit end |
80 | | - if (f > 0.0F || f1 > 0.0F) { |
81 | | -- boolean flag = attackStrengthScale > 0.9F; |
82 | | -+ boolean flag = true; //attackStrengthScale > 0.9F; - Papyrus - Remove attack cooldown |
83 | | - boolean flag1; |
84 | | - if (this.isSprinting() && flag) { |
85 | | - this.sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility |
86 | 79 | @@ -1215,14 +_,14 @@ |
87 | 80 |
|
88 | 81 | f += weaponItem.getItem().getAttackDamageBonus(target, f, damageSource); |
|
106 | 99 | flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits |
107 | 100 | if (flag2) { |
108 | 101 | damageSource = damageSource.critical(); // Paper - critical damage API |
109 | | -@@ -1245,147 +_,165 @@ |
| 102 | +@@ -1245,146 +_,165 @@ |
110 | 103 | } |
111 | 104 |
|
112 | 105 | Vec3 deltaMovement = target.getDeltaMovement(); |
|
164 | 157 | - && !this.isAlliedTo(livingEntity2) |
165 | 158 | - && !(livingEntity2 instanceof ArmorStand armorStand && armorStand.isMarker()) |
166 | 159 | - && this.distanceToSqr(livingEntity2) < 9.0) { |
167 | | -- float f6 = this.getEnchantedDamage(livingEntity2, f5, damageSource) * attackStrengthScale; |
168 | 160 | + && livingEntity2 != target |
169 | 161 | + && !this.isAlliedTo(livingEntity2) |
170 | 162 | + && (!(livingEntity2 instanceof ArmorStand) || !((ArmorStand) livingEntity2).isMarker()) |
171 | 163 | + && this.distanceToSqr(livingEntity2) < 9.0) { |
172 | | -+ float f6 = this.getEnchantedDamage(livingEntity2, f5, damageSource);// * attackStrengthScale; Papyrus - Remove attack cooldown |
| 164 | + float f6 = this.getEnchantedDamage(livingEntity2, f5, damageSource) * attackStrengthScale; |
173 | 165 | // Paper start - Only apply knockback if the event is not cancelled |
174 | 166 | livingEntity2.lastDamageCancelled = false; |
175 | 167 | - if (this.level() instanceof ServerLevel serverLevel && livingEntity2.hurtServer(serverLevel, damageSource.knownCause(org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_SWEEP_ATTACK), f6) && !livingEntity2.lastDamageCancelled) { |
|
322 | 314 | - this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value |
323 | 315 | - } else { |
324 | 316 | - sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility |
325 | | -- this.containerMenu.sendAllDataToRemote(); // CraftBukkit - resync on cancelled event |
326 | 317 | + this.sendSoundEffect( |
327 | 318 | + this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F // Paper - send while respecting visibility |
328 | 319 | + ); |
|
0 commit comments