Add check to make sure LibsDisguises is actually on the server

This commit is contained in:
Telesphoreo 2022-05-12 22:17:50 -05:00
parent 7bdffd6c0d
commit b3fb0f01f3
No known key found for this signature in database
GPG key ID: 5ACFFC4682CF849B

View file

@ -4,14 +4,22 @@ import dev.plex.command.DisguiseToggleCMD;
import dev.plex.command.UndisguiseAllCMD; import dev.plex.command.UndisguiseAllCMD;
import dev.plex.listener.DisguiseListener; import dev.plex.listener.DisguiseListener;
import dev.plex.module.PlexModule; import dev.plex.module.PlexModule;
import dev.plex.util.PlexLog;
import org.bukkit.Bukkit;
public class LibsDisguises extends PlexModule public class LibsDisguises extends PlexModule
{ {
public static boolean enabled = true; public static boolean enabled = true;
DisguiseListener disguiseListener; DisguiseListener disguiseListener;
@Override @Override
public void enable() public void enable()
{ {
if (!Bukkit.getPluginManager().isPluginEnabled("LibsDisguises"))
{
PlexLog.error("The Plex-LibsDisguises module requires the LibsDisguises plugin to work.");
return;
}
registerCommand(new DisguiseToggleCMD()); registerCommand(new DisguiseToggleCMD());
registerCommand(new UndisguiseAllCMD()); registerCommand(new UndisguiseAllCMD());
registerListener(new DisguiseListener()); registerListener(new DisguiseListener());