9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/divinemc-server/paper-patches/features/0012-Paper-PR-Player-standing-on-position-API.patch
2025-04-21 18:23:30 +03:00

32 lines
1.4 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:53:16 +0300
Subject: [PATCH] Paper PR: Player standing on position API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index a138a364c73bc0b325391c9f30943769e54e4cda..e84408d1a64dbaba1500ee4d31df964d258f058f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1314,6 +1314,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.entity.get(io.papermc.paper.datacomponent.PaperDataComponentType.bukkitToMinecraft(type)) != null;
}
+ // Paper start - Player standing on position API
+ @Override
+ public org.bukkit.block.Block getMovementAffectingBlock() {
+ return CraftBlock.at(this.getHandle().level(), this.getHandle().getBlockPosBelowThatAffectsMyMovement());
+ }
+
+ @Override
+ public org.bukkit.block.Block getSupportingBlock() {
+ return this.getHandle().mainSupportingBlockPos
+ .map((pos) -> CraftBlock.at(this.getHandle().level(), pos))
+ .orElse(null);
+ }
+ // Paper end - Player standing on position API
+
// Purpur start - Ridables
@Override
public org.bukkit.entity.Player getRider() {