Skip to content

Commit 22ea268

Browse files
authored
Merge pull request #339 from BentoBoxWorld/zero_fix
Fixed island level zeroing for non-void worlds
2 parents 3a96bb5 + ecc049c commit 22ea268

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<!-- Do not change unless you want different name for local builds. -->
6868
<build.number>-LOCAL</build.number>
6969
<!-- This allows to change between versions. -->
70-
<build.version>2.17.0</build.version>
70+
<build.version>2.17.1</build.version>
7171
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
7272
<sonar.organization>bentobox-world</sonar.organization>
7373
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ private void loadChunks(CompletableFuture<List<Chunk>> r2, World world, Queue<Pa
309309
return;
310310
}
311311
Pair<Integer, Integer> p = pairList.poll();
312-
Util.getChunkAtAsync(world, p.x, p.z, world.getEnvironment().equals(Environment.NETHER)).thenAccept(chunk -> {
312+
// We need to generate now all the time because some game modes are not voids
313+
Util.getChunkAtAsync(world, p.x, p.z, true).thenAccept(chunk -> {
313314
if (chunk != null) {
314315
chunkList.add(chunk);
315316
roseStackerCheck(chunk);
@@ -613,6 +614,7 @@ public void scanIsland(Pipeliner pipeliner) {
613614
} else {
614615
// Done
615616
pipeliner.getInProcessQueue().remove(this);
617+
BentoBox.getInstance().log("Completed Level scan.");
616618
// Chunk finished
617619
// This was the last chunk. Handle stacked blocks, then chests and exit
618620
handleStackedBlocks().thenCompose(v -> handleChests()).thenRun(() -> {

src/main/java/world/bentobox/level/calculators/Pipeliner.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ public Pipeliner(Level addon) {
4646
if (!inProcessQueue.isEmpty() || toProcessQueue.isEmpty()) return;
4747
for (int j = 0; j < addon.getSettings().getConcurrentIslandCalcs() && !toProcessQueue.isEmpty(); j++) {
4848
IslandLevelCalculator iD = toProcessQueue.poll();
49-
// Ignore deleted or unonwed islands
49+
// Ignore deleted or unowned islands
5050
if (!iD.getIsland().isDeleted() && !iD.getIsland().isUnowned()) {
5151
inProcessQueue.put(iD, System.currentTimeMillis());
52+
BentoBox.getInstance().log("Starting to scan island level at " + iD.getIsland().getCenter());
5253
// Start the scanning of a island with the first chunk
5354
scanIsland(iD);
5455
}
@@ -95,6 +96,7 @@ public CompletableFuture<Results> addIsland(Island island) {
9596
.map(IslandLevelCalculator::getIsland).anyMatch(island::equals)) {
9697
return CompletableFuture.completedFuture(new Results(Result.IN_PROGRESS));
9798
}
99+
BentoBox.getInstance().log("Added island to Level queue: " + island.getCenter());
98100
return addToQueue(island, false);
99101
}
100102

@@ -104,6 +106,7 @@ public CompletableFuture<Results> addIsland(Island island) {
104106
* @return CompletableFuture of the results
105107
*/
106108
public CompletableFuture<Results> zeroIsland(Island island) {
109+
BentoBox.getInstance().log("Zeroing island level for island at " + island.getCenter());
107110
return addToQueue(island, true);
108111
}
109112

0 commit comments

Comments
 (0)