/**
* MSCore: A Minecraft core plugin for WhoMine plugins.
*/
package ua.com.minersstudios.whomine.core;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import lombok.*;
import org.bukkit.plugin.java.JavaPlugin;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class MSCore extends JavaPlugin
{
/**
* @return a single instance of the class
*/
@Getter
private static MSCore instance = new MSCore();
/**
* Ensure that required plugins are installed on a server, if not - disable itself.
*/
@Override
public void onEnable()
{
List<String> expected_plugins_names = new ArrayList<>(Arrays.asList(
"msDecor", "msUtil", "msBlock", "msItem"
));
for (String p : expected_plugins_names)
{
if (getServer().getPluginManager().getPlugin(p) == null)
{
getLogger().log(Level.SEVERE, "Required dependencies unsatisfied.");
getServer().getPluginManager().disablePlugin(instance);
break;
}
}
}
}