aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-10-27 09:43:00 +0100
committerNassim Jahnke <[email protected]>2024-10-27 10:03:59 +0100
commit348c8550967380d9843e365e769f67eee8a8e474 (patch)
tree185991293a5343239e1107ebc98df37de3d020a5 /patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch
parentbcf52fe5fd7b178e3c72f53762c8e32ca7910dc4 (diff)
downloadPaper-348c8550967380d9843e365e769f67eee8a8e474.tar.gz
Paper-348c8550967380d9843e365e769f67eee8a8e474.zip
Readd last API patch (with TODO)
Diffstat (limited to 'patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch')
-rw-r--r--patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch
new file mode 100644
index 0000000000..3bb30787dc
--- /dev/null
+++ b/patches/api/0421-Add-API-to-get-the-collision-shape-of-a-block-before.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: TrollyLoki <[email protected]>
+Date: Wed, 11 Oct 2023 00:45:54 -0400
+Subject: [PATCH] Add API to get the collision shape of a block before it's
+ placed
+
+
+diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java
+index 54664651f34311e95f6c2dcfd93e58477beda8c2..0ecc54bd810a2805b7209d9433b76743500e45a8 100644
+--- a/src/main/java/org/bukkit/block/data/BlockData.java
++++ b/src/main/java/org/bukkit/block/data/BlockData.java
+@@ -205,6 +205,19 @@ public interface BlockData extends Cloneable {
+ */
+ boolean isFaceSturdy(@NotNull BlockFace face, @NotNull BlockSupport support);
+
++ // Paper start
++ /**
++ * Calculates the collision shape this block data would have at a particular location.
++ * <p>
++ * This does not take into account any block updates that may occur if the block was to be actually placed in the world.
++ *
++ * @param location the location to calculate the collision shape at
++ *
++ * @return a {@link org.bukkit.util.VoxelShape} representing the collision shape of this block data.
++ */
++ @NotNull org.bukkit.util.VoxelShape getCollisionShape(@NotNull Location location);
++ // Paper end
++
+ /**
+ * Gets the color this block should appear as when rendered on a map.
+ *