From e4e24f3335609b38f460ced71d18babcf11bf9cb Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 5 Dec 2024 11:18:29 +0100 Subject: Move around patches again --- patches/server/0740-Add-entity-knockback-API.patch | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/server/0740-Add-entity-knockback-API.patch (limited to 'patches/server/0740-Add-entity-knockback-API.patch') diff --git a/patches/server/0740-Add-entity-knockback-API.patch b/patches/server/0740-Add-entity-knockback-API.patch new file mode 100644 index 0000000000..a9b58b4c8d --- /dev/null +++ b/patches/server/0740-Add-entity-knockback-API.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MelnCat +Date: Sun, 16 Oct 2022 12:10:17 -0700 +Subject: [PATCH] Add entity knockback API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 9399df20ba14ad92379d5d2048e249883eaa8050..5efa27ab1e03eed4b2b05c4ea667b536ebc110bd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -1146,4 +1146,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + throw new UnsupportedOperationException("Cannot set the hurt direction on a non player"); + } + // Paper end - hurt direction API ++ ++ // Paper start - knockback API ++ @Override ++ public void knockback(final double strength, final double directionX, final double directionZ) { ++ Preconditions.checkArgument(strength > 0, "Knockback strength must be > 0"); ++ this.getHandle().knockback(strength, directionX, directionZ); ++ }; ++ // Paper end - knockback API + } -- cgit v1.2.3