Chroma-Chat/.metadata/.plugins/org.eclipse.core.resources/.history/d1/1064daeba32b00151fa6e49f3e10bf0b
2015-07-16 13:51:59 +02:00

35 lines
1.1 KiB
Text

package tk.sznp.thebuttonautoflair;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commands implements CommandExecutor {
// This method is called, when somebody uses our command
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if(args.length<1)
return false;
if(!PluginMain.PlayerFlairs.containsKey(player.getName()))
{
player.sendMessage("Error: You need to write your username to the reddit thread at /r/TheButtonMinecraft");
}
switch(args[0])
{
case "accept":
PluginMain.AcceptedPlayers.add(player.getName());
player.setDisplayName(player.getDisplayName()+PluginMain.PlayerFlairs.get(player.getName()));
break;
case "ignore":
break;
}
return true;
}
// If the player (or console) uses our command correct, we can return true
return false;
}
}