Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.thegarfish.siege;
- import java.util.ArrayList;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin{
- public ArrayList<String> redteam = new ArrayList<String>();
- public ArrayList<String> blueteam = new ArrayList<String>();
- public void onDisable() {
- PluginDescriptionFile pdfFile = getDescription();
- System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " has been disabled!" );
- }
- public void onEnable() {
- PluginDescriptionFile pdfFile = getDescription();
- System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
- if (sender instanceof Player) {
- Player player = (Player) sender;
- if(cmd.getName().equalsIgnoreCase("join")){
- if(args.length == 1){
- if(args[0].equalsIgnoreCase("red")){
- redteam.add(player.getName());
- sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Red team!");
- }else{
- if(args[0].equalsIgnoreCase("blue")){
- blueteam.add(player.getName());
- sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Blue team!");
- }
- }
- }else{
- sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "Usage: /join red; /join blue");
- }
- }
- }
- if(cmd.getName().equalsIgnoreCase("Check")) {
- if(args.length == 1) {
- if(args[0].equalsIgnoreCase("red")) {
- System.out.println(redteam.toString());
- }else{
- if(args[0].equalsIgnoreCase("blue")) {
- System.out.println(blueteam.toString());
- }
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement