aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0435-Add-API-to-get-the-collision-shape-of-a-block-before.patch
blob: 0481690ad45b45a81f74d8ae0212beb292a6ccf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: TrollyLoki <trollyloki@gmail.com>
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 64188a78211195fe792eac427e483e1984f52318..fb4c7cf0f67f3e4227d17f6702ae7b7bf1c110ab 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.
      *