2022-12-15 20:43:14 +01:00
|
|
|
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
|
2023-10-03 13:55:12 +02:00
|
|
|
index 8733255559e63d8709d2502e58f16decdf1714ae..35ce9507933487935da8ae8eff4e94925b1abf76 100644
|
2022-12-15 20:43:14 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2023-10-03 13:55:12 +02:00
|
|
|
@@ -1218,6 +1218,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2022-12-15 20:43:14 +01:00
|
|
|
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());
|