Skip to content

Commit

Permalink
refactor(command): mark getRootNode functions as forRemoval
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed May 12, 2022
1 parent f670f4d commit df2c35e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Expand Up @@ -16,20 +16,20 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
}

public static CommandNode<CommandSourceStack> getAHNode(CommandDispatcher<CommandSourceStack> dispatcher) {
return getRootNode(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")
@Deprecated(since = "5.1.3", forRemoval = true)
public static CommandNode<CommandSourceStack> getRootNode(CommandDispatcher<CommandSourceStack> dispatcher) {
CommandNode<CommandSourceStack> node = dispatcher.findNode(List.of("ah"));
if (node == null) {
node = dispatcher.register(literal("ah"));
}
return node;
return getAHNode(dispatcher);
}

}
Expand Up @@ -23,20 +23,20 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
}

public static CommandNode<CommandSourceStack> getAHNode(CommandDispatcher<CommandSourceStack> dispatcher) {
return getRootNode(dispatcher);
CommandNode<CommandSourceStack> node = dispatcher.findNode(List.of("ah"));
if (node == null) {
node = dispatcher.register(literal("ah"));
}
return node;
}

/**
* @since 4.1.0
* @deprecated Use {@link #getAHNode} instead
*/
@Deprecated(since = "5.1.3")
@Deprecated(since = "5.1.3", forRemoval = true)
public static CommandNode<CommandSourceStack> getRootNode(CommandDispatcher<CommandSourceStack> dispatcher) {
CommandNode<CommandSourceStack> node = dispatcher.findNode(List.of("ah"));
if (node == null) {
node = dispatcher.register(literal("ah"));
}
return node;
return getAHNode(dispatcher);
}

}

0 comments on commit df2c35e

Please sign in to comment.