Added /waitwhat, applied userdata changes, added format test, progressed with formatting #62

Merged
NorbiPeti merged 8 commits from dev into master 2017-04-15 11:58:13 +00:00
2 changed files with 52 additions and 0 deletions
Showing only changes of commit d13dfc3eb2 - Show all commits

View file

@ -0,0 +1,49 @@
package buttondevteam.chat.commands;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import buttondevteam.chat.ChatPlayer;
import buttondevteam.lib.TBMCPlayer;
import buttondevteam.lib.chat.Channel;
import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;
public class WaitWhatCommand extends TBMCCommandBase {
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
Channel channel;
if (sender instanceof Player && ((Player) sender).isOnline())
channel = TBMCPlayer.getPlayer((Player) sender).asPluginPlayer(ChatPlayer.class).CurrentChannel;
else
channel = Channel.GlobalChat;
final String message;
if (args.length == 0)
message = "wait what";
else
message = "wait " + Arrays.stream(args).collect(Collectors.joining(" ")) + " what";
TBMCChatAPI.SendChatMessage(channel, sender, message);
return true;
}
@Override
public String[] GetHelpText(String alias) {
return new String[] { //
"§6--- Wait what ----", //
"Wait what" //
};
}
@Override
public boolean GetPlayerOnly() {
return false;
}
@Override
public boolean GetModOnly() {
return false;
}
}

View file

@ -23,6 +23,9 @@ commands:
description: Shrug.
yeehaw:
description: This command makes you yeehaw.
waitwhat:
description: Wait what.
aliases: ww
author: NorbiPeti
depend:
- Essentials