11package me .crazyg .everything .commands ;
22
33import me .crazyg .everything .Everything ;
4- import org .bukkit .ChatColor ;
4+ import net .kyori .adventure .text .Component ;
5+ import net .kyori .adventure .text .format .NamedTextColor ;
56import org .bukkit .command .Command ;
67import org .bukkit .command .CommandExecutor ;
78import org .bukkit .command .CommandSender ;
@@ -18,40 +19,70 @@ public EverythingCommand(Everything plugin) {
1819 public boolean onCommand (CommandSender sender , Command command , String label , String [] args ) {
1920 if (args .length == 0 ) {
2021 // Display help/info page if no sub-command is provided
21- sender .sendMessage (ChatColor .GOLD + "Everything Plugin - Help" );
22- sender .sendMessage (ChatColor .YELLOW + "/everything reload" + ChatColor .WHITE + " - Reload the plugin configuration." );
23- sender .sendMessage (ChatColor .YELLOW + "/everything info" + ChatColor .WHITE + " - Display plugin information." );
24- sender .sendMessage (ChatColor .YELLOW + "/gmc" + ChatColor .WHITE + " - Changes your gamemode to creative mode" );
25- sender .sendMessage (ChatColor .YELLOW + "/gms" + ChatColor .WHITE + " - Changes your gamemode to survival mode" );
26- sender .sendMessage (ChatColor .YELLOW + "/gmsp" + ChatColor .WHITE + " - Changes your gamemode to spectator mode" );
27- sender .sendMessage (ChatColor .YELLOW + "/gma" + ChatColor .WHITE + " - Changes your gamemode to adventure mode" );
28- sender .sendMessage (ChatColor .YELLOW + "/setspawn" + ChatColor .WHITE + " - Set the spawn point for the world." );
29- sender .sendMessage (ChatColor .YELLOW + "/spawn" + ChatColor .WHITE + " - Teleport to the spawn point." );
30- sender .sendMessage (ChatColor .YELLOW + "/report" + ChatColor .WHITE + " - Report a player to the server staff." );
31- sender .sendMessage (ChatColor .YELLOW + "/god" + ChatColor .WHITE + " - Toggle god mode on/off." );
22+ sender .sendMessage (Component .text ("Everything Plugin - Help" ).color (NamedTextColor .GOLD ));
23+ sender .sendMessage (Component .text ()
24+ .append (Component .text ("/everything reload" ).color (NamedTextColor .YELLOW ))
25+ .append (Component .text (" - Reload the plugin configuration." ).color (NamedTextColor .WHITE )));
26+ sender .sendMessage (Component .text ()
27+ .append (Component .text ("/everything info" ).color (NamedTextColor .YELLOW ))
28+ .append (Component .text (" - Display plugin information." ).color (NamedTextColor .WHITE )));
29+ sender .sendMessage (Component .text ()
30+ .append (Component .text ("/gmc" ).color (NamedTextColor .YELLOW ))
31+ .append (Component .text (" - Changes your gamemode to creative mode" ).color (NamedTextColor .WHITE )));
32+ sender .sendMessage (Component .text ()
33+ .append (Component .text ("/gms" ).color (NamedTextColor .YELLOW ))
34+ .append (Component .text (" - Changes your gamemode to survival mode" ).color (NamedTextColor .WHITE )));
35+ sender .sendMessage (Component .text ()
36+ .append (Component .text ("/gmsp" ).color (NamedTextColor .YELLOW ))
37+ .append (Component .text (" - Changes your gamemode to spectator mode" ).color (NamedTextColor .WHITE )));
38+ sender .sendMessage (Component .text ()
39+ .append (Component .text ("/gma" ).color (NamedTextColor .YELLOW ))
40+ .append (Component .text (" - Changes your gamemode to adventure mode" ).color (NamedTextColor .WHITE )));
41+ sender .sendMessage (Component .text ()
42+ .append (Component .text ("/setspawn" ).color (NamedTextColor .YELLOW ))
43+ .append (Component .text (" - Set the spawn point for the world." ).color (NamedTextColor .WHITE )));
44+ sender .sendMessage (Component .text ()
45+ .append (Component .text ("/spawn" ).color (NamedTextColor .YELLOW ))
46+ .append (Component .text (" - Teleport to the spawn point." ).color (NamedTextColor .WHITE )));
47+ sender .sendMessage (Component .text ()
48+ .append (Component .text ("/report" ).color (NamedTextColor .YELLOW ))
49+ .append (Component .text (" - Report a player to the server staff." ).color (NamedTextColor .WHITE )));
50+ sender .sendMessage (Component .text ()
51+ .append (Component .text ("/god" ).color (NamedTextColor .YELLOW ))
52+ .append (Component .text (" - Toggle god mode on/off." ).color (NamedTextColor .WHITE )));
3253 return true ;
3354 }
3455
3556 // Handle sub-commands
3657 switch (args [0 ].toLowerCase ()) {
3758 case "reload" :
3859 if (!sender .hasPermission ("everything.reload" )) {
39- sender .sendMessage (ChatColor .RED + "You do not have permission to use this command." );
60+ sender .sendMessage (Component .text ("You do not have permission to use this command." )
61+ .color (NamedTextColor .RED ));
4062 return true ;
4163 }
4264 plugin .reloadConfig ();
43- sender .sendMessage (ChatColor .GREEN + "Plugin configuration reloaded successfully!" );
65+ sender .sendMessage (Component .text ("Plugin configuration reloaded successfully!" )
66+ .color (NamedTextColor .GREEN ));
4467 return true ;
4568
4669 case "info" :
47- sender .sendMessage (ChatColor .GOLD + "Everything Plugin - Info" );
48- sender .sendMessage (ChatColor .YELLOW + "Version: " + ChatColor .WHITE + plugin .getDescription ().getVersion ());
49- sender .sendMessage (ChatColor .YELLOW + "Author: " + ChatColor .WHITE + String .join (", " , plugin .getDescription ().getAuthors ()));
50- sender .sendMessage (ChatColor .YELLOW + "Description: " + ChatColor .WHITE + plugin .getDescription ().getDescription ());
70+ sender .sendMessage (Component .text ("Everything Plugin - Info" )
71+ .color (NamedTextColor .GOLD ));
72+ sender .sendMessage (Component .text ()
73+ .append (Component .text ("Version: " ).color (NamedTextColor .YELLOW ))
74+ .append (Component .text (plugin .getPluginMeta ().getVersion ()).color (NamedTextColor .WHITE )));
75+ sender .sendMessage (Component .text ()
76+ .append (Component .text ("Author: " ).color (NamedTextColor .YELLOW ))
77+ .append (Component .text (String .join (", " , plugin .getPluginMeta ().getAuthors ())).color (NamedTextColor .WHITE )));
78+ sender .sendMessage (Component .text ()
79+ .append (Component .text ("Description: " ).color (NamedTextColor .YELLOW ))
80+ .append (Component .text (plugin .getPluginMeta ().getDescription ()).color (NamedTextColor .WHITE )));
5181 return true ;
5282
5383 default :
54- sender .sendMessage (ChatColor .RED + "Unknown sub-command. Use /everything for help." );
84+ sender .sendMessage (Component .text ("Unknown sub-command. Use /everything for help." )
85+ .color (NamedTextColor .RED ));
5586 return true ;
5687 }
5788 }
0 commit comments