Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Reverse sort and output UUID directly to avoid overflow the client ch…
Browse files Browse the repository at this point in the history
…at GUI
  • Loading branch information
Ghost-chu committed Jan 9, 2024
1 parent 03fabbb commit 43f9c83
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private ListCommand() {}

private static int printBackpackList(List<AccessLogRecord> allLogs, CommandSourceStack source) {
SimpleDateFormat dateFormat = new SimpleDateFormat();
allLogs.sort(Comparator.comparing(AccessLogRecord::getAccessTime).reversed());
allLogs.sort(Comparator.comparing(AccessLogRecord::getAccessTime));
source.sendSuccess(new TranslatableComponent("commands.sophisticatedbackpacks.list.header"), false);
allLogs.forEach(alr -> {
MutableComponent message = new TextComponent("");
Expand All @@ -55,6 +55,8 @@ private static int printBackpackList(List<AccessLogRecord> allLogs, CommandSourc
message.append(new TextComponent(alr.getPlayerName()));
message.append(new TextComponent(", "));
message.append(new TextComponent(dateFormat.format(new Date(alr.getAccessTime()))));
message.append(new TextComponent(", "));
message.append(alr.getBackpackUuid().toString());
source.sendSuccess(message, false);
});
return 0;
Expand Down

0 comments on commit 43f9c83

Please sign in to comment.