diff --git a/brigadier/paper/src/main/java/team/unnamed/commandflow/brigadier/BrigaderProvider.java b/brigadier/paper/src/main/java/team/unnamed/commandflow/brigadier/BrigaderProvider.java index 87221418..740390cc 100644 --- a/brigadier/paper/src/main/java/team/unnamed/commandflow/brigadier/BrigaderProvider.java +++ b/brigadier/paper/src/main/java/team/unnamed/commandflow/brigadier/BrigaderProvider.java @@ -32,7 +32,6 @@ public static CommandBrigadierConverter, SendDataListener> obtain( BukkitCommandManager delegate, - Plugin plugin, Authorizer authorizer) { BiConsumer>, Command> empty = (literalCommandNodes, command) -> { @@ -42,11 +41,22 @@ public static Map.Entry(delegate, obtain(authorizer), empty, empty); SendDataListener listener = new SendDataListener(commandManager); - Bukkit.getPluginManager().registerEvents(listener, plugin); return new AbstractMap.SimpleEntry<>(commandManager, listener); } + public static Map.Entry, SendDataListener> obtainAndRegister( + BukkitCommandManager delegate, + Plugin plugin, + Authorizer authorizer) { + + Map.Entry, SendDataListener> entry = obtain(delegate, authorizer); + + Bukkit.getPluginManager().registerEvents(entry.getValue(), plugin); + + return entry; + } + public static class SendDataListener implements Listener { private final BrigadierCommandManager commandManager;