在Eclipse中,我的顶部空白行有错误,我无法摆脱它。这是我的代码(我正在制作一个bukkit插件):
//this is where I get the error
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
new EventHandler(this);
}
@Override
public void onDisable() {
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("BLANK") && sender instanceof Player) {
Player player = (Player) sender;
return true;
}
return false;
}
}
我无论如何都找不到它。请帮忙。
答案 0 :(得分:0)
您似乎缺少包裹名称。试试这个:
package my.package.name;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
new EventHandler(this);
}
@Override
public void onDisable() {
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("BLANK") && sender instanceof Player) {
Player player = (Player) sender;
return true;
}
return false;
}
}
请务必将my.package.name
替换为您的包裹名称。