Add Structure check API

This commit is contained in:
Jake Potrebic 2023-03-27 10:20:00 -07:00
parent fff5d44a12
commit 745260143e

View file

@ -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();