启动我的 Minecraft 服务器时出现错误。我用于插件的外部库是推荐的 buildcraftbukkit-1.6.4-R2.0。我正在使用craftbukkit-1.6.4-R2.0 来启动服务器并作为eclipse(java) 中的外部库。
这是我收到的一些错误:
Could not load 'plugins\Test.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Bench3.youtube.Youtube
at org.bukkit.plugin.java.javaPluginloader.LoadPlugin(JavaPluginLoader.java:184)
它继续。
这里有没有人知道如何解决这个问题?
我的插件代码是:
package me.Bench3.youtube;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
public class Youtube extends JavaPlugin{
public final Logger logger = Logger.getLogger("Minecraft");
public static Youtube plugin;
@Override
public void onDisable(){
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " Has been disabled!");
}
@Override
public void onEnable(){
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has been enabled!"); //You
}
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{
Player player = (Player) sender;
if (commandLabel.equalsIgnoreCase("sendme"))
{
player.sendMessage(ChatColor.BLUE + "Sent");
}
return false;
}
}
这是我的 plugin.yml
main: me.Bench3.yotube.Youtube
name: Youtube
version: 1.0