Advertisement
thegarfish

Untitled

Sep 8th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. package me.thegarfish.siege;
  2.  
  3. import java.util.ArrayList;
  4.  
  5.  
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13.  
  14.  
  15.  
  16. public class Main extends JavaPlugin{
  17.  
  18. public ArrayList<String> redteam = new ArrayList<String>();
  19. public ArrayList<String> blueteam = new ArrayList<String>();
  20.  
  21. public void onDisable() {
  22. PluginDescriptionFile pdfFile = getDescription();
  23. System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " has been disabled!" );
  24. }
  25.  
  26. public void onEnable() {
  27. PluginDescriptionFile pdfFile = getDescription();
  28. System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
  29.  
  30. }
  31.  
  32. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
  33.  
  34. if (sender instanceof Player) {
  35.  
  36. Player player = (Player) sender;
  37. if(cmd.getName().equalsIgnoreCase("join")){
  38. if(args.length == 1){
  39. if(args[0].equalsIgnoreCase("red")){
  40.  
  41. redteam.add(player.getName());
  42. sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Red team!");
  43.  
  44. }else{
  45.  
  46. if(args[0].equalsIgnoreCase("blue")){
  47.  
  48. blueteam.add(player.getName());
  49. sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Blue team!");
  50.  
  51. }
  52. }
  53. }else{
  54. sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "Usage: /join red; /join blue");
  55. }
  56. }
  57.  
  58. }
  59. if(cmd.getName().equalsIgnoreCase("Check")) {
  60. if(args.length == 1) {
  61. if(args[0].equalsIgnoreCase("red")) {
  62. System.out.println(redteam.toString());
  63. }else{
  64.  
  65. if(args[0].equalsIgnoreCase("blue")) {
  66. System.out.println(blueteam.toString());
  67. }
  68. }
  69.  
  70. }
  71. }
  72. return false;
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement