我的 java 插件有问题。这是我以前从未有过的。正常,一切顺利。
这是代码:
package me.brian.CubeRanks;
import me.brian.CubeRanks.CubeRanks;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
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.PluginManager;
public class CubeRanks {
public class CubeRanks extends JavaPlugin {
public static CubeRanks plugin;
public final Logger log = Logger.getLogger("Minecraft");
public boolean enabled = false;
public final PlayerListener pl = new PlayerListener(this);
public final ArrayList<Player> OreHunterUsers = new ArrayList<Player>();
public String cr = "[CubeRanks] ";
@Override
public void onEnable() {
log.info(cr + "is now enabled.");
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(pl, this);
}
@Override
public void onDisable() {
log.info(cr + "is now disabled.");
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(commandLabel.equalsIgnoreCase("CubeRanks")) {
if(args.length==0) {
if(!enabled) {
enabled = true;
((Player) sender).sendMessage(ChatColor.GREEN + cr + "is now enabled");
}
else {
enabled = false;
((Player) sender).sendMessage(ChatColor.RED + cr + "is now disbaled");
}
}
}
return false;
}
}
}
有人能看出什么问题吗?
整个错误代码:
说明 资源路径 位置 类型 嵌套类型 CubeRanks 不能隐藏封闭类型 CubeRanks.java /CubeRanks/src/me/brian/CubeRanks 第 16 行 Java 问题
错误照片:这是错误