Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling "/seedcracker" command (#187) #220

Merged
merged 1 commit into from Jun 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import kaptainwutax.seedcrackerX.init.ClientCommands;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import kaptainwutax.seedcrackerX.util.Log;
import net.minecraft.client.MinecraftClient;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
Expand All @@ -27,7 +28,11 @@ public static void sendFeedback(String message, Formatting color, boolean overla
public final void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
LiteralArgumentBuilder<FabricClientCommandSource> builder = literal(this.getName());
this.build(builder);
dispatcher.register(literal(ClientCommands.PREFIX).then(builder));
LiteralArgumentBuilder<FabricClientCommandSource> seedCrackerRootCommand = literal(ClientCommands.PREFIX)
.executes(context -> {
Log.error("Error: please enter a valid seedcracker command");
return 1;
});
dispatcher.register(seedCrackerRootCommand.then(builder));
}

}