diff options
Diffstat (limited to 'patches/server/0913-Add-Structure-check-API.patch')
-rw-r--r-- | patches/server/0913-Add-Structure-check-API.patch | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/patches/server/0913-Add-Structure-check-API.patch b/patches/server/0913-Add-Structure-check-API.patch index 38a42bd17d..2ac3cbb18d 100644 --- a/patches/server/0913-Add-Structure-check-API.patch +++ b/patches/server/0913-Add-Structure-check-API.patch @@ -5,24 +5,19 @@ 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 612dc787880e58e8325a658a63f9fe7536d0860c..ebb119ab9f5a8ae580e54cb3c102cd86f948a8d2 100644 +index 612dc787880e58e8325a658a63f9fe7536d0860c..7d54a29047d210170edf61c6182a6a8d02aa5f72 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -236,6 +236,20 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -236,6 +236,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) { -+ 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 |