Skip to content

Commit

Permalink
fix: Squares per deeds column not resetting, close #440
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Apr 4, 2024
1 parent ab7fa5e commit 4362057
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,20 @@ public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
.toList()))
.flatMap((worldMap) -> worldMap.getValue().stream()
.peek(claim -> total.getAndIncrement())
.map(claim -> MapSquare.claim(claim.claim().getChunk(), worldMap.getKey(), claim, plugin))
.map(claim -> MapSquare.claim(
claim.claim().getChunk(),
worldMap.getKey(),
claim,
plugin
))
.map(MapSquare::toComponent)
.map(square -> column.getAndIncrement() > SQUARES_PER_DEEDS_COLUMN
? square.appendNewline() : square))
.map(square -> {
if (column.getAndIncrement() > SQUARES_PER_DEEDS_COLUMN) {
column.set(0);
return square.appendNewline();
}
return square;
}))
.reduce(Component.empty(), Component::append);

plugin.getLocales().getLocale("town_deeds_title", town.getName(),
Expand Down

0 comments on commit 4362057

Please sign in to comment.