mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
[Bleeding] Skip InvocationTargetException. Addresses BUKKIT-774
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
@@ -143,6 +144,8 @@ public class JavaPluginLoader implements PluginLoader {
|
||||
result = constructor.newInstance();
|
||||
|
||||
result.initialize(this, server, description, dataFolder, file, loader);
|
||||
} catch (InvocationTargetException ex) {
|
||||
throw new InvalidPluginException(ex.getCause());
|
||||
} catch (Throwable ex) {
|
||||
throw new InvalidPluginException(ex);
|
||||
}
|
||||
@@ -298,6 +301,8 @@ public class JavaPluginLoader implements PluginLoader {
|
||||
return;
|
||||
}
|
||||
method.invoke(listener, event);
|
||||
} catch (InvocationTargetException ex) {
|
||||
throw new EventException(ex.getCause());
|
||||
} catch (Throwable t) {
|
||||
throw new EventException(t);
|
||||
}
|
||||
|
Reference in New Issue
Block a user