mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 23:57:43 +01:00
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: dawon <dawon@dawon.eu>
|
|
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 f4a9b72f76742b128632183720866df9283ca753..c612c97ca33b445c019ffa8d5074038f4a624db7 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -1201,6 +1201,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());
|