From 9d17faf7228420088f96743baa1a6e9c9d5ad2ff Mon Sep 17 00:00:00 2001 From: William Date: Fri, 8 Nov 2024 22:21:37 +0000 Subject: [PATCH] fix: `/back` not working on Fabric, close #713 Also broke the command list (`/huskhomes help`) --- .../java/net/william278/huskhomes/FabricHuskHomes.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fabric/src/main/java/net/william278/huskhomes/FabricHuskHomes.java b/fabric/src/main/java/net/william278/huskhomes/FabricHuskHomes.java index c44cab0b..886b4c46 100644 --- a/fabric/src/main/java/net/william278/huskhomes/FabricHuskHomes.java +++ b/fabric/src/main/java/net/william278/huskhomes/FabricHuskHomes.java @@ -256,10 +256,9 @@ public Version getMinecraftVersion() { } @Override - public void registerCommands(@NotNull List commands) { - CommandRegistrationCallback.EVENT.register((dispatcher, ignored, ignored2) -> commands.forEach( - (command) -> new FabricCommand(command, this).register(dispatcher)) - ); + public void registerCommands(@NotNull List toRegister) { + CommandRegistrationCallback.EVENT.register((dispatcher, i1, i2) -> toRegister.stream().peek(commands::add) + .forEach((command) -> new FabricCommand(command, this).register(dispatcher))); } @Override