Skip to content

Commit

Permalink
organize reflections
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Aug 14, 2022
1 parent 6b9c20c commit 640c5e8
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ private static Function<Plugin, Commodore> checkSupported() {
return null;
}

// try reflection impl
try {
ReflectionCommodore.ensureSetup();
return ReflectionCommodore::new;
} catch (Throwable e) {
printDebugInfo(e);
}

// try the paper impl
try {
Constructor<? extends Commodore> ctr = Class.forName("revxrsal.commands.bukkit.brigadier.PaperCommodore")
Expand All @@ -69,13 +77,6 @@ private static Function<Plugin, Commodore> checkSupported() {
printDebugInfo(e);
}

// try reflection impl
try {
ReflectionCommodore.ensureSetup();
return ReflectionCommodore::new;
} catch (Throwable e) {
printDebugInfo(e);
}
return null;
}

Expand Down

0 comments on commit 640c5e8

Please sign in to comment.