diff options
author | Nassim Jahnke <[email protected]> | 2024-06-16 12:56:00 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-06-16 12:56:00 +0200 |
commit | dc684c60d16f66ea84467ec8e253f2a36a17a7c8 (patch) | |
tree | e516f1bd4bfbdb37a5aeee42384aade111eca3e1 /patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch | |
parent | 752f957e12e4ceb8b7d2043a4a7dbce786b7b98f (diff) | |
download | Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.tar.gz Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.zip |
Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
Diffstat (limited to 'patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch')
-rw-r--r-- | patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch new file mode 100644 index 0000000000..f0fcc8b9eb --- /dev/null +++ b/patches/server/0905-Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: TrollyLoki <[email protected]> +Date: Wed, 11 Oct 2023 00:45:53 -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/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index 64ddd6d1c40dc91b6e7fc3118403415bb4533d97..0daa0bf7e56aa7228d89867500cb780b37f06541 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -679,6 +679,20 @@ public class CraftBlockData implements BlockData { + return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); + } + ++ // Paper start ++ @Override ++ public org.bukkit.util.VoxelShape getCollisionShape(Location location) { ++ Preconditions.checkArgument(location != null, "location must not be null"); ++ ++ CraftWorld world = (CraftWorld) location.getWorld(); ++ Preconditions.checkArgument(world != null, "location must not have a null world"); ++ ++ BlockPos position = CraftLocation.toBlockPosition(location); ++ net.minecraft.world.phys.shapes.VoxelShape shape = this.state.getCollisionShape(world.getHandle(), position); ++ return new org.bukkit.craftbukkit.util.CraftVoxelShape(shape); ++ } ++ // Paper end ++ + @Override + public Color getMapColor() { + return Color.fromRGB(this.state.getMapColor(null, null).col); |