Fixed #33 and minor bugs

This commit is contained in:
Norbi Peti 2016-06-23 12:51:53 +02:00
parent 76655a2c91
commit 6889f8ed87
3 changed files with 8 additions and 4 deletions

View file

@ -25,6 +25,9 @@ commands:
chatonly:
description: Enable chat only mode. Useful for chat clients.
usage: "&cUsage: /chatonly&r"
shrug:
description: Shrug.
usage: "&cUsage: /shrug [message]&r"
author: NorbiPeti
depend: [Essentials, Towny, Minigames, Votifier, WorldGuard, WorldEdit, ProtocolLib, FastLogin, Vault, AuthMe]
permissions:

View file

@ -3,6 +3,7 @@ package io.github.norbipeti.thebuttonmcchat.commands;
import java.util.HashMap;
import io.github.norbipeti.thebuttonmcchat.PluginMain;
import io.github.norbipeti.thebuttonmcchat.commands.appendtext.ShrugCommand;
import io.github.norbipeti.thebuttonmcchat.commands.appendtext.TableflipCommand;
import io.github.norbipeti.thebuttonmcchat.commands.appendtext.UnflipCommand;
import io.github.norbipeti.thebuttonmcchat.commands.ucmds.UCommand;
@ -29,6 +30,8 @@ public abstract class TBMCCommandBase implements CommandExecutor {
plugin.getCommand(cmd.GetCommandName()).setExecutor(cmd);
cmd = new ChatonlyCommand();
plugin.getCommand(cmd.GetCommandName()).setExecutor(cmd);
cmd = new ShrugCommand();
plugin.getCommand(cmd.GetCommandName()).setExecutor(cmd);
}
private static HashMap<String, TBMCCommandBase> commands = new HashMap<String, TBMCCommandBase>();

View file

@ -14,10 +14,8 @@ public abstract class AppendTextCommandBase extends TBMCCommandBase {
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
String msg = GetAppendedText();
if (args.length > 0) {
msg = args[0] + " " + msg;
} else
msg = " " + msg;
for (int i = args.length - 1; i >= 0; i--)
msg = args[i] + " " + msg;
ChatProcessing.ProcessChat(sender, msg);
return true;
}