🐛 Transition to AFTER_REGISTRATION even when no commands have been registered

This commit is contained in:
jmp 2021-01-02 14:57:38 -08:00 committed by Alexander Söderberg
parent 7eddcd237a
commit 8913b2495e
5 changed files with 19 additions and 8 deletions

View file

@ -375,7 +375,7 @@ public class BukkitCommandManager<C> extends CommandManager<C> implements Brigad
final void lockIfBrigadierCapable() {
if (this.minecraftVersion >= BRIGADIER_MINIMUM_VERSION) {
this.transitionOrThrow(RegistrationState.REGISTERING, RegistrationState.AFTER_REGISTRATION);
this.lockRegistration();
}
}

View file

@ -76,7 +76,7 @@ public class CloudburstCommandManager<C> extends CommandManager<C> {
RegistriesClosedEvent.class,
CloudListener.INSTANCE,
EventPriority.NORMAL,
(listener, event) -> this.lock(),
(listener, event) -> this.lockRegistration(),
this.owningPlugin
);
}
@ -89,10 +89,6 @@ public class CloudburstCommandManager<C> extends CommandManager<C> {
return this.backwardsCommandSenderMapper.apply(sender).hasPermission(permission);
}
final void lock() {
this.transitionOrThrow(RegistrationState.REGISTERING, RegistrationState.AFTER_REGISTRATION);
}
@Override
public final @NonNull CommandMeta createDefaultCommandMeta() {
return SimpleCommandMeta.builder().build();

View file

@ -139,7 +139,7 @@ public class VelocityCommandManager<C> extends CommandManager<C> implements Brig
}
this.proxyServer.getEventManager().register(plugin, ServerPreConnectEvent.class, ev -> {
this.transitionOrThrow(RegistrationState.REGISTERING, RegistrationState.AFTER_REGISTRATION);
this.lockRegistration();
});
}