summaryrefslogtreecommitdiff
path: root/src/main/java/com/encrox/instanceddungeons/Commander.java
blob: a9b5f397163ea13b10d0f342f1d6c763b965153a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.encrox.instanceddungeons;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.json.JSONObject;

public class Commander implements CommandExecutor {

	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
		if(sender instanceof Player) {
			Player player = (Player)sender;
			try {
				switch(args[0]) {
				case "open":
					break;
				case "invite":
					break;
				case "join":
					break;
				case "close":
					break;
				case "random":
					Dungeon dungeon = new Dungeon(player, args[1], Integer.parseInt(args[2]));
					InstancedDungeons.dungeons.add(dungeon);
					return true;
				}
			} catch(Exception e) {
				e.printStackTrace();
			}
		} else {
			sender.sendMessage("no player");
		}
		return false;
	}

}