mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 18:45:54 +01:00
ce0e78c103
compile fixes compile fixes
24 lines
1.2 KiB
Diff
24 lines
1.2 KiB
Diff
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
|
|
index 8bcac6699fdafaca0c077efe85ef8319bba63621..ecd97223cdabe92dee0d43f8e02f2b084d6f981d 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -237,6 +237,12 @@ 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) {
|
|
+ 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();
|
|
|