mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Fix not being able to view private home lists
This commit is contained in:
1 file changed
+2
-2
@@ -24,9 +24,9 @@ public class PrivateHomeListCommand extends ListCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
||||||
final Optional<String> homeOwner = args.length == 2 ? parseStringArg(args, 0)
|
final Optional<String> homeOwner = args.length > 0 ? parseStringArg(args, 0)
|
||||||
: executor instanceof OnlineUser user ? Optional.of(user.getUsername()) : Optional.empty();
|
: executor instanceof OnlineUser user ? Optional.of(user.getUsername()) : Optional.empty();
|
||||||
final int pageNumber = parseIntArg(args, args.length > 0 ? args.length - 1 : 0).orElse(1);
|
final int pageNumber = parseIntArg(args, args.length > 1 ? 1 : 0).orElse(1);
|
||||||
if (homeOwner.isEmpty()) {
|
if (homeOwner.isEmpty()) {
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
.ifPresent(executor::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
|
|||||||
Reference in new issue
Block a user