summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/net/ess3/protect/EssentialsConnect.java
blob: 358d881bb801e290e002a4d4d5f795750c7143b9 (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.protect;

import java.util.logging.Level;
import java.util.logging.Logger;
import static net.ess3.I18n._;
import net.ess3.api.IEssentials;
import net.ess3.bukkit.BukkitPlugin;
import org.bukkit.plugin.Plugin;


public class EssentialsConnect
{
	private static final Logger LOGGER = Logger.getLogger("Minecraft");
	private final IEssentials ess;
	private final IProtect protect;

	public EssentialsConnect(final Plugin essPlugin, final Plugin essProtect)
	{
		if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
		{
			LOGGER.log(Level.WARNING, _("Version mismatch! Please update all Essentials jars to the same version."));
		}
		ess = ((BukkitPlugin)essPlugin).getEssentials();
		protect = (IProtect)essProtect;
		ProtectHolder settings = new ProtectHolder(ess);
		protect.setSettings(settings);
		ess.addReloadListener(settings);
	}

	public IEssentials getEssentials()
	{
		return ess;
	}
}