2011-03-19 22:39:51 +00:00
|
|
|
package com.earth2me.essentials.spawn;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
import java.util.logging.*;
|
|
|
|
import com.earth2me.essentials.*;
|
|
|
|
import org.bukkit.command.*;
|
|
|
|
import org.bukkit.event.Event.Priority;
|
|
|
|
import org.bukkit.event.Event.Type;
|
|
|
|
import org.bukkit.plugin.java.*;
|
|
|
|
|
|
|
|
|
|
|
|
public class EssentialsSpawn extends JavaPlugin
|
|
|
|
{
|
|
|
|
public static final String AUTHORS = Essentials.AUTHORS;
|
|
|
|
private static final Logger logger = Logger.getLogger("Minecraft");
|
|
|
|
|
|
|
|
public EssentialsSpawn() throws IOException
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onEnable()
|
|
|
|
{
|
|
|
|
EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener();
|
|
|
|
getServer().getPluginManager().registerEvent(Type.PLAYER_RESPAWN, playerListener, Priority.Low, this);
|
|
|
|
getServer().getPluginManager().registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Low, this);
|
|
|
|
|
|
|
|
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
|
2011-05-10 19:57:59 +00:00
|
|
|
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
|
2011-03-19 22:39:51 +00:00
|
|
|
}
|
2011-05-10 19:57:59 +00:00
|
|
|
logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS));
|
2011-03-19 22:39:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void onDisable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
|
|
|
|
{
|
2011-06-26 13:47:28 +00:00
|
|
|
return Essentials.getStatic().onCommandEssentials(sender, command, commandLabel, args, EssentialsSpawn.class.getClassLoader(), "com.earth2me.essentials.spawn.Command", "essentials.");
|
2011-03-19 22:39:51 +00:00
|
|
|
}
|
|
|
|
}
|