Skip to content

Commit b63bb4b

Browse files
committed
Deprecated the system used to register commands.
1 parent f3399f3 commit b63bb4b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/net/darkhax/bookshelf/registry/CommandRegistry.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,15 @@ public void initialize (IEventBus bus) {
5252
}
5353
}
5454

55+
/**
56+
* @deprecated The static instantiation of commands seems to make some mixin mods very
57+
* unhappy. As a result this approach to registering commands has been
58+
* deprecated and will be removed in future updates.
59+
*/
60+
@Deprecated
5561
public LiteralArgumentBuilder<CommandSource> registerCommand (LiteralArgumentBuilder<CommandSource> command) {
5662

63+
this.logger.error("Registered a command using a deprecated method. This will cause errors! {]", command);
5764
this.commands.add(command);
5865
return command;
5966
}
@@ -62,7 +69,7 @@ private void registerCommands (RegisterCommandsEvent event) {
6269

6370
if (!this.commands.isEmpty()) {
6471

65-
this.logger.info("Registering {} commands.", this.commands.size());
72+
this.logger.info("Registering {} commands. This mod is using a deprecated system!", this.commands.size());
6673
final CommandDispatcher<CommandSource> dispatcher = event.getDispatcher();
6774

6875
for (final LiteralArgumentBuilder<CommandSource> command : this.commands) {

0 commit comments

Comments
 (0)