Skip to content

Commit

Permalink
finish mm-add command
Browse files Browse the repository at this point in the history
  • Loading branch information
Smartich0ke committed Sep 11, 2022
1 parent 1543f00 commit 9bfbb5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@
import org.bukkit.command.CommandSender;

public class mm_add implements CommandExecutor {
//mm-add world <minigame> <lobby/arena> <world-name>

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender.hasPermission("minigamesmanager.add") || sender.isOp()) {
if (args[0].equals("world")){
MinigameData.addMinigameWorld(args[1], args[3], args[2]);
sender.sendMessage(config.messagePrefix() + ChatColor.GREEN + "World " + ChatColor.YELLOW + args[3] + ChatColor.GREEN + " added as a " + ChatColor.YELLOW + args[2] + ChatColor.GREEN + " to the minigame " + ChatColor.YELLOW + args[1] + ChatColor.GREEN + " successfully!");
return true;
if(args[1].equals("lobby") || args[1].equals("arena")) {
MinigameData.addMinigameWorld(args[1], args[3], args[2]);
sender.sendMessage(config.messagePrefix() + ChatColor.GREEN + "World " + ChatColor.YELLOW + args[3] + ChatColor.GREEN + " added as a " + ChatColor.YELLOW + args[2] + ChatColor.GREEN + " to the minigame " + ChatColor.YELLOW + args[1] + ChatColor.GREEN + " successfully!");
return true;
} else {
sender.sendMessage(config.messagePrefix() + ChatColor.RED +"Specify a arena or lobby!");
return true;
}

}
else {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class mm_set implements CommandExecutor {
@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ commands:
permission: minigamesmanager.list.minigame
mm-add:
description: §aAdd lobbies or arenas to a minigame
usage: /mm-add <lobby/arena> <world-name> <minigame>
usage: /mm-add world <minigame> <lobby/arena> <world-name>
permission: minigamesmanager.add.worlds
mm-set:
description: §aSet properties for a minigame
Expand Down

0 comments on commit 9bfbb5c

Please sign in to comment.