From 8e091beb33b052baca6b708f9c82a9f1e51fdfaf Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 29 Jul 2016 21:22:18 +0200 Subject: [PATCH] Added help text, and such --- .../thebuttonmcchat/ChatProcessing.java | 3 ++- .../thebuttonmcchat/PlayerListener.java | 8 +++---- .../commands/ucmds/HelpCommand.java | 24 +++++++++---------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/buttondevteam/thebuttonmcchat/ChatProcessing.java b/src/buttondevteam/thebuttonmcchat/ChatProcessing.java index a5dad67..4c7f9f4 100644 --- a/src/buttondevteam/thebuttonmcchat/ChatProcessing.java +++ b/src/buttondevteam/thebuttonmcchat/ChatProcessing.java @@ -197,7 +197,8 @@ public class ChatProcessing { json.append(String.format("{\"text\":\"%s%s\",", (player != null ? player.getDisplayName() : sender.getName()), (mp != null ? mp.GetFormattedFlair() : ""))); json.append("\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":["); - json.append(String.format("{\"text\":\"%s\n\",", (player != null ? player.getName() : sender.getName()))); + json.append(String.format("{\"text\":\"Playername: %s\n\",", + (player != null ? player.getName() : sender.getName()))); json.append(String.format("\"color\":\"aqua\"},{\"text\":\"World: %s\n\",\"color\":\"white\"},", (player != null ? player.getWorld().getName() : "-"))); json.append(String.format("{\"text\":\"Respect: %s%s%s\",\"color\":\"white\"}]}}},", diff --git a/src/buttondevteam/thebuttonmcchat/PlayerListener.java b/src/buttondevteam/thebuttonmcchat/PlayerListener.java index 6d84908..51a3c3b 100644 --- a/src/buttondevteam/thebuttonmcchat/PlayerListener.java +++ b/src/buttondevteam/thebuttonmcchat/PlayerListener.java @@ -42,10 +42,10 @@ import org.bukkit.util.Vector; import au.com.mineauz.minigames.MinigamePlayer; import au.com.mineauz.minigames.Minigames; -import buttondevteam.core.player.TBMCPlayer; -import buttondevteam.core.player.TBMCPlayerAddEvent; -import buttondevteam.core.player.TBMCPlayerLoadEvent; -import buttondevteam.core.player.TBMCPlayerSaveEvent; +import buttondevteam.core.TBMCPlayer; +import buttondevteam.core.TBMCPlayerAddEvent; +import buttondevteam.core.TBMCPlayerLoadEvent; +import buttondevteam.core.TBMCPlayerSaveEvent; import buttondevteam.thebuttonmcchat.commands.ucmds.KittycannonCommand; import com.earth2me.essentials.Essentials; diff --git a/src/buttondevteam/thebuttonmcchat/commands/ucmds/HelpCommand.java b/src/buttondevteam/thebuttonmcchat/commands/ucmds/HelpCommand.java index 478056d..2a9969e 100644 --- a/src/buttondevteam/thebuttonmcchat/commands/ucmds/HelpCommand.java +++ b/src/buttondevteam/thebuttonmcchat/commands/ucmds/HelpCommand.java @@ -11,25 +11,24 @@ public final class HelpCommand extends UCommandBase { @Override public String[] GetHelpText(String alias) { - return new String[] { "§6---- Help ----", - "Prints out help messages for the TBMC plugins" }; + return new String[] { "§6---- Help ----", "Prints out help messages for the TBMC plugins" }; } @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { if (args.length == 0) { - sender.sendMessage(new String[] { - "§6---- TBMC Help ----", - "Do /u help for more info", - "Do /u help [subcommands] for more info about a command", - "Topics:", - "newp: Info for new players", + sender.sendMessage(new String[] { "§6---- TBMC Help ----", "Do /u help for more info", + "Do /u help [subcommands] for more info about a command", "Topics:", "commands: See all the commands from this plugin", - "login: If you or someone else has any problems with logins, lost inventory/location, etc." }); + "chat: Shows some info about custom chat features" }); return true; } - if (args[0].equalsIgnoreCase("newp")) - sender.sendMessage(new String[] { "§6---- Info for new players ----", "(Under construction)" }); // TODO + if (args[0].equalsIgnoreCase("chat")) + sender.sendMessage(new String[] { "§6---- Chat features ----", + "- [g] Channel identifier: Click it to copy message", "-- [g]: Global chat (/g)", + "-- [TC] Town chat (/tc)", "-- [NC] Nation chat (/nc)", + "- Playernames: Hover over them to get some player info", + "-- Respect: This is the number of paid respects divided by eliglble deaths. This is a reference to CoD:AW's \"Press F to pay respects\"" }); else if (args[0].equalsIgnoreCase("commands")) { ArrayList text = new ArrayList(); text.add("§6---- Command list ----"); @@ -43,8 +42,7 @@ public final class HelpCommand extends UCommandBase { path += "/" + args[i]; TBMCCommandBase cmd = CommandCaller.GetCommands().get(path); if (cmd == null) - sender.sendMessage(new String[] { - "§cError: Command not found: " + path.replace('/', ' '), + sender.sendMessage(new String[] { "§cError: Command not found: " + path.replace('/', ' '), "Usage example: /u accept --> /u help u accept" }); else sender.sendMessage(cmd.GetHelpText(args[0]));