Fixes to console home/warp lists

This commit is contained in:
William committed 2022-08-24 22:49:43 +01:00
1 parent 7e6f624ad6
commit 7ff83b200d
3 files changed
+6 -9

No files matched your search

@@ -2,7 +2,6 @@ package net.william278.huskhomes.command;
import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.player.OnlineUser;
import net.william278.huskhomes.player.User;
import net.william278.huskhomes.player.UserData;
import net.william278.huskhomes.position.Home;
import net.william278.huskhomes.util.Permission;
@@ -100,8 +99,8 @@ public class HomeListCommand extends CommandBase implements ConsoleExecutable {
plugin.getLoggingAdapter().log(Level.INFO, "List of " + userData.get().user().username + "'s "
+ homes.size() + " homes:");
for (int i = 1; i <= homes.size(); i++) {
final String home = homes.get(i).meta.name;
rowJoiner.add(home.length() < 16 ? " ".repeat(16 - home.length()) + home : home);
final String home = homes.get(i-1).meta.name;
rowJoiner.add(home.length() < 16 ? home + " ".repeat(16 - home.length()) : home);
if (i % 3 == 0) {
plugin.getLoggingAdapter().log(Level.INFO, rowJoiner.toString());
rowJoiner = new StringJoiner(" ");
@@ -2,13 +2,11 @@ package net.william278.huskhomes.command;
import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.player.OnlineUser;
import net.william278.huskhomes.player.UserData;
import net.william278.huskhomes.position.Home;
import net.william278.huskhomes.util.Permission;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
@@ -68,8 +66,8 @@ public class PublicHomeListCommand extends CommandBase implements ConsoleExecuta
plugin.getLoggingAdapter().log(Level.INFO, "List of " + homes.size() + " public homes:");
for (int i = 1; i <= homes.size(); i++) {
final String home = homes.get(i).owner.username + homes.get(i).meta.name;
rowJoiner.add(home.length() < 33 ? " ".repeat(33 - home.length()) + home : home);
final String home = homes.get(i - 1).owner.username + "." + homes.get(i).meta.name;
rowJoiner.add(home.length() < 33 ? home + " ".repeat(33 - home.length()) : home);
if (i % 3 == 0) {
plugin.getLoggingAdapter().log(Level.INFO, rowJoiner.toString());
rowJoiner = new StringJoiner(" ");
@@ -65,8 +65,8 @@ public class WarpListCommand extends CommandBase implements ConsoleExecutable {
plugin.getLoggingAdapter().log(Level.INFO, "List of " + warps.size() + " warps:");
for (int i = 1; i <= warps.size(); i++) {
final String warp = warps.get(i).meta.name;
rowJoiner.add(warp.length() < 16 ? " ".repeat(16 - warp.length()) + warp : warp);
final String warp = warps.get(i - 1).meta.name;
rowJoiner.add(warp.length() < 16 ? warp + " ".repeat(16 - warp.length()) : warp);
if (i % 3 == 0) {
plugin.getLoggingAdapter().log(Level.INFO, rowJoiner.toString());
rowJoiner = new StringJoiner(" ");