Tweak caching for private home list viewing, fix #222

This commit is contained in:
William committed 2022-09-19 11:14:01 +01:00
1 parent 39931dba04
commit c56936d9d5
3 files changed
+11 -11

No files matched your search

@@ -53,8 +53,8 @@ public class HomeListCommand extends CommandBase implements ConsoleExecutable {
* @param pageNumber page number to display
*/
private void showHomeList(@NotNull OnlineUser onlineUser, @NotNull String homeOwner, int pageNumber) {
if (plugin.getCache().privateHomeLists.containsKey(onlineUser.uuid)) {
onlineUser.sendMessage(plugin.getCache().privateHomeLists.get(onlineUser.uuid).getNearestValidPage(pageNumber));
if (plugin.getCache().privateHomeLists.containsKey(homeOwner)) {
onlineUser.sendMessage(plugin.getCache().privateHomeLists.get(homeOwner).getNearestValidPage(pageNumber));
return;
}
plugin.getDatabase().getUserDataByName(homeOwner).thenAccept(optionalUser -> optionalUser.ifPresentOrElse(userData -> {