git somehow ignored these files

This commit is contained in:
destro174
2021-06-24 23:08:13 +02:00
parent b5b9f92cfb
commit 3a60dada35
4 changed files with 182 additions and 0 deletions
@@ -0,0 +1,27 @@
package com.alttd.chat.commands;
import com.alttd.chat.ChatPlugin;
import org.apache.commons.lang.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
public class Message implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player)) { // must be a player, @teri should console be able to /msg?
return true;
}
Player player = (Player) sender;
if(args.length > 2) return false; // todo error message or command info
String message = StringUtils.join(args, " ", 1, args.length);
ChatPlugin.getInstance().getChatHandler().privateMessage(player, args[0], message);
return false;
}
// Teri, is Tabcompleter needed here? we already have spigot setup to complete playernames on tab, doesn't work for crossserver stuff and offline players
}