aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
committerShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
commit3693bbdc6b65e68db10375d3eeab70f06708b729 (patch)
tree4a71a5e6e5f50b3e2937053a5d4b4196ef67665b /patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch
parentf2512b12385961f8ca1f69efebe5ed0e00c0caa8 (diff)
downloadPaper-timings/use-internals.tar.gz
Paper-timings/use-internals.zip
Use internals for getting block/entity countstimings/use-internals
For a long time I've been meaning to move some of this logic internally as this would allow us to avoid hitting systems like block state snapshots which can create issues as many of the spigot implementations of this stuff are increasingly broken, leading to unexpected crashes during ticking, even if the API cannot properly interact with these such states/items, it's generally more preferable to not crash the server in the course, and just let those interactions fail more gracefully.
Diffstat (limited to 'patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch')
-rw-r--r--patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/api/0434-Add-API-to-get-the-collision-shape-of-a-block-before.patch
new file mode 100644
index 0000000000..0481690ad4
--- /dev/null
+++ b/patches/api/0434-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 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.
+ *