Skip to content

Commit

Permalink
Add pwd to action
Browse files Browse the repository at this point in the history
  • Loading branch information
lscgh committed Jan 25, 2024
1 parent 4bc8465 commit e6867b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Binary file added .github/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .github/workflows/github-action-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
steps:
- name: "Build print"
run: "echo Build"
- name: "Print working directory"
run: "pwd"
Install:
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.util.StringUtil;

import mavenmcserver.Plugin;
import net.md_5.bungee.api.ChatColor;

public class CommandTicTacToe implements CommandExecutor, TabCompleter {

Expand All @@ -31,8 +32,18 @@ public CommandTicTacToe(Plugin plugin) {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

if(!(sender instanceof Player)) {
sender.sendMessage("This command may only be executed by players");
return true;
}

if(args.length > 0) {

if(args.length > CommandTicTacToe.maxValidArgCount) {
sender.sendMessage(ChatColor.RED + "Too many arguments for command '/tictactoe'!" + ChatColor.RESET);
return false;
}

int noAvailablePlayersMinArgCount = 3;
if(args.length >= noAvailablePlayersMinArgCount) {
String noAvailablePlayersPlaceholder[] = {"(no", "available", "players)"};
Expand Down
2 changes: 1 addition & 1 deletion mavenmcserver/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ api-version: 1.20

commands:
tictactoe:
description: "Start a new Tic-Tac-Toe game!"
description: "Request a new Tic-Tac-Toe game!"
usage: "§cUsage: /<command> <opponent: Player> [sizeX = 3] [sizeY = 1] [sizeZ = 3] [winRequiredAmount = 3]§r"

0 comments on commit e6867b0

Please sign in to comment.