/**
* MSBlock: A Minecraft plugin with Blocks for WhoMine.
*/
package ua.com.minersstudios.whomine.block;
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 MSBlock extends JavaPlugin
{
/**
* @return a single instance of the class
*/
@Getter
private static MSBlock instance = new MSBlock();
/**
* 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(
"msCore", "ProtocolLib", "CoreProtect"
));
for (String p : expected_plugins_names)
{
if (getServer().getPluginManager().getPlugin(p) == null)
{
getLogger().log(Level.SEVERE, "Required dependencies unsatisfied.");
getServer().getPluginManager().disablePlugin(instance);
break;
}
}
}
}