55package xzot1k .plugins .ds .core ;
66
77import me .devtec .shared .Ref ;
8+ import me .devtec .shared .utility .StringUtils ;
9+ import net .kyori .adventure .text .Component ;
10+ import net .kyori .adventure .text .minimessage .MiniMessage ;
11+ import net .kyori .adventure .text .minimessage .tag .resolver .Placeholder ;
812import net .md_5 .bungee .api .chat .ClickEvent ;
913import net .md_5 .bungee .api .chat .HoverEvent ;
1014import net .md_5 .bungee .api .chat .ItemTag ;
@@ -1097,7 +1101,8 @@ private void runReset(CommandSender commandSender, String marketRegionId) {
10971101 marketRegion .reset ();
10981102
10991103 final String message = getPluginInstance ().getLangConfig ().getString ("market-region-reset" );
1100- if (message != null ) getPluginInstance ().getManager ().sendMessage (player , message .replace ("{id}" , marketRegion .getMarketId ()));
1104+ if (message != null )
1105+ getPluginInstance ().getManager ().sendMessage (player , message .replace ("{id}" , marketRegion .getMarketId ()));
11011106 return ;
11021107 }
11031108
@@ -1187,8 +1192,10 @@ private void runAppearanceAccess(CommandSender commandSender, boolean isUnlock,
11871192 if (message != null && !message .equalsIgnoreCase ("" )) {
11881193 String status = getPluginInstance ().getLangConfig ().getString (isUnlock ? "unlocked" : "locked" );
11891194 if (status != null ) message = message .replace ("{status}" , status );
1190- if (isPlayer ) getPluginInstance ().getManager ().sendMessage ((Player ) commandSender , message .replace ("{player}" , player .getName ()));
1191- else commandSender .sendMessage (getPluginInstance ().getManager ().color (message .replace ("{player}" , player .getName ())));
1195+ if (isPlayer )
1196+ getPluginInstance ().getManager ().sendMessage ((Player ) commandSender , message .replace ("{player}" , player .getName ()));
1197+ else
1198+ commandSender .sendMessage (getPluginInstance ().getManager ().color (message .replace ("{player}" , player .getName ())));
11921199 }
11931200 } else {
11941201 Appearance appearance = Appearance .getAppearance (args [2 ]);
@@ -1211,8 +1218,10 @@ private void runAppearanceAccess(CommandSender commandSender, boolean isUnlock,
12111218 if (message != null && !message .equalsIgnoreCase ("" )) {
12121219 String status = getPluginInstance ().getLangConfig ().getString (isUnlock ? "unlocked" : "locked" );
12131220 if (status != null ) message = message .replace ("{status}" , status );
1214- if (isPlayer ) getPluginInstance ().getManager ().sendMessage ((Player ) commandSender , message .replace ("{player}" , player .getName ()));
1215- else commandSender .sendMessage (getPluginInstance ().getManager ().color (message .replace ("{player}" , player .getName ())));
1221+ if (isPlayer )
1222+ getPluginInstance ().getManager ().sendMessage ((Player ) commandSender , message .replace ("{player}" , player .getName ()));
1223+ else
1224+ commandSender .sendMessage (getPluginInstance ().getManager ().color (message .replace ("{player}" , player .getName ())));
12161225 }
12171226 }
12181227 }
@@ -1527,6 +1536,22 @@ private void runCleanUp(CommandSender commandSender) {
15271536 .replace ("{count}" , getPluginInstance ().getManager ().formatNumber (cleanCount , false ))));
15281537 }
15291538
1539+ private final MiniMessage mm = MiniMessage .miniMessage ();
1540+
1541+ private Component getAuthors () {
1542+ String authorFormat = "<click:open_url:\" https://github.com/<author>\" ><hover:show_text:\" <aqua>Click to see <yellow><author>'s</yellow> Github</aqua>\" ><author></hover></click>" ;
1543+ Component authors = Component .empty ();
1544+ int i = 0 ;
1545+ List <String > authors1 = getPluginInstance ().getDescription ().getAuthors ();
1546+ for (String author : authors1 ) {
1547+ authors = authors .append (mm .deserialize (authorFormat , Placeholder .parsed ("author" , author )));
1548+ if (i != authors1 .size ())
1549+ authors = authors .append (Component .text (", " ));
1550+ i ++;
1551+ }
1552+ return authors ;
1553+ }
1554+
15301555 private void runInfo (CommandSender commandSender ) {
15311556 if (!commandSender .hasPermission ("displayshops.info" )) {
15321557 String message = getPluginInstance ().getLangConfig ().getString ("no-permission" );
@@ -1535,13 +1560,28 @@ private void runInfo(CommandSender commandSender) {
15351560 return ;
15361561 }
15371562
1538- commandSender .sendMessage (getPluginInstance ().getManager ().color ("\n &e<&m------------&r&e[ &bDisplayShops &e]&m------------&r&e>\n " +
1563+ String message = "\n <yellow><<st>------------</st>[ <aqua>DisplayShops</aqua> ]<st>------------</st>>\n " +
1564+ "<gray>Current Plugin Version:</gray> <plversion>\n " +
1565+ "<gray>Latest Released Version:</gray> <green><plreleasedver></green>\n " +
1566+ "<gray>Author(s):</gray><aqua> <authors>\n " +
1567+ "<yellow><<st>-------------------------------------</st>>" ;
1568+
1569+ String pluginVersion = (getPluginInstance ().getDescription ().getVersion ().toLowerCase ().contains ("build" ) ? "<red>" : "<green>" ) + getPluginInstance ().getDescription ().getVersion ();
1570+ String releasedVersion = (getPluginInstance ().getDescription ().getVersion ().toLowerCase ().contains ("snapshot" ) ? "<dark_blue>" : "<green>" ) + getPluginInstance ().getLatestVersion ();
1571+ if (Ref .serverType ()== Ref .ServerType .PAPER ) {
1572+ commandSender .sendMessage (mm .deserialize (message
1573+ , Placeholder .parsed ("plversion" , pluginVersion )
1574+ , Placeholder .parsed ("plreleasedver" , releasedVersion )
1575+ , Placeholder .component ("authors" , this ::getAuthors )));
1576+ }else {
1577+ commandSender .sendMessage (getPluginInstance ().getManager ().color ("\n &e<&m------------&r&e[ &bDisplayShops &e]&m------------&r&e>\n " +
15391578 "&7Current Plugin Version: " + (getPluginInstance ().getDescription ().getVersion ().toLowerCase ().contains ("build" ) ? "&c" : "&a" )
15401579 + getPluginInstance ().getDescription ().getVersion () + "\n " +
15411580 "&7Latest Release Plugin Version: " + (getPluginInstance ().getDescription ().getVersion ().toLowerCase ().contains ("snapshot" ) ? "&1" : "&a" )
15421581 + getPluginInstance ().getLatestVersion () + "\n "
1543- + "&7Author(s): &bXZot1K \n " +
1582+ + "&7Author(s): &b" + StringUtils . join ( getPluginInstance (). getDescription (). getAuthors (), ", " ) + " \n " +
15441583 "&e<&m-------------------------------------&r&e>\n " ));
1584+ }
15451585 }
15461586
15471587 private void runCreateMarket (CommandSender commandSender , String [] args ) {
0 commit comments