can annyone help me with this code?
package me.nocare.who.cmds;
import me.nocare.who.Whoplugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class WhoCommandHandler implements CommandExecutor {
private Whoplugin plugin;
public WhoCommandHandler(Whoplugin instance) {
this.plugin = instance;
}
@Override
public boolean onCommand(CommandSender sender, Command Command, String commandLabel, String[] args) {
String msg = this.getOnlineUserOutput();
if (sender instanceof Player) {
Player player = (Player) sender;
Player.sendMessage(msg); } // **<-- get an error here**
else {
plugin.info(msg);
}
return true;
}
private String getOnlineUserOutput() {
String output = "Online Players (%s/%s): %s";
return String.format(output, this.plugin.getServer().getOnlinePlayers().length, this.plugin.getServer()
.getMaxPlayers(),this.formatPlayerList(this.plugin.getServer().getOnlinePlayers()));
}
private String formatPlayerList(Player[] onlinePlayers) {
String returnValue = onlinePlayers[0].getDisplayName();
for (int i - 1; i < onlinePlayers.length; i++) { // ** <-- and one on the i after int**
returnValue += ", "+onlinePlayers[i].getDisplayName();
}
return returnValue;
}
}