mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
526795bacd
* Update patches to handle vineflower decompiler * update patches again to handle inlined simple lambdas * update vf again and re-apply/rebuild patches * update patches after removal of verify-merges flag * fix compile issue * remove maven local * fix some issues * address more issues * fix collision patch * use paperweight release * more fixes * update fineflower and fix patches again * add missing comment descriptor --------- Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
30 lines
1.4 KiB
Diff
30 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MelnCat <melncatuwu@gmail.com>
|
|
Date: Sun, 16 Oct 2022 12:10:00 -0700
|
|
Subject: [PATCH] Add entity knockback API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
index 35b0eb94e291dae7a4705fa85b10d23fcd38f49e..41c5559058df9701e345f39d9d3c23e45b6d49c3 100644
|
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
@@ -1349,4 +1349,18 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
|
}
|
|
}
|
|
// Paper end - swing hand API
|
|
+
|
|
+ // Paper start - knockback API
|
|
+ /**
|
|
+ * Knocks back this entity from a specific direction with a specified strength. Mechanics such
|
|
+ * as knockback resistance will be factored in.
|
|
+ *
|
|
+ * The direction specified in this method will be the direction of the source of the knockback,
|
|
+ * so the entity will be pushed in the opposite direction.
|
|
+ * @param strength The strength of the knockback. Must be greater than 0.
|
|
+ * @param directionX The relative x position of the knockback source direction
|
|
+ * @param directionZ The relative z position of the knockback source direction
|
|
+ */
|
|
+ void knockback(double strength, double directionX, double directionZ);
|
|
+ // Paper end - knockback API
|
|
}
|