Skip to content

Commit 329b890

Browse files
authored
fix(fabric): command conditional (#1024)
1 parent 94e468d commit 329b890

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

fabric/src/main/java/me/confuser/banmanager/fabric/FabricCommand.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
import me.confuser.banmanager.common.commands.CommonCommand;
1919
import me.confuser.banmanager.common.commands.CommonSender;
2020
import me.lucko.fabric.api.permissions.v0.Permissions;
21+
//? if >=1.21 {
2122
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
23+
//?} else {
24+
/*import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;*/
25+
//?}
2226
import net.minecraft.server.command.CommandManager;
2327
import net.minecraft.server.command.ServerCommandSource;
2428
import net.minecraft.server.network.ServerPlayerEntity;
@@ -32,7 +36,11 @@ public FabricCommand(CommonCommand command) {
3236
}
3337

3438
public void register() {
39+
//? if >=1.21 {
3540
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
41+
//?} else {
42+
/*CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {*/
43+
//?}
3644
registerCommand(dispatcher, command.getCommandName());
3745

3846
for (String alias : command.getAliases()) {

0 commit comments

Comments
 (0)