Reflect wrapper initialization does not crash anymore on the first exception. It accumulates all the exceptions and shows everything at the end.

This commit is contained in:
2023-05-09 11:57:05 +02:00
parent 3e0297c8af
commit 9b83f9699c
4 changed files with 197 additions and 84 deletions

View File

@@ -58,6 +58,8 @@ import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Stream;
import static fr.pandacube.lib.util.ThrowableUtil.wrapEx;
/**
* Abstract class to hold a command to be integrated into a Paper server vanilla command dispatcher.
*/
@@ -67,7 +69,7 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand<BukkitBriga
private static final CommandDispatcher<BukkitBrigadierCommandSource> nmsDispatcher;
static {
PandalibPaperReflect.init();
wrapEx(PandalibPaperReflect::init);
vanillaCommandDispatcher = ReflectWrapper.wrapTyped(Bukkit.getServer(), CraftServer.class)
.getServer()
.vanillaCommandDispatcher();