Advertisement
thegarfish

Untitled

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