13
0
geforkt von Mirrors/Paper

Fix structure check API (#11307)

* Fix structure check API

* Use CraftStructure#bukkitToMinecraft

* Fixed spelling mistake on CraftStructure class name
Dieser Commit ist enthalten in:
roro1506HD 2024-08-21 03:27:33 +02:00
Ursprung 01e05f9751
Commit 80501c393a

Datei anzeigen

@ -15,14 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - structure check API + // Paper start - structure check API
+ @Override + @Override
+ public boolean hasStructureAt(final io.papermc.paper.math.Position position, final Structure structure) { + public boolean hasStructureAt(final io.papermc.paper.math.Position position, final Structure structure) {
+ net.minecraft.world.level.levelgen.structure.Structure vanillaStructure = this.world.registryAccess()
+ .registryOrThrow(net.minecraft.core.registries.Registries.STRUCTURE)
+ .getHolder(CraftNamespacedKey.toMinecraft(structure.getStructureType().getKey()))
+ .orElseThrow()
+ .value();
+ return this.world.structureManager().getStructureWithPieceAt( + return this.world.structureManager().getStructureWithPieceAt(
+ io.papermc.paper.util.MCUtil.toBlockPos(position), + io.papermc.paper.util.MCUtil.toBlockPos(position),
+ vanillaStructure + CraftStructure.bukkitToMinecraft(structure)
+ ).isValid(); + ).isValid();
+ } + }
+ // Paper end + // Paper end