Use <= instead of < for structure patch

Thankfully I randomly think about code and randomly wondered if I used <= or < here, and caught this!

This would of missed some chunks for the structure at the highest X/Z
This commit is contained in:
Aikar 2017-11-12 18:51:10 -05:00
parent 0f2c274998
commit 7ba9baadca
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
From bbe1d20e6fb529ca5dcf54c45f77894badaf5a1b Mon Sep 17 00:00:00 2001 From 7bdcb1b74acf4d7b9e27f11693273b0043b02903 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sat, 11 Nov 2017 17:57:39 -0500 Date: Sat, 11 Nov 2017 17:57:39 -0500
Subject: [PATCH] Improve Structures Checking Subject: [PATCH] Improve Structures Checking
@ -47,7 +47,7 @@ index db419cd99..d9329bd42 100644
return baseblockposition.getX() >= this.a && baseblockposition.getX() <= this.d && baseblockposition.getZ() >= this.c && baseblockposition.getZ() <= this.f && baseblockposition.getY() >= this.b && baseblockposition.getY() <= this.e; return baseblockposition.getX() >= this.a && baseblockposition.getX() <= this.d && baseblockposition.getZ() >= this.c && baseblockposition.getZ() <= this.f && baseblockposition.getY() >= this.b && baseblockposition.getY() <= this.e;
} }
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index e8263baa4..09e49221d 100644 index e8263baa4..f4dfba8f3 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java --- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap; @@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
@ -145,8 +145,8 @@ index e8263baa4..09e49221d 100644
+ } + }
+ final BaseBlockPosition low = bb.getLowPosition(); + final BaseBlockPosition low = bb.getLowPosition();
+ final BaseBlockPosition high = bb.getHighPosition(); + final BaseBlockPosition high = bb.getHighPosition();
+ for (int x = low.getX() >> 4, maxX = high.getX() >> 4; x < maxX; x++) { + for (int x = low.getX() >> 4, maxX = high.getX() >> 4; x <= maxX; x++) {
+ for (int z = low.getZ() >> 4, maxZ = high.getZ() >> 4; z < maxZ; z++) { + for (int z = low.getZ() >> 4, maxZ = high.getZ() >> 4; z <= maxZ; z++) {
+ allStructures.put(ChunkCoordIntPair.asLong(x, z), structurestart); + allStructures.put(ChunkCoordIntPair.asLong(x, z), structurestart);
+ } + }
+ } + }