mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add Structure check API
This commit is contained in:
parent
fff5d44a12
commit
745260143e
1 changed files with 9 additions and 0 deletions
|
@ -243,6 +243,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Paper end
|
// 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();
|
private static final Random rand = new Random();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue