From 0000000000000000000000000000000000000000 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b5b21852b4c3dc15e548afd81bdefbb83b9e7e9c..77faa873b22f59d27d5a99f4fef0d86a977875d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -242,6 +242,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();