diff options
Diffstat (limited to 'EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java')
-rw-r--r-- | EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java new file mode 100644 index 000000000..9767f213b --- /dev/null +++ b/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIP.java @@ -0,0 +1,32 @@ +package net.ess3.geoip; + +import static net.ess3.I18n._; +import net.ess3.api.IEssentials; +import java.util.logging.Level; +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 IEssentials ess = (IEssentials)pm.getPlugin("Essentials-3"); + if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) + { + getLogger().log(Level.WARNING, _("versionMismatchAll")); + } + if (!ess.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/."); + } +} |