Skip to content

Commit

Permalink
Add teleport command step to CharacterActionAddCommand
Browse files Browse the repository at this point in the history
Introduced a new "teleport" command step in the action chain to enhance functionality. This addition prepares the infrastructure for teleport-related behaviors in the character plugin.
  • Loading branch information
NonSwag committed Jan 2, 2025
1 parent b453946 commit 937a226
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static LiteralArgumentBuilder<CommandSourceStack> create(CharacterPlugin plugin)
.then(runPlayerCommandPermitted(plugin))
.then(sendActionBar(plugin))
.then(sendMessage(plugin))
.then(teleport(plugin))
.then(transfer(plugin)))));
}

Expand Down Expand Up @@ -85,6 +86,10 @@ static LiteralArgumentBuilder<CommandSourceStack> create(CharacterPlugin plugin)
return Commands.literal("send-message").then(messageArgument(plugin, plugin.sendMessage));
}

private static ArgumentBuilder<CommandSourceStack, ?> teleport(CharacterPlugin plugin) {
return Commands.literal("teleport");
}

private static ArgumentBuilder<CommandSourceStack, ?> transfer(CharacterPlugin plugin) {
return Commands.literal("transfer").then(Commands.argument("hostname", StringArgumentType.string())
.then(Commands.argument("port", IntegerArgumentType.integer(1, 65535))
Expand Down

0 comments on commit 937a226

Please sign in to comment.