aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTamion <[email protected]>2024-04-20 21:29:32 +0200
committerGitHub <[email protected]>2024-04-20 15:29:32 -0400
commitfc53ff5a71d4b8475bc239ef36e091725f67d5b6 (patch)
tree483a828e0f28f7cf23b652fc6b48d7bc5ec8c72c
parentc5f68ff9be27c99d86999d08428315dd69576ca0 (diff)
downloadPaper-fc53ff5a71d4b8475bc239ef36e091725f67d5b6.tar.gz
Paper-fc53ff5a71d4b8475bc239ef36e091725f67d5b6.zip
Add Configuration for finding Structures outside World Border (#10437)
-rw-r--r--patches/server/0005-Paper-config-files.patch5
-rw-r--r--patches/server/0113-Bound-Treasure-Maps-to-World-Border.patch4
2 files changed, 5 insertions, 4 deletions
diff --git a/patches/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch
index 12a6e0b87c..ca3d0593c0 100644
--- a/patches/server/0005-Paper-config-files.patch
+++ b/patches/server/0005-Paper-config-files.patch
@@ -1394,10 +1394,10 @@ index 0000000000000000000000000000000000000000..351fbbc577556ebbd62222615801a96b
+}
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
new file mode 100644
-index 0000000000000000000000000000000000000000..dc7950f9a52a718317e5f41de9d396cd7b846bf3
+index 0000000000000000000000000000000000000000..d3fdf62912d190f8b468b77230a927023c361074
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
-@@ -0,0 +1,553 @@
+@@ -0,0 +1,554 @@
+package io.papermc.paper.configuration;
+
+import com.google.common.collect.HashBasedTable;
@@ -1816,6 +1816,7 @@ index 0000000000000000000000000000000000000000..dc7950f9a52a718317e5f41de9d396cd
+ public IntOr.Disabled netherCeilingVoidDamageHeight = IntOr.Disabled.DISABLED;
+ public int maxFluidTicks = 65536;
+ public int maxBlockTicks = 65536;
++ public boolean locateStructuresOutsideWorldBorder = false;
+ }
+
+ public Spawn spawn;
diff --git a/patches/server/0113-Bound-Treasure-Maps-to-World-Border.patch b/patches/server/0113-Bound-Treasure-Maps-to-World-Border.patch
index 99e596d2e8..b48b9a0a34 100644
--- a/patches/server/0113-Bound-Treasure-Maps-to-World-Border.patch
+++ b/patches/server/0113-Bound-Treasure-Maps-to-World-Border.patch
@@ -34,14 +34,14 @@ index 52325a99ea38530ad69a39ac0215233139f35268..bf5ac907507bf3b5bfcef45b566c0bc1
return (double) pos.getMaxBlockX() > this.getMinX() && (double) pos.getMinBlockX() < this.getMaxX() && (double) pos.getMaxBlockZ() > this.getMinZ() && (double) pos.getMinBlockZ() < this.getMaxZ();
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
-index b2f9429e0d437cf70bf56410e163e957b80ebdf1..3e57142dd9cb23d43857d5a4cb30962e4b696b74 100644
+index b2f9429e0d437cf70bf56410e163e957b80ebdf1..4a731b9170222a5a2b0089ef5e9527dbd46a9ad5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -217,6 +217,7 @@ public abstract class ChunkGenerator {
while (iterator.hasNext()) {
ChunkPos chunkcoordintpair = (ChunkPos) iterator.next();
-+ if (!world.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper - Bound treasure maps to world border
++ if (!world.paperConfig().environment.locateStructuresOutsideWorldBorder && !world.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper - Bound treasure maps to world border
blockposition_mutableblockposition.set(SectionPos.sectionToBlockCoord(chunkcoordintpair.x, 8), 32, SectionPos.sectionToBlockCoord(chunkcoordintpair.z, 8));
double d1 = blockposition_mutableblockposition.distSqr(center);