mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-09 06:50:32 +08:00
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
|
From 21dfa9a7108ea72db2e34c0ad40cff723f7f792c Mon Sep 17 00:00:00 2001
|
||
|
From: nossr50 <nossr50@gmail.com>
|
||
|
Date: Thu, 26 Mar 2020 19:44:50 -0700
|
||
|
Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||
|
index 8a3f2b5e40..2e186134ea 100644
|
||
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||
|
@@ -1057,7 +1057,11 @@ public abstract class EntityHuman extends EntityLiving {
|
||
|
|
||
|
f *= 0.2F + f2 * f2 * 0.8F;
|
||
|
f1 *= f2;
|
||
|
- this.ey();
|
||
|
+ // Paper start - PlayerAttackEntityCooldownResetEvent
|
||
|
+ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent((Player) this.getBukkitEntity(), entity.getBukkitEntity(), this.getCooledAttackStrength(0F)).callEvent()) {
|
||
|
+ this.resetCooldown(); // reset it like normal
|
||
|
+ }
|
||
|
+ // Paper end
|
||
|
if (f > 0.0F || f1 > 0.0F) {
|
||
|
boolean flag = f2 > 0.9F;
|
||
|
boolean flag1 = false;
|
||
|
--
|
||
|
2.25.1
|
||
|
|