diff --git a/common/src/main/java/net/william278/huskhomes/command/ListCommand.java b/common/src/main/java/net/william278/huskhomes/command/ListCommand.java index e1a7b90e..d56ffdc5 100644 --- a/common/src/main/java/net/william278/huskhomes/command/ListCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/ListCommand.java @@ -1,7 +1,6 @@ package net.william278.huskhomes.command; import net.william278.huskhomes.HuskHomes; -import net.william278.huskhomes.position.SavedPosition; import net.william278.paginedown.PaginatedList; import org.jetbrains.annotations.NotNull; @@ -10,7 +9,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; -public abstract class ListCommand extends Command { +public abstract class ListCommand extends Command { protected final Map cachedLists; diff --git a/common/src/main/java/net/william278/huskhomes/command/PrivateHomeListCommand.java b/common/src/main/java/net/william278/huskhomes/command/PrivateHomeListCommand.java index 3e6e5b8f..ec846567 100644 --- a/common/src/main/java/net/william278/huskhomes/command/PrivateHomeListCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/PrivateHomeListCommand.java @@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.stream.Collectors; -public class PrivateHomeListCommand extends ListCommand { +public class PrivateHomeListCommand extends ListCommand { protected PrivateHomeListCommand(@NotNull HuskHomes plugin) { super("homelist", List.of("homes"), "[player] [page]", plugin); @@ -42,11 +42,11 @@ public class PrivateHomeListCommand extends ListCommand { } final User user = targetUser.get(); - if (executor instanceof OnlineUser onlineUser && !user.getUuid().equals(onlineUser.getUuid())) { - if (!executor.hasPermission(getPermission("other"))) { - plugin.getLocales().getLocale("error_no_permission").ifPresent(executor::sendMessage); - return; - } + if (executor instanceof OnlineUser onlineUser && !user.getUuid().equals(onlineUser.getUuid()) + && !executor.hasPermission(getPermission("other"))) { + plugin.getLocales().getLocale("error_no_permission") + .ifPresent(executor::sendMessage); + return; } if (cachedLists.containsKey(user.getUuid())) { diff --git a/common/src/main/java/net/william278/huskhomes/command/PublicHomeListCommand.java b/common/src/main/java/net/william278/huskhomes/command/PublicHomeListCommand.java index 7ac56735..b6031e1e 100644 --- a/common/src/main/java/net/william278/huskhomes/command/PublicHomeListCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/PublicHomeListCommand.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -public class PublicHomeListCommand extends ListCommand { +public class PublicHomeListCommand extends ListCommand { protected PublicHomeListCommand(@NotNull HuskHomes plugin) { diff --git a/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java b/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java index 34b713c6..569879dc 100644 --- a/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -public class WarpListCommand extends ListCommand { +public class WarpListCommand extends ListCommand { protected WarpListCommand(@NotNull HuskHomes plugin) { super("homelist", List.of("homes"), "[player] [page]", plugin);