summaryrefslogtreecommitdiffstats
path: root/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java
blob: 265a4794766c73234448c8bb4735a8809c06c291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package net.ess3.geoip;

import static net.ess3.I18n._;
import net.ess3.api.IEssentials;
import java.util.logging.Level;
import net.ess3.api.IPlugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;


public class EssentialsGeoIP extends JavaPlugin
{
	@Override
	public void onEnable()
	{
		final PluginManager pm = getServer().getPluginManager();
		final IPlugin plugin = (IPlugin)pm.getPlugin("Essentials-3");
		final IEssentials ess = (IEssentials)plugin.getEssentials();
		if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
		{
			getLogger().log(Level.WARNING, _("versionMismatchAll"));
		}
		if (!plugin.isEnabled())
		{
			this.setEnabled(false);
			return;
		}
		final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(this, ess);
		pm.registerEvents(playerListener, this);
		ess.addReloadListener(playerListener);

		getLogger().log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
	}
}