continue instead of break for treasure map bounding

per: 01cf3186bd (commitcomment-20268968)

The break may of been skipping attempts at valid chunks. I thought break was the right abort, but maybe it is not.
This commit is contained in:
Aikar 2016-12-21 21:28:01 -05:00
parent 23236ef8aa
commit d9a999639c

View File

@ -1,4 +1,4 @@
From 3973a234a54d46a8c925e2fc4fdafab7e205d5b5 Mon Sep 17 00:00:00 2001
From b297ec93d59cdac144a9611ec515bf72c2f3333c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 20 Dec 2016 15:15:11 -0500
Subject: [PATCH] Bound Treasure Maps to World Border
@ -11,7 +11,7 @@ that is outside happens to be closer, but unreachable, yet another reachable
one is in border that would of been missed.
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index 9c1605b..b566d5e 100644
index 9c1605b14..77236760f 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -233,6 +233,9 @@ public abstract class StructureGenerator extends WorldGenBase {
@ -19,13 +19,13 @@ index 9c1605b..b566d5e 100644
WorldGenBase.a(world.getSeed(), random, l2, i3);
random.nextInt();
+
+ if (!world.getWorldBorder().isChunkInBounds(l2, i3)) { break; } // Paper
+ if (!world.getWorldBorder().isChunkInBounds(l2, i3)) { continue; } // Paper
+
if (structuregenerator.a(l2, i3)) {
if (!flag1 || !world.b(l2, i3)) {
return new BlockPosition((l2 << 4) + 8, 64, (i3 << 4) + 8);
diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java
index 632eb1c..1bb172b 100644
index 632eb1c9d..1bb172bbf 100644
--- a/src/main/java/net/minecraft/server/WorldBorder.java
+++ b/src/main/java/net/minecraft/server/WorldBorder.java
@@ -33,6 +33,18 @@ public class WorldBorder {
@ -48,5 +48,5 @@ index 632eb1c..1bb172b 100644
return (double) chunkcoordintpair.e() > this.b() && (double) chunkcoordintpair.c() < this.d() && (double) chunkcoordintpair.f() > this.c() && (double) chunkcoordintpair.d() < this.e();
}
--
2.9.3
2.11.0