From 745260143e2e432f35c8cd5e36a4cd195238a98c Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 27 Mar 2023 10:20:00 -0700 Subject: [PATCH] Add Structure check API --- .../src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b7d30e9578..6689656098 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -243,6 +243,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { }; } // Paper end + // Paper start - structure check API + @Override + public boolean hasStructureAt(final io.papermc.paper.math.Position position, final Structure structure) { + return this.world.structureManager().getStructureWithPieceAt( + io.papermc.paper.util.MCUtil.toBlockPos(position), + CraftStructure.bukkitToMinecraft(structure) + ).isValid(); + } + // Paper end private static final Random rand = new Random();