9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/divinemc-api/paper-patches/features/0008-Paper-PR-Player-standing-on-position-API.patch
NONPLAYT 1d79525ed6 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@fc89fde5 Updated Upstream (Paper)
2025-11-03 01:57:37 +03:00

45 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 23 Mar 2025 16:52:42 +0300
Subject: [PATCH] Paper PR: Player standing on position API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 38fbb90b6ebab18ee50c455951e44deb962d141f..b5f9a4ffe8cfb5e9e63b8cec94e7e96bea201576 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1323,6 +1323,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
void broadcastHurtAnimation(@NotNull java.util.Collection<Player> players);
// Paper end - broadcast hurt animation
+ // Paper start - Player standing on position API
+ /**
+ * Gets the block that is currently being used to calculate movement effects (i.e. friction) on the entity.
+ * <p>
+ * Examples:
+ * - When standing on a slab under an ice block, this will return the position of the ice block.
+ * - When flying on top of a flower placed on a grass block, this will return the position of the grass block (although this technically will not affect your movement).
+ *
+ * @return block used for movement effects
+ */
+ @NotNull
+ org.bukkit.block.Block getMovementAffectingBlock();
+
+ /**
+ * Gets the block that is currently supporting the entity.
+ * This takes into account the collisions of blocks under the entity.
+ * <p>
+ * Examples:
+ * - When standing on a slab under an ice block, this will return the position of the slab.
+ * - When flying on top of a flower placed on a grass block, this will return null, as no block is supporting the entity.
+ *
+ * @return block currently supporting the entity, or null if no block is currently supporting the entity
+ */
+ @Nullable
+ org.bukkit.block.Block getSupportingBlock();
+ // Paper end - Player standing on position API
+
// Purpur start - Ridables
/**
* Get the riding player