mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 03:16:41 +00:00
Fix #1075
This commit is contained in:
@ -396,7 +396,7 @@ public class HistorySubCommands {
|
||||
PaginationBox pages = cached == null ? null : cached.get();
|
||||
if (page == null || pages == null) {
|
||||
RollbackOptimizedHistory edit = database.getEdit(other, index).get();
|
||||
SimpleChangeSetSummary summary = edit.summarize(null, false);
|
||||
SimpleChangeSetSummary summary = edit.summarize(RegionWrapper.GLOBAL(), false);
|
||||
if (summary != null) {
|
||||
List<Countable<BlockState>> distr = summary.getBlockDistributionWithData();
|
||||
SelectionCommands.BlockDistributionResult distrPages = new SelectionCommands.BlockDistributionResult((List) distr, true, pageCommand);
|
||||
@ -405,7 +405,11 @@ public class HistorySubCommands {
|
||||
}
|
||||
page = 1;
|
||||
}
|
||||
player.print(pages.create(page));
|
||||
if (pages == null) {
|
||||
player.print(Caption.of("fawe.worldedit.history.distr.summary_null"));
|
||||
} else {
|
||||
player.print(pages.create(page));
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -182,6 +182,9 @@ public abstract class PaginationBox extends MessageBox {
|
||||
@Override
|
||||
public Component getComponent(int number) {
|
||||
for (PaginationBox box : values) {
|
||||
if (box == null) {
|
||||
continue;
|
||||
}
|
||||
int size = box.getComponentsSize();
|
||||
if (size > number) {
|
||||
return box.getComponent(number);
|
||||
@ -195,6 +198,9 @@ public abstract class PaginationBox extends MessageBox {
|
||||
public int getComponentsSize() {
|
||||
int size = 0;
|
||||
for (PaginationBox box : values) {
|
||||
if (box == null) {
|
||||
continue;
|
||||
}
|
||||
size += box.getComponentsSize();
|
||||
}
|
||||
return size;
|
||||
|
Reference in New Issue
Block a user