-
Notifications
You must be signed in to change notification settings - Fork 0
/
AHClientCommands.java
35 lines (29 loc) · 1.14 KB
/
AHClientCommands.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.auioc.mcmod.arnicalib.client.command;
import static net.minecraft.commands.Commands.literal;
import java.util.List;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.tree.CommandNode;
import net.minecraft.commands.CommandSourceStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public final class AHClientCommands {
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
getAHNode(dispatcher);
}
public static CommandNode<CommandSourceStack> getAHNode(CommandDispatcher<CommandSourceStack> dispatcher) {
CommandNode<CommandSourceStack> node = dispatcher.findNode(List.of("ah"));
if (node == null) {
node = dispatcher.register(literal("ah"));
}
return node;
}
/**
* @since 5.0.2
* @deprecated Use {@link #getAHNode} instead
*/
@Deprecated(since = "5.1.3", forRemoval = true)
public static CommandNode<CommandSourceStack> getRootNode(CommandDispatcher<CommandSourceStack> dispatcher) {
return getAHNode(dispatcher);
}
}