aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0829-Add-Sneaking-API-for-Entities.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0829-Add-Sneaking-API-for-Entities.patch')
-rw-r--r--patches/server/0829-Add-Sneaking-API-for-Entities.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/server/0829-Add-Sneaking-API-for-Entities.patch b/patches/server/0829-Add-Sneaking-API-for-Entities.patch
new file mode 100644
index 0000000000..ec3c098b6e
--- /dev/null
+++ b/patches/server/0829-Add-Sneaking-API-for-Entities.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: dawon <[email protected]>
+Date: Wed, 19 Oct 2022 23:31:53 +0200
+Subject: [PATCH] Add Sneaking API for Entities
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+index 81ec5ffdd453714284a7860603a592495f917ec9..55a9c4eb0fe1b912e5ff6c9bb81b46674f71868a 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -871,6 +871,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ return Pose.values()[this.getHandle().getPose().ordinal()];
+ }
+
++ // Paper start
++ @Override
++ public void setSneaking(boolean sneak) {
++ this.getHandle().setShiftKeyDown(sneak);
++ }
++
++ @Override
++ public boolean isSneaking() {
++ return this.getHandle().isShiftKeyDown();
++ }
++ // Paper end
++
+ @Override
+ public SpawnCategory getSpawnCategory() {
+ return CraftSpawnCategory.toBukkit(this.getHandle().getType().getCategory());