これが私のコードです:
package me.chimericalhobo.BlockChanger;
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;
import org.bukkit.plugin.java.JavaPlugin;
public class BlockChanger extends JavaPlugin
{
private static final Logger log = Logger.getLogger("Minecraft");
private final BlockChangerListener blockListener = new BlockChangerListener(this);
public final ArrayList<Player> BlockChangerUsers = new ArrayList<Player>();
@Override
public void onEnable()
{
log.info("[BlockChanger] has been enabled!");
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(this.blockListener, this);
}
@Override
public void onDisable()
{
log.info("[BlockChanger] has been disabled!");
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{
if(commandLabel.equalsIgnoreCase("BlockChanger"))
toggleBlockChanger(sender);
return true;
}
private void toggleBlockChanger(CommandSender sender)
{
if(!enabled((Player) sender)){
BlockChangerUsers.add((Player) sender);
((Player) sender).sendMessage(ChatColor.BLUE + "BlockChanger has been enabled!");
}
else
{
BlockChangerUsers.remove((Player) sender);
((Player) sender).sendMessage(ChatColor.RED + "BlockChanger has been disabled!");
}
}
public boolean enabled(Player player)
{
return BlockChangerUsers.contains(player);
}
}
ロードしようとするたびに、コマンドプロンプトに次のように表示されます。
15:53:08 [SEVERE] Could not load 'plugins\BlockChanger.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: name is not defined