From 51075adec6c411e1acee90b79ea3c882c2a70b7f Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Fri, 9 Feb 2024 22:17:26 -0500 Subject: [PATCH] Fix format parsing in /near (Fixes #5641) --- .../java/com/earth2me/essentials/commands/Commandnear.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnear.java index eda41aab5..34bc3aaa9 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandnear.java @@ -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");