File tree Expand file tree Collapse file tree
src/main/java/com/burchard36 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ public BurchAPI initializeApi(final JavaPlugin plugin) {
5050 if (aConstructor .getParameterTypes ().length == 0 && constructor == null )
5151 constructor = clazz .getDeclaredConstructor ();
5252
53- if (aConstructor .getParameterTypes ().length == 1 && aConstructor .getParameterTypes ()[0 ] == JavaPlugin . class ) {
53+ if (aConstructor .getParameterTypes ().length == 1 && aConstructor .getParameterTypes ()[0 ] == plugin . getClass () ) {
5454 toProvide = plugin ;
55- constructor = clazz .getDeclaredConstructor (JavaPlugin . class );
55+ constructor = clazz .getDeclaredConstructor (plugin . getClass () );
5656 }
5757 }
5858 } catch (NoSuchMethodException ex ) {
@@ -65,9 +65,9 @@ public BurchAPI initializeApi(final JavaPlugin plugin) {
6565 ApiCommand command ;
6666 try {
6767 try {
68- command = (ApiCommand ) constructor .newInstance ();
69- } catch (NullPointerException ignored ) {
7068 command = (ApiCommand ) constructor .newInstance (toProvide );
69+ } catch (NullPointerException ignored ) {
70+ command = (ApiCommand ) constructor .newInstance ();
7171 }
7272 } catch (IllegalAccessException | InstantiationException | InvocationTargetException ex ) {
7373 ex .printStackTrace ();
You can’t perform that action at this time.
0 commit comments