From 80501c393a6ccd396dbf88b19677d4da2cc43eeb Mon Sep 17 00:00:00 2001 From: roro1506HD Date: Wed, 21 Aug 2024 03:27:33 +0200 Subject: [PATCH] Fix structure check API (#11307) * Fix structure check API * Use CraftStructure#bukkitToMinecraft * Fixed spelling mistake on CraftStructure class name --- patches/server/Add-Structure-check-API.patch | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/patches/server/Add-Structure-check-API.patch b/patches/server/Add-Structure-check-API.patch index 02236a7c59..227b5964ab 100644 --- a/patches/server/Add-Structure-check-API.patch +++ b/patches/server/Add-Structure-check-API.patch @@ -15,14 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - structure check API + @Override + 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( + io.papermc.paper.util.MCUtil.toBlockPos(position), -+ vanillaStructure ++ CraftStructure.bukkitToMinecraft(structure) + ).isValid(); + } + // Paper end