2023-12-03 03:11:57 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Mon, 27 Mar 2023 10:20:00 -0700
|
|
|
|
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
|
2024-01-18 22:00:40 +01:00
|
|
|
index 468c68eba244a1307ac283c9bf89196e28a40bf1..2a685ac009a13d86d5baf3b649830a08189efb19 100644
|
2023-12-03 03:11:57 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2023-12-25 23:51:56 +01:00
|
|
|
@@ -230,6 +230,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
2023-12-03 03:11:57 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
// 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), net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.STRUCTURE, CraftNamespacedKey.toMinecraft(structure.getKey()))).isValid();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
private static final Random rand = new Random();
|
|
|
|
|