package eu.univento.core.commands; import java.util.List; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import eu.univento.core.Core; import eu.univento.core.api.AutoCommand; import eu.univento.core.api.Messages; import eu.univento.core.api.player.CustomPlayer; import eu.univento.core.api.youtube.YTAPI; import eu.univento.core.api.youtube.YoutubeChannel; /** * sets player to youtube rank * @author joethei * @version 1.0 */ public class Youtuber extends AutoCommand{ /** * @param plugin main class * @param command command to execute * @param description describes the command * @param aliases aliases of command */ public Youtuber(Core plugin, String command, String description, String[] aliases) { super(plugin, command, description, aliases); } @Override public boolean execute(CommandSender sender, String label, String[] args) { if(sender instanceof Player) { CustomPlayer p = CustomPlayer.getPlayer(sender.getName()); if(args.length == 1) { YoutubeChannel yt = YTAPI.getYTChannelFromName(args[0]); if(yt != null) { p.sendMessage("§aBenutzername: " + yt.getUsername()); p.sendMessage("§aGooglePlus ID: " + yt.getGoogleplusid()); p.sendMessage("§aZuletzt online: " + yt.getLastwebaccess()); p.sendMessage("§aVon: " + yt.getLocation()); p.sendMessage("§aAbos: " + yt.getSubscribers()); p.sendMessage("§aVideo Watch Count: " + yt.getVideoWatchCount()); p.sendMessage("§aViewcount: " + yt.getViewcount()); }else { p.sendMessage(Messages.PREFIX + "§cDer Youtube Kanal exsistiert nicht"); } }else { p.sendMessage(Messages.PREFIX + "§cBenutze doch /youtuber "); } }else { sender.sendMessage(Messages.NOT_A_PLAYER); } return true; } @Override public List tabComplete(CommandSender sender, String label, String[] args) { return null; } }