Skip to content

Commit

Permalink
this makes shifting bedrock rarer
Browse files Browse the repository at this point in the history
Signed-off-by: U5B <[email protected]>
  • Loading branch information
U5B committed Mar 19, 2024
1 parent 1ad6fe8 commit e618dab
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/main/java/com/playmonumenta/structures/StructuresAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ public static CompletableFuture<Void> pasteStructure(@Nonnull BlockArrayClipboar
.checkMemory(false)
.allowedRegionsEverywhere()
.limitUnlimited()
.relightMode(RelightMode.ALL)
.build()) {

/*
Expand Down Expand Up @@ -464,25 +465,24 @@ public static CompletableFuture<Void> pasteStructure(@Nonnull BlockArrayClipboar
copy.setFilterFunction(filterFunction);
copy.setCopyingEntities(includeEntities);
Operations.completeBlindly(copy);

}
MSLog.finer(() -> "Loading structure took " + (System.currentTimeMillis() - pasteTime) + " milliseconds (async)"); // STOP -->

/* Allow the next structure load task to start at this point */
signal.complete(null);
// /* Relight affected blocks. Run on main thread as the fixLighting method may or may not be thread-safe. */
// Bukkit.getScheduler().runTask(plugin, () -> {
// final long lightTime = System.currentTimeMillis(); // <-- START

Check warning on line 473 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L473 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:473:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)

/* Relight affected blocks. Run on main thread as the fixLighting method may or may not be thread-safe. */
Bukkit.getScheduler().runTask(plugin, () -> {
final long lightTime = System.currentTimeMillis(); // <-- START
// /* Relight an area 16 blocks bigger than the respawned area */

Check warning on line 475 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L475 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:475:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)
// Region relightRegion = shiftedRegion.clone();

Check warning on line 476 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L476 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:476:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)
// relightRegion.expand(BlockVector3.at(-16, -16, -16), BlockVector3.at(16, 16, 16));

Check warning on line 477 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L477 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:477:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)

/* Relight an area 16 blocks bigger than the respawned area */
Region relightRegion = shiftedRegion.clone();
relightRegion.expand(BlockVector3.at(-16, -16, -16), BlockVector3.at(16, 16, 16));
// FaweAPI.fixLighting(new BukkitWorld(world), relightRegion, null, RelightMode.ALL);

Check warning on line 479 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L479 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:479:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)

FaweAPI.fixLighting(new BukkitWorld(world), relightRegion, null, RelightMode.ALL);
// MSLog.finer(() -> "fixLighting took " + (System.currentTimeMillis() - lightTime) + " milliseconds (main thread)"); // STOP -->

Check warning on line 481 in src/main/java/com/playmonumenta/structures/StructuresAPI.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/main/java/com/playmonumenta/structures/StructuresAPI.java#L481 <com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck>

Tabs should only be used at the beginning of lines
Raw output
/home/runner/work/monumenta-structure-management/monumenta-structure-management/src/main/java/com/playmonumenta/structures/StructuresAPI.java:481:0: warning: Tabs should only be used at the beginning of lines (com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck)
// });

MSLog.finer(() -> "fixLighting took " + (System.currentTimeMillis() - lightTime) + " milliseconds (main thread)"); // STOP -->
});
/* Add a 5 tick delay until the next task for shifting */
Bukkit.getScheduler().runTaskLater(plugin, () -> signal.complete(null), 5);

/* 6s later, signal caller that loading is complete */
Bukkit.getScheduler().runTaskLater(plugin, () -> future.complete(null), 120);
Expand Down

0 comments on commit e618dab

Please sign in to comment.