Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
e339ec27b4
The method sadly is not usable in 1.21 without a player as all of an enchantments attribtue modifiers rely on a base value supplied by a player. The method could only offer a rough estimate based on some default values, however a better method for this should be added down the line rather than trying to force such logic into the existing one.
32 Zeilen
1.4 KiB
Diff
32 Zeilen
1.4 KiB
Diff
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 26b70af4a1f3db5b17957bfa644e758603f8863c..a1ee73254b1389396e7d53f08abe4b3780bd3d0e 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.
|
|
*
|