Add invalid description error message
This commit is contained in:
parent
cc6b7e4b2c
commit
b2af579896
3 changed files with 6 additions and 3 deletions
|
|
@ -4,8 +4,7 @@ import net.frankheijden.serverutils.ServerUtils;
|
|||
import net.frankheijden.serverutils.reflection.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.plugin.InvalidPluginException;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.*;
|
||||
import org.bukkit.plugin.java.PluginClassLoader;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -24,6 +23,8 @@ public class PluginManager {
|
|||
if (!file.exists()) return new LoadResult(Result.NOT_EXISTS);
|
||||
try {
|
||||
return new LoadResult(Bukkit.getPluginManager().loadPlugin(file), Result.SUCCESS);
|
||||
} catch (InvalidDescriptionException ex) {
|
||||
return new LoadResult(Result.INVALID_DESCRIPTION);
|
||||
} catch (InvalidPluginException ex) {
|
||||
if (ex.getCause() instanceof IllegalArgumentException) {
|
||||
IllegalArgumentException e = (IllegalArgumentException) ex.getCause();
|
||||
|
|
@ -31,9 +32,9 @@ public class PluginManager {
|
|||
return new LoadResult(Result.ALREADY_ENABLED);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
return new LoadResult(Result.ERROR);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue