diff options
Diffstat (limited to 'patches/server/0203-Add-entity-knockback-events.patch')
-rw-r--r-- | patches/server/0203-Add-entity-knockback-events.patch | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/patches/server/0203-Add-entity-knockback-events.patch b/patches/server/0203-Add-entity-knockback-events.patch index 2a626e60e9..c87dbadcd6 100644 --- a/patches/server/0203-Add-entity-knockback-events.patch +++ b/patches/server/0203-Add-entity-knockback-events.patch @@ -38,10 +38,10 @@ index d6017d9d71fb4b3a3df6eaa44da0ebda54c83da4..629942afb41f73ca7a7855cba58c81fd } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb6b62bf52 100644 +index cccc60602360f25f0aeddbd16dad2bb63a1728a8..bf1b8ee85551ff1989369268edf8012758b86fd7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1517,7 +1517,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1528,7 +1528,7 @@ public abstract class LivingEntity extends Entity implements Attackable { d1 = source.getSourcePosition().z() - this.getZ(); } @@ -50,7 +50,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb if (!flag) { this.indicateDamage(d0, d1); } -@@ -1570,7 +1570,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1581,7 +1581,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void blockedByShield(LivingEntity target) { @@ -59,7 +59,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb } private boolean checkTotemDeathProtection(DamageSource source) { -@@ -1831,10 +1831,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1842,10 +1842,10 @@ public abstract class LivingEntity extends Entity implements Attackable { public void knockback(double strength, double x, double z) { // CraftBukkit start - EntityKnockbackEvent @@ -72,7 +72,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb d0 *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); if (true || d0 > 0.0D) { // CraftBukkit - Call event even when force is 0 //this.hasImpulse = true; // CraftBukkit - Move down -@@ -1847,13 +1847,17 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1858,13 +1858,17 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = (new Vec3(d1, 0.0D, d2)).normalize().scale(d0); @@ -200,10 +200,10 @@ index a6c33abcbbfc0851c8fa979163de145a578f97a6..18389b3befe31b224010e55244fbcb7c } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index f21d121418872f5ece763f33c15091e787991d7c..3512f0b309c7822f7b9d9eacbcf4dd84d9c24896 100644 +index d6bbeaf3833a4c44ed05243445edd813e3f15dcb..1b13096da1f0bc49efe25677ec24e6abe7ff2879 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1300,9 +1300,9 @@ public abstract class Player extends LivingEntity { +@@ -1301,9 +1301,9 @@ public abstract class Player extends LivingEntity { if (target instanceof LivingEntity) { LivingEntity entityliving1 = (LivingEntity) target; @@ -215,15 +215,15 @@ index f21d121418872f5ece763f33c15091e787991d7c..3512f0b309c7822f7b9d9eacbcf4dd84 } this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); -@@ -1327,7 +1327,7 @@ public abstract class Player extends LivingEntity { - - // CraftBukkit start - Only apply knockback if the damage hits - if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep(), f7)) { -- entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit -+ entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events +@@ -1331,7 +1331,7 @@ public abstract class Player extends LivingEntity { + continue; } // CraftBukkit end +- entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F))); ++ entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events + // entityliving2.hurt(damagesource, f7); // CraftBukkit - moved up Level world = this.level(); + diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java index 230040bef7d2cf9a463cfd9cb3b1b1aa208a7119..6c79997ba46e641de5aa12ff8a3d790d04a5a475 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -273,10 +273,10 @@ index d93ed33d5ae72e9dd3e6cf044ef79e4b9689dc1c..512d79b66fed3d1bef645c3ecb59bda0 // CraftBukkit end entity.setDeltaMovement(entity.getDeltaMovement().add(vec3d1)); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 587437f995dd411c051f2125202f1a48cfc1bb1b..86bddb9c39d8487f050d126dbb479315cb8a2818 100644 +index 9c463d551fc402dbcbc81aad5251a9183596830a..cf045e3ebe75046212755f18058bf4381bacacc1 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1869,19 +1869,33 @@ public class CraftEventFactory { +@@ -1888,19 +1888,33 @@ public class CraftEventFactory { return event; } |