Skip to content

Commit

Permalink
fix(game.command): add test command only when mod version is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Jul 28, 2023
1 parent a831494 commit 90d18c8
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static net.minecraft.commands.Commands.literal;
import java.util.List;
import org.auioc.mcmod.arnicalib.ArnicaLib;
import org.auioc.mcmod.arnicalib.base.version.HVersion;
import org.auioc.mcmod.arnicalib.game.command.DynamicCommandHandler;
import org.auioc.mcmod.arnicalib.game.command.node.VersionCommand;
import org.auioc.mcmod.arnicalib.game.mod.EnvironmentUtils;
Expand All @@ -16,7 +17,7 @@ public final class AHServerCommands {

public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
VersionCommand.addVersionNode(NODE, ArnicaLib.class);
if (EnvironmentUtils.IS_DEV) addTestNode(NODE);
addTestNode(NODE);

getAHNode(dispatcher).addChild(NODE);
}
Expand All @@ -31,13 +32,15 @@ public static CommandNode<CommandSourceStack> getAHNode(CommandDispatcher<Comman


private static void addTestNode(CommandNode<CommandSourceStack> node) {
node.addChild(
DynamicCommandHandler.createBuilder(
"org.auioc.mcmod.arnicalib.mod.test.TestHandlerCommand",
"create",
literal("test")
).build()
);
if (EnvironmentUtils.IS_DEV && ArnicaLib.VERSION.equals(HVersion.DEFAULT)) {
node.addChild(
DynamicCommandHandler.createBuilder(
"org.auioc.mcmod.arnicalib.mod.test.TestHandlerCommand",
"create",
literal("test")
).build()
);
}
}

}

0 comments on commit 90d18c8

Please sign in to comment.