mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 17:31:06 +01:00
Catch errors loading plugins
This commit is contained in:
parent
cb2ff3c8bb
commit
b396707cb9
1 changed files with 7 additions and 1 deletions
|
@ -74,10 +74,16 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
private void loadPlugin(Plugin plugin) {
|
private void loadPlugin(Plugin plugin) {
|
||||||
List<Command> pluginCommands = PluginCommandYamlParser.parse(plugin);
|
List<Command> pluginCommands = PluginCommandYamlParser.parse(plugin);
|
||||||
|
|
||||||
if (!pluginCommands.isEmpty()) {
|
if (!pluginCommands.isEmpty()) {
|
||||||
commandMap.registerAll(plugin.getDescription().getName(), pluginCommands);
|
commandMap.registerAll(plugin.getDescription().getName(), pluginCommands);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
pluginManager.enablePlugin(plugin);
|
pluginManager.enablePlugin(plugin);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " loading " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
Loading…
Reference in a new issue