From 159f98e5a7cd64ca63c6fab9b332a3116a661908 Mon Sep 17 00:00:00 2001 From: TrollyLoki 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 --- .../main/java/org/bukkit/block/data/BlockData.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/block/data/BlockData.java b/paper-api/src/main/java/org/bukkit/block/data/BlockData.java index 54664651f3..0ecc54bd81 100644 --- a/paper-api/src/main/java/org/bukkit/block/data/BlockData.java +++ b/paper-api/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. + *

+ * 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. *