22
33import com .earth2me .essentials .I18n ;
44import com .earth2me .essentials .User ;
5+ import com .earth2me .essentials .adventure .AdventureFacet ;
56import com .mojang .brigadier .builder .LiteralArgumentBuilder ;
67import dev .plex .command .SimplePlexCommand ;
78import dev .plex .command .source .RequiredCommandSource ;
@@ -64,11 +65,13 @@ private Component executeTyped(CommandSender commandSender, Player player, @Null
6465
6566 final Component nick = miniMessage .deserialize (input ).clickEvent (null ).hoverEvent (null );
6667 final String plain = plainText .serialize (nick );
68+ AdventureFacet adventure = module .getEssentials ().getAdventureFacet ();
6769
6870 if (plain .length () > module .getEssentials ().getSettings ().getMaxNickLength ()
6971 && !commandSender .hasPermission ("plex.nickmm.ignore_length_limit" ))
7072 {
71- return mmString (I18n .tlLiteral ("nickTooLong" ));
73+ adventure .send (commandSender , adventure .deserializeMiniMessage (I18n .tlLiteral ("nickTooLong" )));
74+ return null ;
7275 }
7376
7477 if (!commandSender .hasPermission ("plex.nickmm.ignore_matching" ))
@@ -79,7 +82,8 @@ private Component executeTyped(CommandSender commandSender, Player player, @Null
7982
8083 if (name .equalsIgnoreCase (plain ) && !user .getUUID ().equals (player .getUniqueId ()))
8184 {
82- return mmString (I18n .tlLiteral ("nickInUse" ));
85+ adventure .send (commandSender , adventure .deserializeMiniMessage (I18n .tlLiteral ("nickInUse" )));
86+ return null ;
8387 }
8488 }
8589 }
@@ -89,7 +93,8 @@ private Component executeTyped(CommandSender commandSender, Player player, @Null
8993 essentialsUser .setNickname (legacy );
9094 essentialsUser .setDisplayNick ();
9195
92- return mmString (I18n .tlLiteral ("nickSet" , legacy ));
96+ adventure .send (commandSender , adventure .deserializeMiniMessage (I18n .tlLiteral ("nickSet" , legacy )));
97+ return null ;
9398 }
9499
95100 private static class NicknameTagResolver implements TagResolver
0 commit comments