blob: 16d774a9dda997f8e29c2709b37da60eebf14b2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package de.hysky.skyblocker.skyblock;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.tree.LiteralCommandNode;
import de.hysky.skyblocker.utils.Utils;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.command.CommandSource;
import java.util.stream.Stream;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class ViewstashAutocomplete {
public static LiteralCommandNode<FabricClientCommandSource> getCommandNode() {
return literal("viewstash")
.requires(fabricClientCommandSource -> Utils.isOnSkyblock())
.then(argument("stash", StringArgumentType.word())
.suggests((context, builder) -> CommandSource.suggestMatching(Stream.of("material", "item"), builder))
).build();
}
}
|