Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Lobby {
- public static int LobbyCounter = 120;
- public static void startLobby(){
- Bukkit.getScheduler().scheduleSyncRepeatingTask(main.getInstance(), new Runnable() {
- public void run() {
- if(main.status == GameState.LOBBY){
- if(Bukkit.getOnlinePlayers().length >= 2){
- if(LobbyCounter == 120 || LobbyCounter == 90 || LobbyCounter == 60 || LobbyCounter == 30 || LobbyCounter == 15 || LobbyCounter == 10
- || LobbyCounter == 5 || LobbyCounter == 4 || LobbyCounter == 3 || LobbyCounter == 2){
- Bukkit.broadcastMessage(main.pr+"§aDas Spiel startet in §c"+LobbyCounter+" §aSekunden.");
- }
- if(LobbyCounter == 1){
- Bukkit.broadcastMessage(main.pr+"§aDas Spiel startet in §c"+LobbyCounter+" §aSekunde.");
- }
- for(Player all : Bukkit.getOnlinePlayers()){
- all.setLevel(LobbyCounter);
- all.setExp(0);
- double b = LobbyCounter;
- }
- if(LobbyCounter == 0){
- //main.status = GameState.WARMUP;
- //Bukkit.broadcastMessage(main.pr+"§7Das Spiel hat begonnen.");
- //WarmUp.startWarmUp();
- main.status = GameState.WARMUP;
- Bukkit.broadcastMessage(main.pr+"§7Das Spiel hat begonnen.");
- WarmUp.startWarmUp();
- //Spieler Inv Clear && PlayerTP
- for(Player all : Bukkit.getOnlinePlayers()){
- all.getInventory().clear();
- all.getInventory().setHelmet(null);
- all.getInventory().setChestplate(null);
- all.getInventory().setLeggings(null);
- all.getInventory().setBoots(null);
- all.setFoodLevel(20);
- all.setHealth(20D);
- all.setLevel(0);
- all.setExp(0);
- }
- }
- LobbyCounter--;
- }else{
- for(Player all : Bukkit.getOnlinePlayers()){
- all.setLevel(LobbyCounter);
- all.setExp(0);
- }
- LobbyCounter = 120;
- }
- }
- }
- }, 0L, 20L);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement