Advertisement
Guest User

Pillaressseee

a guest
Mar 31st, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 50.38 KB | None | 0 0
  1. package testing.EssemCSH.main;
  2.  
  3. import java.util.HashMap;
  4. import java.util.UUID;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.Location;
  8. import org.bukkit.Material;
  9. import org.bukkit.World;
  10. import org.bukkit.block.Block;
  11. import org.bukkit.command.Command;
  12. import org.bukkit.command.CommandSender;
  13. import org.bukkit.entity.Player;
  14. import org.bukkit.event.EventHandler;
  15. import org.bukkit.event.Listener;
  16. import org.bukkit.event.block.BlockBreakEvent;
  17. import org.bukkit.event.entity.PlayerDeathEvent;
  18. import org.bukkit.event.player.PlayerInteractEvent;
  19. import org.bukkit.event.player.PlayerJoinEvent;
  20. import org.bukkit.event.player.PlayerQuitEvent;
  21. import org.bukkit.plugin.PluginManager;
  22. import org.bukkit.plugin.java.JavaPlugin;
  23. import org.bukkit.scheduler.BukkitRunnable;
  24. import org.bukkit.scoreboard.DisplaySlot;
  25. import org.bukkit.scoreboard.Objective;
  26. import org.bukkit.scoreboard.Scoreboard;
  27. import org.bukkit.scoreboard.ScoreboardManager;
  28. import org.bukkit.scoreboard.Team;
  29.  
  30. public class Main extends JavaPlugin implements Listener {
  31.    
  32.    
  33.    
  34.    
  35.     /* THIS IS THE
  36.         onEnable() method */
  37.     @Override
  38.     public void onEnable() {
  39.         getLogger().info("§2Plugin activated properly, enjoy!");
  40.         PluginManager pm = this.getServer().getPluginManager();
  41.         pm.registerEvents(this, this);
  42.        
  43.         getConfig().options().copyDefaults(true);
  44.         saveConfig();
  45.        
  46.         queueTeamYellow.put(1, "null");
  47.         queueTeamYellow.put(2, "null");
  48.         queueTeamYellow.put(3, "null");
  49.         queueTeamYellow.put(4, "null");
  50.        
  51.         queueTeamBlue.put(1, "null");
  52.         queueTeamBlue.put(2, "null");
  53.         queueTeamBlue.put(3, "null");
  54.         queueTeamBlue.put(4, "null");
  55.  
  56.         queueTeamGreen.put(1, "null");
  57.         queueTeamGreen.put(2, "null");
  58.         queueTeamGreen.put(3, "null");
  59.         queueTeamGreen.put(4, "null");
  60.  
  61.         queueTeamRed.put(1, "null");
  62.         queueTeamRed.put(2, "null");
  63.         queueTeamRed.put(3, "null");
  64.         queueTeamRed.put(4, "null");
  65.     }
  66.    
  67.    
  68.    
  69.    
  70.     @Override
  71.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  72.        {
  73.            if (sender instanceof Player && args.length == 1)
  74.            {
  75.                Player p = (Player) sender;
  76.                if (cmd.getName().equalsIgnoreCase("game"))
  77.                {
  78.                    if (args.length != 1) {
  79.                        p.sendMessage("§4Missing arguments!");
  80.                    }
  81.                    else {
  82.                        if (args[0].equalsIgnoreCase("start")) {
  83.                             if (p.isOp() || p.hasPermission("pillars.start")) {
  84.                                 gameStarting = true;
  85.                                
  86.                                 p.sendMessage("§3Successfully started the game!");
  87.                                
  88.                                 World wSpawn = Bukkit.getServer().getWorld(getConfig().getString("spawn.world"));
  89.                                 double xSpawn = getConfig().getDouble("spawn.x");
  90.                                 double ySpawn = getConfig().getDouble("spawn.y");
  91.                                 double zSpawn = getConfig().getDouble("spawn.z");
  92.                                
  93.                                 for(Player player : Bukkit.getServer().getOnlinePlayers()) {
  94.                                     player.teleport(new Location(wSpawn, xSpawn, ySpawn, zSpawn));
  95.                                 }
  96.                             }
  97.                        }
  98.                        if (args[0].equalsIgnoreCase("stop")) {
  99.                             if (p.isOp() || p.hasPermission("pillars.stop")) {
  100.                                
  101.                                 gameRunning = false;
  102.                                 countDown = 16;
  103.                                 gameStarting = false;
  104.                                
  105.                                 p.sendMessage("§3Successfully stopped the game!");
  106.                                
  107.                                 World wSpawn = Bukkit.getServer().getWorld(getConfig().getString("spawn.world"));
  108.                                 double xSpawn = getConfig().getDouble("spawn.x");
  109.                                 double ySpawn = getConfig().getDouble("spawn.y");
  110.                                 double zSpawn = getConfig().getDouble("spawn.z");
  111.                                
  112.                                 for(Player player : Bukkit.getServer().getOnlinePlayers()) {
  113.                                     player.teleport(new Location(wSpawn, xSpawn, ySpawn, zSpawn));
  114.                                 }
  115.                            
  116.                             }
  117.                       }
  118.                    }
  119.                }
  120.                
  121.                if (cmd.getName().equalsIgnoreCase("gameset")) {
  122.                    if (p.isOp() || p.hasPermission("pillars.set")) {
  123.                        if (args[0].equalsIgnoreCase("spawn")) {
  124.                             getConfig().set("spawn.world", w);
  125.                             getConfig().set("spawn.x", x);
  126.                             getConfig().set("spawn.y", y + 2);
  127.                             getConfig().set("spawn.z", z);
  128.                             saveConfig();
  129.                                
  130.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set spawn!");
  131.                        }
  132.                        
  133.                        
  134.                        if (args[0].equalsIgnoreCase("yellowspawn")) {
  135.                             getConfig().set("yellowspawn.world", w);
  136.                             getConfig().set("yellowspawn.x", x);
  137.                             getConfig().set("yellowspawn.y", y + 2);
  138.                             getConfig().set("yellowspawn.z", z);
  139.                             saveConfig();
  140.                                
  141.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §eyellow §5spawn!");
  142.                        }
  143.                        
  144.                        if (args[0].equalsIgnoreCase("yellowbeacon1")) {
  145.                             getConfig().set("yellowbeacon1.world", w);
  146.                             getConfig().set("yellowbeacon1.x", x);
  147.                             getConfig().set("yellowbeacon1.y", y);
  148.                             getConfig().set("yellowbeacon1.z", z);
  149.                             saveConfig();
  150.                                
  151.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §eyellow §5beacon1!");
  152.                        }
  153.                        if (args[0].equalsIgnoreCase("yellowbeacon2")) {
  154.                             getConfig().set("yellowbeacon2.world", w);
  155.                             getConfig().set("yellowbeacon2.x", x);
  156.                             getConfig().set("yellowbeacon2.y", y);
  157.                             getConfig().set("yellowbeacon2.z", z);
  158.                             saveConfig();
  159.                                
  160.                             p.sendMessage(" §5Successfully set §eyellow §5beacon2!");
  161.                        }
  162.                        if (args[0].equalsIgnoreCase("yellowbeacon3")) {
  163.                             getConfig().set("yellowbeacon3.world", w);
  164.                             getConfig().set("yellowbeacon3.x", x);
  165.                             getConfig().set("yellowbeacon3.y", y);
  166.                             getConfig().set("yellowbeacon3.z", z);
  167.                             saveConfig();
  168.                                
  169.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §eyellow §5beacon3!");
  170.                        }
  171.                        if (args[0].equalsIgnoreCase("yellowbeacon4")) {
  172.                             getConfig().set("yellowbeacon4.world", w);
  173.                             getConfig().set("yellowbeacon4.x", x);
  174.                             getConfig().set("yellowbeacon4.y", y);
  175.                             getConfig().set("yellowbeacon4.z", z);
  176.                             saveConfig();
  177.                                
  178.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §eyellow §5beacon4!");
  179.                        }
  180.                        
  181.                        
  182.                        if (args[0].equalsIgnoreCase("bluespawn")) {
  183.                             getConfig().set("bluespawn.world", w);
  184.                             getConfig().set("bluespawn.x", x);
  185.                             getConfig().set("bluespawn.y", y + 2);
  186.                             getConfig().set("bluespawn.z", z);
  187.                             saveConfig();
  188.                                
  189.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §bblue §5spawn!");
  190.                        }
  191.                        if (args[0].equalsIgnoreCase("bluebeacon1")) {
  192.                             getConfig().set("bluebeacon1.world", w);
  193.                             getConfig().set("bluebeacon1.x", x);
  194.                             getConfig().set("bluebeacon1.y", y);
  195.                             getConfig().set("bluebeacon1.z", z);
  196.                             saveConfig();
  197.                                
  198.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §bblue §5beacon1!");
  199.                        }
  200.                        if (args[0].equalsIgnoreCase("bluebeacon2")) {
  201.                             getConfig().set("bluebeacon2.world", w);
  202.                             getConfig().set("bluebeacon2.x", x);
  203.                             getConfig().set("bluebeacon2.y", y);
  204.                             getConfig().set("bluebeacon2.z", z);
  205.                             saveConfig();
  206.                                
  207.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §bblue §5beacon2!");
  208.                        }
  209.                        if (args[0].equalsIgnoreCase("bluebeacon3")) {
  210.                             getConfig().set("bluebeacon3.world", w);
  211.                             getConfig().set("bluebeacon3.x", x);
  212.                             getConfig().set("bluebeacon3.y", y);
  213.                             getConfig().set("bluebeacon3.z", z);
  214.                             saveConfig();
  215.                                
  216.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §bblue §5beacon3!");
  217.                        }
  218.                        if (args[0].equalsIgnoreCase("bluebeacon4")) {
  219.                             getConfig().set("bluebeacon4.world", w);
  220.                             getConfig().set("bluebeacon4.x", x);
  221.                             getConfig().set("bluebeacon4.y", y);
  222.                             getConfig().set("bluebeacon4.z", z);
  223.                             saveConfig();
  224.                                
  225.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §bblue §5beacon4!");
  226.                        }
  227.                        
  228.                        
  229.                        if (args[0].equalsIgnoreCase("greenspawn")) {
  230.                             getConfig().set("greenspawn.world", w);
  231.                             getConfig().set("greenspawn.x", x);
  232.                             getConfig().set("greenspawn.y", y + 2);
  233.                             getConfig().set("greenspawn.z", z);
  234.                             saveConfig();
  235.                                
  236.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §agreen §5spawn!");
  237.                        }
  238.                        
  239.                        if (args[0].equalsIgnoreCase("greenbeacon1")) {
  240.                             getConfig().set("greenbeacon1.world", w);
  241.                             getConfig().set("greenbeacon1.x", x);
  242.                             getConfig().set("greenbeacon1.y", y);
  243.                             getConfig().set("greenbeacon1.z", z);
  244.                             saveConfig();
  245.                                
  246.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §agreen §5beacon1!");
  247.                        }
  248.                        if (args[0].equalsIgnoreCase("greenbeacon2")) {
  249.                             getConfig().set("greenbeacon2.world", w);
  250.                             getConfig().set("greenbeacon2.x", x);
  251.                             getConfig().set("greenbeacon2.y", y);
  252.                             getConfig().set("greenbeacon2.z", z);
  253.                             saveConfig();
  254.                                
  255.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §agreen §5beacon2!");
  256.                        }
  257.                        if (args[0].equalsIgnoreCase("greenbeacon3")) {
  258.                             getConfig().set("greenbeacon3.world", w);
  259.                             getConfig().set("greenbeacon3.x", x);
  260.                             getConfig().set("greenbeacon3.y", y);
  261.                             getConfig().set("greenbeacon3.z", z);
  262.                             saveConfig();
  263.                                
  264.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §agreen §5beacon3!");
  265.                        }
  266.                        if (args[0].equalsIgnoreCase("greenbeacon4")) {
  267.                             getConfig().set("greenbeacon4.world", w);
  268.                             getConfig().set("greenbeacon4.x", x);
  269.                             getConfig().set("greenbeacon4.y", y);
  270.                             getConfig().set("greenbeacon4.z", z);
  271.                             saveConfig();
  272.                                
  273.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §agreen §5beacon4!");
  274.                        }
  275.                        
  276.                        
  277.                        if (args[0].equalsIgnoreCase("redspawn")) {
  278.                             getConfig().set("redspawn.world", w);
  279.                             getConfig().set("redspawn.x", x);
  280.                             getConfig().set("redspawn.y", y + 2);
  281.                             getConfig().set("redspawn.z", z);
  282.                             saveConfig();
  283.                                
  284.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §cred §5spawn!");
  285.                        }
  286.                        
  287.                        if (args[0].equalsIgnoreCase("redbeacon1")) {
  288.                             getConfig().set("redbeacon1.world", w);
  289.                             getConfig().set("redbeacon1.x", x);
  290.                             getConfig().set("redbeacon1.y", y);
  291.                             getConfig().set("redbeacon1.z", z);
  292.                             saveConfig();
  293.                                
  294.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §cred §5beacon1!");
  295.                        }
  296.                        if (args[0].equalsIgnoreCase("redbeacon2")) {
  297.                             getConfig().set("redbeacon2.world", w);
  298.                             getConfig().set("redbeacon2.x", x);
  299.                             getConfig().set("redbeacon2.y", y);
  300.                             getConfig().set("redbeacon2.z", z);
  301.                             saveConfig();
  302.                                
  303.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §cred §5beacon2!");
  304.                        }
  305.                        if (args[0].equalsIgnoreCase("redbeacon3")) {
  306.                             getConfig().set("redbeacon3.world", w);
  307.                             getConfig().set("redbeacon3.x", x);
  308.                             getConfig().set("redbeacon3.y", y);
  309.                             getConfig().set("redbeacon3.z", z);
  310.                             saveConfig();
  311.                                
  312.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §cred §5beacon3!");
  313.                        }
  314.                        if (args[0].equalsIgnoreCase("redbeacon4")) {
  315.                             getConfig().set("redbeacon4.world", w);
  316.                             getConfig().set("redbeacon4.x", x);
  317.                             getConfig().set("redbeacon4.y", y);
  318.                             getConfig().set("redbeacon4.z", z);
  319.                             saveConfig();
  320.                                
  321.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §cred §5beacon4!");
  322.                        }
  323.                        
  324.                        
  325.                        if (args[0].equalsIgnoreCase("gold1")) {
  326.                             getConfig().set("gold1.world", w);
  327.                             getConfig().set("gold1.x", x);
  328.                             getConfig().set("gold1.y", y + 1);
  329.                             getConfig().set("gold1.z", z);
  330.                             saveConfig();
  331.                                
  332.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §6gold §5spawner1!");
  333.                        }
  334.                        if (args[0].equalsIgnoreCase("gold2")) {
  335.                             getConfig().set("gold2.world", w);
  336.                             getConfig().set("gold2.x", x);
  337.                             getConfig().set("gold2.y", y + 1);
  338.                             getConfig().set("gold2.z", z);
  339.                             saveConfig();
  340.                                
  341.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §6gold §5spawner2!");
  342.                        }
  343.                        if (args[0].equalsIgnoreCase("gold3")) {
  344.                             getConfig().set("gold3.world", w);
  345.                             getConfig().set("gold3.x", x);
  346.                             getConfig().set("gold3.y", y + 1);
  347.                             getConfig().set("gold3.z", z);
  348.                             saveConfig();
  349.                                
  350.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §6gold §5spawner3!");
  351.                        }
  352.                        if (args[0].equalsIgnoreCase("gold4")) {
  353.                             getConfig().set("gold4.world", w);
  354.                             getConfig().set("gold4.x", x);
  355.                             getConfig().set("gold4.y", y + 1);
  356.                             getConfig().set("gold4.z", z);
  357.                             saveConfig();
  358.                                
  359.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §6gold §5spawner4!");
  360.                        }
  361.                        
  362.                        if (args[0].equalsIgnoreCase("diamond")) {
  363.                             getConfig().set("diamond.world", w);
  364.                             getConfig().set("diamond.x", x);
  365.                             getConfig().set("diamond.y", y + 1);
  366.                             getConfig().set("diamond.z", z);
  367.                             saveConfig();
  368.                                
  369.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §1diamond §5spawner!");
  370.                        }
  371.                        
  372.                        
  373.                        if (args[0].equalsIgnoreCase("shopkeeper1")) {
  374.                             getConfig().set("shopkeeper1.world", w);
  375.                             getConfig().set("shopkeeper1.x", x);
  376.                             getConfig().set("shopkeeper1.y", y);
  377.                             getConfig().set("shopkeeper1.z", z);
  378.                             saveConfig();
  379.                                
  380.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §7shopkeeper §5location1!");
  381.                        }
  382.                        if (args[0].equalsIgnoreCase("shopkeeper2")) {
  383.                             getConfig().set("shopkeeper2.world", w);
  384.                             getConfig().set("shopkeeper2.x", x);
  385.                             getConfig().set("shopkeeper2.y", y);
  386.                             getConfig().set("shopkeeper2.z", z);
  387.                             saveConfig();
  388.                                
  389.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §7shopkeeper §5location2!");
  390.                        }
  391.                        if (args[0].equalsIgnoreCase("shopkeeper3")) {
  392.                             getConfig().set("shopkeeper3.world", w);
  393.                             getConfig().set("shopkeeper3.x", x);
  394.                             getConfig().set("shopkeeper3.y", y);
  395.                             getConfig().set("shopkeeper3.z", z);
  396.                             saveConfig();
  397.                                
  398.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §7shopkeeper §5location3!");
  399.                        }
  400.                        if (args[0].equalsIgnoreCase("shopkeeper4")) {
  401.                             getConfig().set("shopkeeper4.world", w);
  402.                             getConfig().set("shopkeeper4.x", x);
  403.                             getConfig().set("shopkeeper4.y", y);
  404.                             getConfig().set("shopkeeper4.z", z);
  405.                             saveConfig();
  406.                                
  407.                             p.sendMessage("§1§lPillars " + dot + "§7Successfully set §7shopkeeper §5location4!");
  408.                        }
  409.                    }
  410.                }
  411.            }
  412.          
  413.            return false;
  414.        }
  415.    
  416.    
  417.    
  418.     /* THESE ARE THE
  419.     VARIABLES */
  420.     boolean gameRunning = false;
  421.     boolean gameStarting = false;
  422.    
  423.     int countDown = 16;
  424.    
  425.     String w;
  426.     double x;
  427.     double y;
  428.     double z;
  429.    
  430.     public HashMap<UUID, Scoreboard> boardMap = new HashMap<UUID, Scoreboard>();
  431.     private ScoreboardManager manager = Bukkit.getScoreboardManager();
  432.     public Scoreboard scoreboard = manager.getNewScoreboard();
  433.     public Objective objective;
  434.    
  435.     public Scoreboard teams = manager.getNewScoreboard();
  436.    
  437.     Team yellow = teams.registerNewTeam("yellow");
  438.     Team blue = teams.registerNewTeam("blue");
  439.     Team green = teams.registerNewTeam("green");
  440.     Team red = teams.registerNewTeam("red");
  441.    
  442.     public HashMap<Integer, String> queueTeamYellow = new HashMap<>();
  443.     public HashMap<Integer, String> queueTeamBlue = new HashMap<>();
  444.     public HashMap<Integer, String> queueTeamGreen = new HashMap<>();
  445.     public HashMap<Integer, String> queueTeamRed = new HashMap<>();
  446.    
  447.     HashMap<UUID, String> score15 = new HashMap<>();
  448.     HashMap<UUID, String> score14 = new HashMap<>();
  449.     HashMap<UUID, String> score13 = new HashMap<>();
  450.     HashMap<UUID, String> score12 = new HashMap<>();
  451.     HashMap<UUID, String> score11 = new HashMap<>();
  452.     HashMap<UUID, String> score10 = new HashMap<>();
  453.     HashMap<UUID, String> score9 = new HashMap<>();
  454.     HashMap<UUID, String> score8 = new HashMap<>();
  455.     HashMap<UUID, String> score7 = new HashMap<>();
  456.     HashMap<UUID, String> score6 = new HashMap<>();
  457.     HashMap<UUID, String> score5 = new HashMap<>();
  458.     HashMap<UUID, String> score4 = new HashMap<>();
  459.     HashMap<UUID, String> score3 = new HashMap<>();
  460.     HashMap<UUID, String> score2 = new HashMap<>();
  461.     HashMap<UUID, String> score1 = new HashMap<>();
  462.    
  463.    
  464.    
  465.    
  466.    
  467.     /* THIS IS THE
  468.     onPlayerJoin() method */
  469.     @SuppressWarnings("deprecation")
  470.     @EventHandler
  471.     public void onPlayerJoin(PlayerJoinEvent event) {
  472.         Player p = event.getPlayer();
  473.        
  474.         World wSpawn = Bukkit.getServer().getWorld(getConfig().getString("spawn.world"));
  475.         double xSpawn = getConfig().getDouble("spawn.x");
  476.         double ySpawn = getConfig().getDouble("spawn.y");
  477.         double zSpawn = getConfig().getDouble("spawn.z");
  478.        
  479.         p.teleport(new Location(wSpawn, xSpawn, ySpawn, zSpawn));
  480.        
  481.         if (yellow.getPlayers().size() == 0) {
  482.             yellow.addPlayer(p);
  483.         }
  484.         else if (yellow.getPlayers().size() == 1) {
  485.             if (blue.getPlayers().size() == 0) {
  486.                 blue.addPlayer(p);
  487.             }
  488.             else if (blue.getPlayers().size() == 1) {
  489.                 if (green.getPlayers().size() == 0) {
  490.                     green.addPlayer(p);
  491.                 }
  492.                 else if (green.getPlayers().size() == 1) {
  493.                     if (red.getPlayers().size() == 0) {
  494.                         red.addPlayer(p);
  495.                     }
  496.                     else if (red.getPlayers().size() == 1) {
  497.                         if (yellow.getPlayers().size() == 1) {
  498.                             yellow.addPlayer(p);
  499.                         }
  500.                         else if (yellow.getPlayers().size() == 2) {
  501.                             if (blue.getPlayers().size() == 1) {
  502.                                 blue.addPlayer(p);
  503.                             }
  504.                             else if (blue.getPlayers().size() == 2) {
  505.                                 if (green.getPlayers().size() == 1) {
  506.                                     green.addPlayer(p);
  507.                                 }
  508.                                 else if (green.getPlayers().size() == 2) {
  509.                                     if (red.getPlayers().size() == 1) {
  510.                                         red.addPlayer(p);
  511.                                     }
  512.                                     else if (red.getPlayers().size() == 2) {
  513.                                         if (yellow.getPlayers().size() == 2) {
  514.                                             yellow.addPlayer(p);
  515.                                         }
  516.                                         else if (yellow.getPlayers().size() == 3) {
  517.                                             if (blue.getPlayers().size() == 2) {
  518.                                                 blue.addPlayer(p);
  519.                                             }
  520.                                             else if (blue.getPlayers().size() == 3) {
  521.                                                 if (green.getPlayers().size() == 2) {
  522.                                                     green.addPlayer(p);
  523.                                                 }
  524.                                                 else if (green.getPlayers().size() == 3) {
  525.                                                     if (red.getPlayers().size() == 2) {
  526.                                                         red.addPlayer(p);
  527.                                                     }
  528.                                                     else if (red.getPlayers().size() == 3) {
  529.                                                         if (yellow.getPlayers().size() == 3) {
  530.                                                             yellow.addPlayer(p);
  531.                                                         }
  532.                                                         else if (yellow.getPlayers().size() == 4) {
  533.                                                             if (blue.getPlayers().size() == 3) {
  534.                                                                 blue.addPlayer(p);
  535.                                                             }
  536.                                                             else if (blue.getPlayers().size() == 4) {
  537.                                                                 if (green.getPlayers().size() == 3) {
  538.                                                                     green.addPlayer(p);
  539.                                                                 }
  540.                                                                 else if (green.getPlayers().size() == 4) {
  541.                                                                     if (red.getPlayers().size() == 3) {
  542.                                                                         red.addPlayer(p);
  543.                                                                     }
  544.                                                                     else if (red.getPlayers().size() == 4) {
  545.                                                                         p.kickPlayer("§4Server Seems To Be Full...");
  546.                                                                     }
  547.                                                                 }
  548.                                                             }
  549.                                                         }
  550.                                                     }
  551.                                                 }
  552.                                             }
  553.                                         }
  554.                                     }
  555.                                 }
  556.                             }
  557.                         }
  558.                     }
  559.                 }
  560.             }
  561.         }
  562.        
  563.         for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  564.             if (player.getDisplayName() != p.getDisplayName()) {
  565.                 SetScoreBoard(player);
  566.             }
  567.         }
  568.        
  569.         new BukkitRunnable() {
  570.            
  571.             String queueWin = "null";
  572.            
  573.             @Override
  574.             public void run() {
  575.                 if (yellow.getPlayers().size() == 3) {
  576.                     queueWin = queueTeamYellow.get(1);
  577.                     SetScoreBoard(p);
  578.                     if (queueWin == p.getDisplayName()) {
  579.                         yellow.addPlayer(p);
  580.                        
  581.                     }
  582.                    
  583.                     queueTeamYellow.put(1, queueTeamYellow.get(2));
  584.                     queueTeamYellow.put(2, queueTeamYellow.get(3));
  585.                     queueTeamYellow.put(3, queueTeamYellow.get(4));
  586.                     queueTeamYellow.put(4, "null");
  587.                 }
  588.                 if (blue.getPlayers().size() == 3) {
  589.                     queueWin = queueTeamBlue.get(1);
  590.                     SetScoreBoard(p);
  591.                     if (queueWin == p.getDisplayName()) {
  592.                         blue.addPlayer(p);
  593.                        
  594.                     }
  595.                    
  596.                     queueTeamBlue.put(1, queueTeamBlue.get(2));
  597.                     queueTeamBlue.put(2, queueTeamBlue.get(3));
  598.                     queueTeamBlue.put(3, queueTeamBlue.get(4));
  599.                     queueTeamBlue.put(4, "null");
  600.                 }
  601.                 if (green.getPlayers().size() == 3) {
  602.                     queueWin = queueTeamGreen.get(1);
  603.                     SetScoreBoard(p);
  604.                     if (queueWin == p.getDisplayName()) {
  605.                         green.addPlayer(p);
  606.                        
  607.                     }
  608.                    
  609.                     queueTeamGreen.put(1, queueTeamGreen.get(2));
  610.                     queueTeamGreen.put(2, queueTeamGreen.get(3));
  611.                     queueTeamGreen.put(3, queueTeamGreen.get(4));
  612.                     queueTeamGreen.put(4, "null");
  613.                 }
  614.                 if (red.getPlayers().size() == 3) {
  615.                     queueWin = queueTeamRed.get(1);
  616.                     SetScoreBoard(p);
  617.                     if (queueWin == p.getDisplayName()) {
  618.                         red.addPlayer(p);
  619.                        
  620.                     }
  621.                    
  622.                     queueTeamRed.put(1, queueTeamRed.get(2));
  623.                     queueTeamRed.put(2, queueTeamRed.get(3));
  624.                     queueTeamRed.put(3, queueTeamRed.get(4));
  625.                     queueTeamRed.put(4, "null");
  626.                 }
  627.             }
  628.         }.runTaskTimer(this, 0, 20);
  629.        
  630.         SetScoreBoard(p);
  631.     }
  632.    
  633.    
  634.    
  635.    
  636.     public HashMap<String, Integer> kills = new HashMap<>();
  637.     public HashMap<String, Integer> beaconsdestroyed = new HashMap<>();
  638.    
  639.     public int yellowbcount = 4;
  640.     public int bluebcount = 4;
  641.     public int greenbcount = 4;
  642.     public int redbcount = 4;
  643.    
  644.     char dot = 8901;
  645.     char checkmark = 10004;
  646.     char nomark = 10060;
  647.    
  648.     /* THIS IS THE
  649.     updateScoreBoard() method */
  650.     @SuppressWarnings("deprecation")
  651.     public void updateScoreBoard(Player p) {
  652.         boardMap.put(p.getUniqueId(), scoreboard);
  653.        
  654.         scoreboard = boardMap.get(p.getUniqueId());
  655.        
  656.         if (gameRunning == false) {
  657.             score15.put(p.getUniqueId(), "§1 ");
  658.             if (gameStarting == true) {
  659.                 score14.put(p.getUniqueId(), "§6Starting: §f" + countDown);
  660.             }
  661.             else {
  662.                 score14.put(p.getUniqueId(), "§6Starting: §4Not Enough Players" );
  663.             }
  664.             score13.put(p.getUniqueId(), "§2 ");
  665.             score12.put(p.getUniqueId(), "§6Players: §f" + Bukkit.getServer().getOnlinePlayers().size() + "/16");
  666.             score11.put(p.getUniqueId(), "§3 ");
  667.             score10.put(p.getUniqueId(), "§6Teams:");
  668.             score9.put(p.getUniqueId(), "§eYellow: §f" + yellow.getPlayers().size() + "/4");
  669.             score8.put(p.getUniqueId(), "§bBlue: §f" + blue.getPlayers().size() + "/4");
  670.             score7.put(p.getUniqueId(), "§aGreen: §f" + green.getPlayers().size() + "/4");
  671.             score6.put(p.getUniqueId(), "§cRed: §f" + red.getPlayers().size() + "/4");
  672.             score5.put(p.getUniqueId(), "§4 ");
  673.             score4.put(p.getUniqueId(), "§6Map: §fOG");
  674.             score3.put(p.getUniqueId(), "§6Server: §fpillars1");
  675.             score2.put(p.getUniqueId(), "§5 ");
  676.             score1.put(p.getUniqueId(), "§7www.intelyc.com");
  677.         }
  678.         if (gameRunning == true) {
  679.             score15.put(p.getUniqueId(), "§1 ");
  680.             score14.put(p.getUniqueId(), "§6Starting: §f" + countDown);
  681.             score13.put(p.getUniqueId(), "§2 ");
  682.             score12.put(p.getUniqueId(), "§6Players: §f" + Bukkit.getServer().getOnlinePlayers().size() + "/16");
  683.             score11.put(p.getUniqueId(), "§3 ");
  684.             score10.put(p.getUniqueId(), "§6Teams:");
  685.             score9.put(p.getUniqueId(), "§eYellow: §f" + yellow.getPlayers().size() + "/4");
  686.             score8.put(p.getUniqueId(), "§bBlue: §f" + blue.getPlayers().size() + "/4");
  687.             score7.put(p.getUniqueId(), "§aGreen: §f" + green.getPlayers().size() + "/4");
  688.             score6.put(p.getUniqueId(), "§cRed: §f" + red.getPlayers().size() + "/4");
  689.             score5.put(p.getUniqueId(), "§4 ");
  690.             score4.put(p.getUniqueId(), "§6Map: §fOG");
  691.             score3.put(p.getUniqueId(), "§6Server: §fpillars1");
  692.             score2.put(p.getUniqueId(), "§5 ");
  693.             score1.put(p.getUniqueId(), "§7www.intelyc.com");
  694.         }
  695.        
  696.         objective = scoreboard.registerNewObjective("pillars", "dummy");
  697.         objective.setDisplaySlot(DisplaySlot.SIDEBAR);
  698.         objective.setDisplayName("§f§lPILLARS");
  699.        
  700.         objective.getScore(score15.get(p.getUniqueId())).setScore(15);
  701.         objective.getScore(score14.get(p.getUniqueId())).setScore(14);
  702.         objective.getScore(score13.get(p.getUniqueId())).setScore(13);
  703.         objective.getScore(score12.get(p.getUniqueId())).setScore(12);
  704.         objective.getScore(score11.get(p.getUniqueId())).setScore(11);
  705.         objective.getScore(score10.get(p.getUniqueId())).setScore(10);
  706.         objective.getScore(score9.get(p.getUniqueId())).setScore(9);
  707.         objective.getScore(score8.get(p.getUniqueId())).setScore(8);
  708.         objective.getScore(score7.get(p.getUniqueId())).setScore(7);
  709.         objective.getScore(score6.get(p.getUniqueId())).setScore(6);
  710.         objective.getScore(score5.get(p.getUniqueId())).setScore(5);
  711.         objective.getScore(score4.get(p.getUniqueId())).setScore(4);
  712.         objective.getScore(score3.get(p.getUniqueId())).setScore(3);
  713.         objective.getScore(score2.get(p.getUniqueId())).setScore(2);
  714.         objective.getScore(score1.get(p.getUniqueId())).setScore(1);
  715.        
  716.         boardMap.put(p.getUniqueId(), scoreboard);
  717.        
  718.         p.setScoreboard(boardMap.get(p.getUniqueId()));
  719.     }
  720.    
  721.    
  722.    
  723.    
  724.     /* THIS THE
  725.     resetScoreBoard(p) method*/
  726.     public void SetScoreBoard(Player p) {
  727.         scoreboard = boardMap.get(p.getUniqueId());
  728.        
  729.         scoreboard.resetScores(score15.get(p.getUniqueId()));
  730.         scoreboard.resetScores(score14.get(p.getUniqueId()));
  731.         scoreboard.resetScores(score13.get(p.getUniqueId()));
  732.         scoreboard.resetScores(score12.get(p.getUniqueId()));
  733.         scoreboard.resetScores(score11.get(p.getUniqueId()));
  734.         scoreboard.resetScores(score10.get(p.getUniqueId()));
  735.         scoreboard.resetScores(score9.get(p.getUniqueId()));
  736.         scoreboard.resetScores(score8.get(p.getUniqueId()));
  737.         scoreboard.resetScores(score7.get(p.getUniqueId()));
  738.         scoreboard.resetScores(score6.get(p.getUniqueId()));
  739.         scoreboard.resetScores(score5.get(p.getUniqueId()));
  740.         scoreboard.resetScores(score4.get(p.getUniqueId()));
  741.         scoreboard.resetScores(score3.get(p.getUniqueId()));
  742.         scoreboard.resetScores(score2.get(p.getUniqueId()));
  743.         scoreboard.resetScores(score1.get(p.getUniqueId()));
  744.        
  745.         boardMap.put(p.getUniqueId(), scoreboard);
  746.        
  747.         updateScoreBoard(p);
  748.     }
  749.    
  750.    
  751.    
  752.    
  753.     // WHEN PLAYER BREAKS BLOCK
  754.     @EventHandler
  755.     public void onBreak(BlockBreakEvent event){
  756.         Player p = event.getPlayer();
  757.         Block block = event.getBlock();
  758.        
  759.         if (p.getItemInHand().getType() == Material.WOOD_HOE) {
  760.             event.setCancelled(true);
  761.            
  762.             w = block.getLocation().getWorld().getName();
  763.             x = block.getLocation().getX() + 0.500;
  764.             y = block.getLocation().getY();
  765.             z = block.getLocation().getZ() + 0.500;
  766.            
  767.             p.sendMessage("§6Saved coordinates for block. (World:" + w + " x:" + x + "," + " y:" + y + "," + " z:" + z + ")");
  768.  
  769.         }
  770.     }
  771.    
  772.    
  773.    
  774.    
  775.     // WHEN PLAYER USE ITEM
  776.     @SuppressWarnings("deprecation")
  777.     @EventHandler
  778.     public void onPlayerUse(PlayerInteractEvent event){
  779.         Player p = event.getPlayer();
  780.        
  781.         if (gameRunning == false) {
  782.                 if(p.getItemInHand().getType() == Material.GOLD_INGOT){
  783.                     for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  784.                         if (player.getDisplayName() != p.getDisplayName()) {
  785.                             SetScoreBoard(player);
  786.                         }
  787.                     }
  788.                     SetScoreBoard(p);
  789.                     if(yellow.getPlayers().size() <= 3) {
  790.                         yellow.addPlayer(p);
  791.                         blue.removePlayer(p);
  792.                         green.removePlayer(p);
  793.                         red.removePlayer(p);
  794.                     }
  795.                     else {
  796.                         if (queueTeamYellow.get(1).equals("null")) {
  797.                             queueTeamYellow.put(1, p.getDisplayName());
  798.                             p.sendMessage("§e§lYellow §fTeam is currently full! You we're put in queue 1/1.");
  799.                         }
  800.                         else if (!queueTeamYellow.get(1).equals("null")) {
  801.                             if (queueTeamYellow.get(2).equals("null")) {
  802.                                 queueTeamYellow.put(2, p.getDisplayName());
  803.                                 p.sendMessage("§e§lYellow §fTeam is currently full! You we're put in queue 2/2.");
  804.                             }
  805.                             else if (!queueTeamYellow.get(2).equals("null")) {
  806.                                 if (queueTeamYellow.get(3).equals("null")) {
  807.                                     queueTeamYellow.put(3, p.getDisplayName());
  808.                                     p.sendMessage("§e§lYellow §fTeam is currently full! You we're put in queue 3/3.");
  809.                                 }
  810.                                 else if (!queueTeamYellow.get(3).equals("null")) {
  811.                                     if (queueTeamYellow.get(4).equals("null")) {
  812.                                         queueTeamYellow.put(4, p.getDisplayName());
  813.                                         p.sendMessage("§e§lYellow §fTeam is currently full! You we're put in queue 4/4.");
  814.                                     }
  815.                                     else if (!queueTeamYellow.get(4).equals("null")) {
  816.                                         p.sendMessage("§e§lYellow §fTeam is currently full! Queue is currently full! ._.");
  817.                                     }
  818.                                 }
  819.                             }
  820.                         }
  821.                     }
  822.                 }
  823.                 else if(p.getItemInHand().getType() == Material.DIAMOND){
  824.                     for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  825.                         if (player.getDisplayName() != p.getDisplayName()) {
  826.                             SetScoreBoard(player);
  827.                         }
  828.                     }
  829.                     SetScoreBoard(p);
  830.                     if(blue.getPlayers().size() <= 3) {
  831.                         yellow.removePlayer(p);
  832.                         blue.addPlayer(p);
  833.                         green.removePlayer(p);
  834.                         red.removePlayer(p);
  835.                     }
  836.                     else {
  837.                         if (queueTeamBlue.get(1).equals("null")) {
  838.                             queueTeamBlue.put(1, p.getDisplayName());
  839.                             p.sendMessage("§b§lBlue §fTeam is currently full! You we're put in queue 1/1.");
  840.                         }
  841.                         else if (!queueTeamBlue.get(1).equals("null")) {
  842.                             if (queueTeamBlue.get(2).equals("null")) {
  843.                                 queueTeamBlue.put(2, p.getDisplayName());
  844.                                 p.sendMessage("§b§lBlue §fTeam is currently full! You we're put in queue 2/2.");
  845.                             }
  846.                             else if (!queueTeamBlue.get(2).equals("null")) {
  847.                                 if (queueTeamBlue.get(3).equals("null")) {
  848.                                     queueTeamBlue.put(3, p.getDisplayName());
  849.                                     p.sendMessage("§b§lBlue §fTeam is currently full! You we're put in queue 3/3.");
  850.                                 }
  851.                                 else if (!queueTeamBlue.get(3).equals("null")) {
  852.                                     if (queueTeamBlue.get(4).equals("null")) {
  853.                                         queueTeamBlue.put(4, p.getDisplayName());
  854.                                         p.sendMessage("§b§lBlue §fTeam is currently full! You we're put in queue 4/4.");
  855.                                     }
  856.                                     else if (!queueTeamBlue.get(4).equals("null")) {
  857.                                         p.sendMessage("§b§lBlue §fTeam is currently full! Queue is currently full! ._.");
  858.                                     }
  859.                                 }
  860.                             }
  861.                         }  
  862.                     }
  863.                 }
  864.                 else if(p.getItemInHand().getType() == Material.EMERALD){
  865.                     for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  866.                         if (player.getDisplayName() != p.getDisplayName()) {
  867.                             SetScoreBoard(player);
  868.                         }
  869.                     }
  870.                     SetScoreBoard(p);
  871.                     if(green.getPlayers().size() <= 3) {
  872.                         yellow.removePlayer(p);
  873.                         blue.removePlayer(p);
  874.                         green.addPlayer(p);
  875.                         red.removePlayer(p);
  876.                     }
  877.                     else {
  878.                         if (queueTeamGreen.get(1).equals("null")) {
  879.                             queueTeamGreen.put(1, p.getDisplayName());
  880.                             p.sendMessage("§a§lGreen §fTeam is currently full! You we're put in queue 1/1.");
  881.                         }
  882.                         else if (!queueTeamGreen.get(1).equals("null")) {
  883.                             if (queueTeamGreen.get(2).equals("null")) {
  884.                                 queueTeamGreen.put(2, p.getDisplayName());
  885.                                 p.sendMessage("§a§lGreen §fTeam is currently full! You we're put in queue 2/2.");
  886.                             }
  887.                             else if (!queueTeamGreen.get(2).equals("null")) {
  888.                                 if (queueTeamGreen.get(3).equals("null")) {
  889.                                     queueTeamGreen.put(3, p.getDisplayName());
  890.                                     p.sendMessage("§a§lGreen §fTeam is currently full! You we're put in queue 3/3.");
  891.                                 }
  892.                                 else if (!queueTeamGreen.get(3).equals("null")) {
  893.                                     if (queueTeamGreen.get(4).equals("null")) {
  894.                                         queueTeamGreen.put(4, p.getDisplayName());
  895.                                         p.sendMessage("§a§lGreen §fTeam is currently full! You we're put in queue 4/4.");
  896.                                     }
  897.                                     else if (!queueTeamGreen.get(4).equals("null")) {
  898.                                         p.sendMessage("§a§lGreen §fTeam is currently full! Queue is currently full! ._.");
  899.                                     }
  900.                                 }
  901.                             }
  902.                         }
  903.                     }
  904.                 }
  905.                 else if(p.getItemInHand().getType() == Material.REDSTONE){
  906.                     for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  907.                         if (player.getDisplayName() != p.getDisplayName()) {
  908.                             SetScoreBoard(player);
  909.                         }
  910.                     }
  911.                     SetScoreBoard(p);
  912.                     if(red.getPlayers().size() <= 3) {
  913.                         yellow.removePlayer(p);
  914.                         blue.removePlayer(p);
  915.                         green.removePlayer(p);
  916.                         red.addPlayer(p);
  917.                     }
  918.                     else {
  919.                         if (queueTeamRed.get(1).equals("null")) {
  920.                             queueTeamRed.put(1, p.getDisplayName());
  921.                             p.sendMessage("§c§lRed §fTeam is currently full! You we're put in queue 1/1.");
  922.                         }
  923.                         else if (!queueTeamRed.get(1).equals("null")) {
  924.                             if (queueTeamRed.get(2).equals("null")) {
  925.                                 queueTeamRed.put(2, p.getDisplayName());
  926.                                 p.sendMessage("§c§lRed §fTeam is currently full! You we're put in queue 2/2.");
  927.                             }
  928.                             else if (!queueTeamRed.get(2).equals("null")) {
  929.                                 if (queueTeamRed.get(3).equals("null")) {
  930.                                     queueTeamRed.put(3, p.getDisplayName());
  931.                                     p.sendMessage("§c§lRed §fTeam is currently full! You we're put in queue 3/3.");
  932.                                 }
  933.                                 else if (!queueTeamRed.get(3).equals("null")) {
  934.                                     if (queueTeamRed.get(4).equals("null")) {
  935.                                         queueTeamRed.put(4, p.getDisplayName());
  936.                                         p.sendMessage("§c§lRed §fTeam is currently full! You we're put in queue 4/4.");
  937.                                     }
  938.                                     else if (!queueTeamRed.get(4).equals("null")) {
  939.                                         p.sendMessage("§c§lRed §fTeam is currently full! Queue is currently full! ._.");
  940.                                     }
  941.                                 }
  942.                             }
  943.                         }
  944.                     }
  945.                 }
  946.         }
  947.     }
  948.    
  949.    
  950.    
  951.    
  952.  // WHEN PLAYER DIES
  953.     public void onPlayerDeath(PlayerDeathEvent event) {
  954.         Player p = event.getEntity().getPlayer();
  955.         Player killer = event.getEntity().getKiller();
  956.        
  957.         if (killer instanceof Player) {
  958.             if (p instanceof Player) {
  959.                 int value = kills.get(killer.getDisplayName());
  960.                 kills.put(killer.getDisplayName(), value + 1);
  961.                
  962.                 SetScoreBoard(killer);
  963.             }
  964.         }
  965.     }
  966.    
  967.    
  968.    
  969.    
  970.     // WHEN PLAYER LEAVES
  971.     @SuppressWarnings("deprecation")
  972.     @EventHandler
  973.     public void onPlayerLeave(PlayerQuitEvent event) {
  974.         Player p = event.getPlayer();
  975.        
  976.         yellow.removePlayer(p);
  977.         blue.removePlayer(p);
  978.         green.removePlayer(p);
  979.         red.removePlayer(p);
  980.        
  981.         if (queueTeamYellow.get(1) == p.getDisplayName()) {
  982.             queueTeamYellow.put(1, queueTeamYellow.get(2));
  983.             queueTeamYellow.put(2, queueTeamYellow.get(3));
  984.             queueTeamYellow.put(3, queueTeamYellow.get(4));
  985.         }
  986.         if (queueTeamYellow.get(2) == p.getDisplayName()) {
  987.             queueTeamYellow.put(2, queueTeamYellow.get(3));
  988.             queueTeamYellow.put(3, queueTeamYellow.get(4));
  989.         }
  990.         if (queueTeamYellow.get(3) == p.getDisplayName()) {
  991.             queueTeamYellow.put(3, queueTeamYellow.get(4));
  992.         }
  993.         if (queueTeamYellow.get(4) == p.getDisplayName()) {
  994.             queueTeamYellow.put(4, "null");
  995.         }
  996.        
  997.         if (queueTeamBlue.get(1) == p.getDisplayName()) {
  998.             queueTeamBlue.put(1, queueTeamBlue.get(2));
  999.             queueTeamBlue.put(2, queueTeamBlue.get(3));
  1000.             queueTeamBlue.put(3, queueTeamBlue.get(4));
  1001.         }
  1002.         if (queueTeamBlue.get(2) == p.getDisplayName()) {
  1003.             queueTeamBlue.put(2, queueTeamBlue.get(3));
  1004.             queueTeamBlue.put(3, queueTeamBlue.get(4));
  1005.         }
  1006.         if (queueTeamBlue.get(3) == p.getDisplayName()) {
  1007.             queueTeamBlue.put(3, queueTeamBlue.get(4));
  1008.         }
  1009.         if (queueTeamBlue.get(4) == p.getDisplayName()) {
  1010.             queueTeamBlue.put(4, "null");
  1011.         }
  1012.        
  1013.         if (queueTeamGreen.get(1) == p.getDisplayName()) {
  1014.             queueTeamGreen.put(1, queueTeamGreen.get(2));
  1015.             queueTeamGreen.put(2, queueTeamGreen.get(3));
  1016.             queueTeamGreen.put(3, queueTeamGreen.get(4));
  1017.         }
  1018.         if (queueTeamGreen.get(2) == p.getDisplayName()) {
  1019.             queueTeamGreen.put(2, queueTeamGreen.get(3));
  1020.             queueTeamGreen.put(3, queueTeamGreen.get(4));
  1021.         }
  1022.         if (queueTeamGreen.get(3) == p.getDisplayName()) {
  1023.             queueTeamGreen.put(3, queueTeamGreen.get(4));
  1024.         }
  1025.         if (queueTeamGreen.get(4) == p.getDisplayName()) {
  1026.             queueTeamGreen.put(4, "null");
  1027.         }
  1028.        
  1029.         if (queueTeamRed.get(1) == p.getDisplayName()) {
  1030.             queueTeamRed.put(1, queueTeamRed.get(2));
  1031.             queueTeamRed.put(2, queueTeamRed.get(3));
  1032.             queueTeamRed.put(3, queueTeamRed.get(4));
  1033.         }
  1034.         if (queueTeamRed.get(2) == p.getDisplayName()) {
  1035.             queueTeamRed.put(2, queueTeamRed.get(3));
  1036.             queueTeamRed.put(3, queueTeamRed.get(4));
  1037.         }
  1038.         if (queueTeamRed.get(3) == p.getDisplayName()) {
  1039.             queueTeamRed.put(3, queueTeamRed.get(4));
  1040.         }
  1041.         if (queueTeamRed.get(4) == p.getDisplayName()) {
  1042.             queueTeamRed.put(4, "null");
  1043.         }
  1044.        
  1045.         for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  1046.             SetScoreBoard(player);
  1047.         }
  1048.     }
  1049. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement