Fix format parsing in /near (Fixes #5641)

This commit is contained in:
Josh Roy 2024-02-09 22:17:26 -05:00
parent 4134b5fb99
commit 51075adec6

View File

@ -3,9 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.CommonPlaceholders;
import com.google.common.collect.Lists;
import net.ess3.api.IUser;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
@ -59,7 +57,7 @@ public class Commandnear extends EssentialsCommand {
if (otherUser == null || !user.isAuthorized("essentials.near.others")) {
otherUser = user;
}
user.sendTl("nearbyPlayers", getLocal(user.getSource(), otherUser, radius));
user.sendTl("nearbyPlayers", AdventureUtil.parsed(getLocal(user.getSource(), otherUser, radius)));
}
@Override
@ -109,7 +107,7 @@ public class Commandnear extends EssentialsCommand {
if (nearbyPlayer == null) {
continue;
}
output.append(user.playerTl("nearbyPlayersList", CommonPlaceholders.displayName((IUser) nearbyPlayer), (long)nearbyPlayer.getLocation().distance(loc)));
output.append(user.playerTl("nearbyPlayersList", nearbyPlayer.getDisplayName(), (long)nearbyPlayer.getLocation().distance(loc)));
}
return output.length() > 1 ? output.toString() : source.tl("none");