coutdown help

Discussion in 'Plugin Development' started by Rubikscuber202, Jan 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Rubikscuber202

    Ok i made a coundown zeit= 3 and it workd but it does not well it runs slower faster the start delay of 4 seconds is not there what do i have to change

    Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("Spleef"),new Runnable(){

    @Override
    public void run() {
    if(zeit >-1){

    if(zeit != 0)
    {
    p1.sendMessage("Game starts in: "+zeit);
    p2.sendMessage("Game starts in: "+zeit);
    zeit--;
    }
    else
    {
    p1.sendMessage("Los");
    p2.sendMessage("Los");
    zeit--;
    return;
    }
    }
    }
    }, 80L, 20L);
     
  2. Offline

    fireblast709

    so... I am sorry but I did not understand the question
     
  3. Offline

    SgtStud

    Im guessing the OP is a german (zeit = time) using google translate. From what I can get out of this, the countdown isn't working properly in that it counts down too fast or too slow?
     
  4. Offline

    Rubikscuber202

    yeah right. sorry but i not really knew how i should explain it is there a way of making it work properly
     
  5. Offline

    fireblast709

  6. Offline

    Rubikscuber202

    wich code the hole class ok here is it:
    Code:
    package me.BrosBrothersLP.Spleef;
     
     
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.GameMode;
    import org.bukkit.Location;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.PlayerInventory;
    import org.bukkit.plugin.Plugin;
     
    public class Spleefspiel implements Listener{
        Location p1l,p2l;
        PlayerInventory p1i,p2i;
        Player p1,p2;
        Player pinw;
        Block a,b,c;
        World world;
        int zeit=3;
        boolean gotpoint=false;
        int punktep1=0,punktep2=0;
        Plugin plugin;
        boolean spielende=false;
       
        public Spleefspiel(Player p1u,Player p2u,Plugin plugin){
                this.plugin=plugin;
                p1=p1u;
                p2=p2u;
                reset();
                port();
                punkt0spieler1();
                punkt0spieler2();
                plugin.getServer().getPluginManager().registerEvents(this, plugin);
        }
       
        @EventHandler
        public void watertouch(PlayerMoveEvent event){
            if(event.getTo().getBlock().isLiquid()){   
                if(event.getPlayer()==p1||event.getPlayer()==p2)
                          if(event.getPlayer()==p2&&punktep1==4){
                              punktep1++;
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+p1.getName()+" gewann gegen "+p2.getName());
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+"Mit "+punktep1+" : "+punktep2);
                              reset();
                              gmback();
                              punkt5spieler1();
                              ptospawn();
                              if(plugin.getConfig().getString("memory.punktespleef.wins."+p1.getName())==null){
                                  plugin.getConfig().set("memory.punktespleef.wins."+p1.getName(), 1);
                              }
                              int wins=plugin.getConfig().getInt("memory.punktespleef.wins."+p1.getName())+1;
                              plugin.getConfig().set("memory.punktespleef.wins."+p1.getName(), wins);
                              spielende=true;
                              return;
                          }
                          if(event.getPlayer()==p1&&punktep2==4){
                              punktep2++;
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+p2.getName()+" gewann gegen "+p1.getName());
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+"Mit "+punktep2+" : "+punktep1);
                              reset();
                              gmback();
                              punkt5spieler2();
                              ptospawn();
                              if(plugin.getConfig().getString("memory.punktespleef.wins."+p2.getName())==null){
                                  plugin.getConfig().set("memory.punktespleef.wins."+p2.getName(), 1);
                              }
                              int wins=plugin.getConfig().getInt("memory.punktespleef.wins."+p2.getName())+1;
                              plugin.getConfig().set("memory.punktespleef.wins."+p2.getName(), wins);
                              spielende=true;
                              return;
                          }
                          if(event.getPlayer()==p1){         
                              reset();
                              port();   
                              punktep2++;
                              p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              gotpoint=true;   
                          }
                          if(event.getPlayer()==p2){
                              reset();
                              port();
                              punktep1++;
                              p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              gotpoint=true;
                          }
                          if(punktep1==1){
                              punkt1spieler1();
                          }
                          if(punktep1==2){
                              punkt2spieler1();
                          }
                          if(punktep1==3){
                              punkt3spieler1();
                          }
                          if(punktep1==4){
                              punkt4spieler1();
                          }
                          if(punktep2==1){
                              punkt1spieler2();
                          }
                          if(punktep2==2){
                              punkt2spieler2();
                          }
                          if(punktep2==3){
                              punkt3spieler2();
                          }
                          if(punktep2==4){
                              punkt4spieler2();
                          }           
            }
        }
        public void reset(){
            world=Bukkit.getWorld("world");
            double xi=-1009;
            double yi=66;
            double zi=-1062;
            for(double x=xi;x<=-989;)
            {
                for(double z=zi;z<=-1029;)
                {
                    Block b=world.getBlockAt((int)x,(int)yi,(int)z);
                    b.setTypeId(80);
                    z++;
                }
                x++;
            }
           
        }
        public void port(){
            zeit=3;
            world=Bukkit.getWorld("world");
            p1l=p1.getLocation();
            p1l.setX(-998.5);
            p1l.setY(67);
            p1l.setZ(-1057.5);
            p1l.setYaw(0);
            p1l.setPitch(0);
            p1.teleport(p1l);
            p1.getInventory().setItemInHand(new ItemStack(277,1));
            p1.setGameMode(GameMode.SURVIVAL);
            p2l=p2.getLocation();
            p2l.setX(-998.5);
            p2l.setY(67);
            p2l.setZ(-1032.5);
            p2l.setYaw(180);
            p2l.setPitch(0);
            p2.teleport(p2l);
            p2.getInventory().setItemInHand(new ItemStack(277,1));
            p2.setGameMode(GameMode.SURVIVAL);
            b=p1l.getBlock();
            glasskasten();
            b=p2l.getBlock();
            glasskasten();   
           
            Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("Spleef"),new Runnable(){
     
                @Override
                public void run() {
                    if(zeit >-1){
                       
                        if(zeit != 0)
                        {
                            p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Game starts in: "+zeit);
                            p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Game starts in: "+zeit);
                            zeit--;
                        }
                        else
                        {
                        p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Los");
                        p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Los");
                        zeit--;
                        b=p1l.getBlock();
                        glassweg();
                        b=p2l.getBlock();
                        glassweg();   
                        return;
                        }
                    }
                    return;
                }       
            }, 80L, 20L);   
        }
    }
     
    
     
  7. Offline

    fireblast709

    any errors?
     
  8. Offline

    Rubikscuber202

    no there is no error i cleaned it up a bit it was a bit longer
    is there a better way for an countdown than this or is it the best?
     
  9. Offline

    fireblast709

    Well except that you do not cancel the scheduler, it looks fine
     
  10. Offline

    Rubikscuber202

    what mean cancel do i need to cancel it
     
  11. Offline

    fireblast709

    Well otherwise you would be wasting resources
     
  12. Offline

    Rubikscuber202

    ok but lets go back to the main question is there a way to create an good working and regular running countdown
     
  13. Offline

    fireblast709

    its not that hard to create a countdown
    Code:java
    1. new BukkitRunnable()
    2. {
    3. int count = 60;
    4. @Override
    5. public void run()
    6. {
    7. if(count > 0)
    8. {
    9. Bukkit.broadcastMessage(count + "second(s) left");
    10. count--;
    11. }
    12. else
    13. {
    14. Bukkit.broadcastMessage("START!");
    15. // Do stuff here
    16. cancel();
    17. }
    18. }
    19. }.runTaskTimer(<plugin instance>, 0L, 20L);
     
    StormCoreFilms likes this.
  14. Offline

    Rubikscuber202

    ok i changed it but still it acts exactly the same way.
    Have you got any idea how i can solve it here is the class maybe you understand it

    Code:
    package me.BrosBrothersLP.Spleef;
     
     
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.GameMode;
    import org.bukkit.Location;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.PlayerInventory;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.scheduler.BukkitRunnable;
     
    public class Spleefspiel implements Listener{
        Location p1l,p2l;
        PlayerInventory p1i,p2i;
        Player p1,p2;
        Player pinw;
        Block a,b,c;
        World world;
        int zeit=3;
        boolean gotpoint=false;
        int punktep1=0,punktep2=0;
        Plugin plugin;
        boolean spielende=false;
        public Spleefspiel(Player p1u,Player p2u,Plugin plugin){
                this.plugin=plugin;
                p1=p1u;
                p2=p2u;
                reset();
                port();
                punkt0spieler1();
                punkt0spieler2();
                plugin.getServer().getPluginManager().registerEvents(this, plugin);
        }
       
        @EventHandler
        public void watertouch(PlayerMoveEvent event){
            if(event.getTo().getBlock().isLiquid()){   
                if(event.getPlayer()==p1||event.getPlayer()==p2)
                          if(event.getPlayer()==p2&&punktep1==4){
                              punktep1++;
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+p1.getName()+" gewann gegen "+p2.getName());
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+"Mit "+punktep1+" : "+punktep2);
                              reset();
                              gmback();
                              punkt5spieler1();
                              ptospawn();
                              if(plugin.getConfig().getString("memory.punktespleef.wins."+p1.getName())==null){
                                  plugin.getConfig().set("memory.punktespleef.wins."+p1.getName(), 1);
                              }
                              int wins=plugin.getConfig().getInt("memory.punktespleef.wins."+p1.getName())+1;
                              plugin.getConfig().set("memory.punktespleef.wins."+p1.getName(), wins);
                              spielende=true;
                              return;
                          }
                          if(event.getPlayer()==p1&&punktep2==4){
                              punktep2++;
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+p2.getName()+" gewann gegen "+p1.getName());
                              Bukkit.broadcastMessage(ChatColor.GREEN+"[Spleef] "+"Mit "+punktep2+" : "+punktep1);
                              reset();
                              gmback();
                              punkt5spieler2();
                              ptospawn();
                              if(plugin.getConfig().getString("memory.punktespleef.wins."+p2.getName())==null){
                                  plugin.getConfig().set("memory.punktespleef.wins."+p2.getName(), 1);
                              }
                              int wins=plugin.getConfig().getInt("memory.punktespleef.wins."+p2.getName())+1;
                              plugin.getConfig().set("memory.punktespleef.wins."+p2.getName(), wins);
                              spielende=true;
                              return;
                          }
                          if(event.getPlayer()==p1){         
                              reset();
                              port();   
                              punktep2++;
                              p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              gotpoint=true;   
                          }
                          if(event.getPlayer()==p2){
                              reset();
                              port();
                              punktep1++;
                              p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Es steht "+p1.getName()+":"+punktep1+"  "+p2.getName()+":"+punktep2);
                              gotpoint=true;
                          }
                          if(punktep1==1){
                              punkt1spieler1();
                          }
                          if(punktep1==2){
                              punkt2spieler1();
                          }
                          if(punktep1==3){
                              punkt3spieler1();
                          }
                          if(punktep1==4){
                              punkt4spieler1();
                          }
                          if(punktep2==1){
                              punkt1spieler2();
                          }
                          if(punktep2==2){
                              punkt2spieler2();
                          }
                          if(punktep2==3){
                              punkt3spieler2();
                          }
                          if(punktep2==4){
                              punkt4spieler2();
                          }           
            }
        }
        public void reset(){
            world=Bukkit.getWorld("world");
            double xi=-1009;
            double yi=66;
            double zi=-1062;
            for(double x=xi;x<=-989;)
            {
                for(double z=zi;z<=-1029;)
                {
                    Block b=world.getBlockAt((int)x,(int)yi,(int)z);
                    b.setTypeId(80);
                    z++;
                }
                x++;
            }
           
        }
        public void port(){
            zeit=3;
            world=Bukkit.getWorld("world");
            p1l=p1.getLocation();
            p1l.setX(-998.5);
            p1l.setY(67);
            p1l.setZ(-1057.5);
            p1l.setYaw(0);
            p1l.setPitch(0);
            p1.teleport(p1l);
            p1.getInventory().setItemInHand(new ItemStack(277,1));
            p1.setGameMode(GameMode.SURVIVAL);
            p2l=p2.getLocation();
            p2l.setX(-998.5);
            p2l.setY(67);
            p2l.setZ(-1032.5);
            p2l.setYaw(180);
            p2l.setPitch(0);
            p2.teleport(p2l);
            p2.getInventory().setItemInHand(new ItemStack(277,1));
            p2.setGameMode(GameMode.SURVIVAL);
            b=p1l.getBlock();
            glasskasten();
            b=p2l.getBlock();
            glasskasten();   
            new BukkitRunnable()
            {
     
                @Override
                public void run() {
                    if(zeit>0){
                        p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Game starts in: "+zeit);
                        p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Game starts in: "+zeit);
                        zeit--;
                    }
                    else{
                        p1.sendMessage(ChatColor.GREEN+"[Spleef] "+"Los");
                        p2.sendMessage(ChatColor.GREEN+"[Spleef] "+"Los");
                        b=p1l.getBlock();
                        glassweg();
                        b=p2l.getBlock();
                        glassweg();
                        cancel();
                    }
                }
               
            }.runTaskTimer(plugin, 80L, 20L);
        }
        public void glasskasten()
        {
            int xi,yi,zi;
            xi=b.getLocation().getBlockX()-1;
            yi=b.getLocation().getBlockY();
            zi=b.getLocation().getBlockZ()-1;
            for(int x=xi;x<=b.getLocation().getBlockX()+1;){
                for(int y=yi;y<=b.getLocation().getBlockY()+2;){
                    for(int z=zi;z<=b.getLocation().getBlockZ()+1;){
                        Block glass=world.getBlockAt(x,y,z);
                        glass.setTypeId(20);
                        z++;
                    }
                    y++;
                }
                x++;
            }
            Block luft;
            xi=b.getLocation().getBlockX();
            yi=b.getLocation().getBlockY();
            zi=b.getLocation().getBlockZ();
            luft=world.getBlockAt(xi,yi,zi);
            luft.setTypeId(0);
            yi=b.getLocation().getBlockY()+1;
            luft=world.getBlockAt(xi,yi,zi);
            luft.setTypeId(0);
           
        }
        public void glassweg(){
            int xi,yi,zi;
            xi=b.getLocation().getBlockX()-1;
            yi=b.getLocation().getBlockY();
            zi=b.getLocation().getBlockZ()-1;
            for(int x=xi;x<=b.getLocation().getBlockX()+1;){
                for(int y=yi;y<=b.getLocation().getBlockY()+2;){
                    for(int z=zi;z<=b.getLocation().getBlockZ()+1;){
                        Block glass=world.getBlockAt(x,y,z);
                        glass.setTypeId(0);
                        z++;
                    }
                    y++;
                }
                x++;
            }
        }
        private void gmback(){
            if(p1.isOp())
                p1.setGameMode(GameMode.CREATIVE);
            if(p2.isOp())
                p2.setGameMode(GameMode.CREATIVE);
        }
        private void ptospawn(){
            p1l=p1.getLocation();
            p1l.setX(-998.5);
            p1l.setY(72);
            p1l.setZ(-1070.5);
            p1.teleport(p1l);
            p2l=p2.getLocation();
            p2l.setX(-998.5);
            p2l.setY(72);
            p2l.setZ(-1070.5);
            p2.teleport(p2l);
        }
        private void punkt1spieler1(){
            Block blocks[]=new Block[10];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+1,z+4);
            blocks[3]=world.getBlockAt(x,y+2,z+3);
            blocks[4]=world.getBlockAt(x,y+3,z+3);
            blocks[5]=world.getBlockAt(x,y+4,z+3);
            blocks[6]=world.getBlockAt(x,y+5,z+3);
            blocks[7]=world.getBlockAt(x,y+6,z+3);
            blocks[8]=world.getBlockAt(x,y+7,z+3);
            blocks[9]=world.getBlockAt(x,y+7,z+2);
            for(int i=0;i<=9;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt0spieler1(){
            Block blocks[]=new Block[14];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+2,z+1);
            blocks[3]=world.getBlockAt(x,y+2,z+4);
            blocks[4]=world.getBlockAt(x,y+3,z+1);
            blocks[5]=world.getBlockAt(x,y+3,z+4);
            blocks[6]=world.getBlockAt(x,y+4,z+1);
            blocks[7]=world.getBlockAt(x,y+4,z+4);
            blocks[8]=world.getBlockAt(x,y+5,z+1);
            blocks[9]=world.getBlockAt(x,y+5,z+4);
            blocks[10]=world.getBlockAt(x,y+6,z+1);
            blocks[11]=world.getBlockAt(x,y+6,z+4);
            blocks[12]=world.getBlockAt(x,y+7,z+2);
            blocks[13]=world.getBlockAt(x,y+7,z+3);
            for(int i=0;i<=13;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt2spieler1(){
            Block blocks[]=new Block[13];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+1);
            blocks[1]=world.getBlockAt(x,y+1,z+2);
            blocks[2]=world.getBlockAt(x,y+1,z+3);
            blocks[3]=world.getBlockAt(x,y+1,z+4);
            blocks[4]=world.getBlockAt(x,y+2,z+1);
            blocks[5]=world.getBlockAt(x,y+3,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+5,z+1);
            blocks[9]=world.getBlockAt(x,y+6,z+4);
            blocks[10]=world.getBlockAt(x,y+6,z+1);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            blocks[12]=world.getBlockAt(x,y+7,z+2);
            for(int i=0;i<=12;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt3spieler1(){
            Block blocks[]=new Block[12];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+1);
            blocks[1]=world.getBlockAt(x,y+1,z+2);
            blocks[2]=world.getBlockAt(x,y+1,z+3);
            blocks[3]=world.getBlockAt(x,y+2,z+4);
            blocks[4]=world.getBlockAt(x,y+3,z+4);
            blocks[5]=world.getBlockAt(x,y+4,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+6,z+4);
            blocks[9]=world.getBlockAt(x,y+7,z+1);
            blocks[10]=world.getBlockAt(x,y+7,z+2);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            for(int i=0;i<=11;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt4spieler1(){
            Block blocks[]=new Block[12];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+4);
            blocks[1]=world.getBlockAt(x,y+2,z+4);
            blocks[2]=world.getBlockAt(x,y+3,z+4);
            blocks[3]=world.getBlockAt(x,y+4,z+2);
            blocks[4]=world.getBlockAt(x,y+4,z+3);
            blocks[5]=world.getBlockAt(x,y+4,z+4);
            blocks[6]=world.getBlockAt(x,y+5,z+1);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+6,z+1);
            blocks[9]=world.getBlockAt(x,y+6,z+4);
            blocks[10]=world.getBlockAt(x,y+7,z+1);
            blocks[11]=world.getBlockAt(x,y+7,z+4);
            for(int i=0;i<=11;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt5spieler1(){
            Block blocks[]=new Block[14];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p1.x");
            y=plugin.getConfig().getInt("scoreboard.p1.y");
            z=plugin.getConfig().getInt("scoreboard.p1.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p1.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p1.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+2,z+4);
            blocks[3]=world.getBlockAt(x,y+3,z+4);
            blocks[4]=world.getBlockAt(x,y+4,z+1);
            blocks[5]=world.getBlockAt(x,y+4,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+1);
            blocks[8]=world.getBlockAt(x,y+6,z+1);
            blocks[9]=world.getBlockAt(x,y+7,z+1);
            blocks[10]=world.getBlockAt(x,y+7,z+2);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            blocks[12]=world.getBlockAt(x,y+7,z+4);
            blocks[13]=world.getBlockAt(x,y+1,z+1);
            for(int i=0;i<=13;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt1spieler2(){
            Block blocks[]=new Block[10];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+1,z+4);
            blocks[3]=world.getBlockAt(x,y+2,z+3);
            blocks[4]=world.getBlockAt(x,y+3,z+3);
            blocks[5]=world.getBlockAt(x,y+4,z+3);
            blocks[6]=world.getBlockAt(x,y+5,z+3);
            blocks[7]=world.getBlockAt(x,y+6,z+3);
            blocks[8]=world.getBlockAt(x,y+7,z+3);
            blocks[9]=world.getBlockAt(x,y+7,z+2);
            for(int i=0;i<=9;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt0spieler2(){
            Block blocks[]=new Block[14];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+2,z+1);
            blocks[3]=world.getBlockAt(x,y+2,z+4);
            blocks[4]=world.getBlockAt(x,y+3,z+1);
            blocks[5]=world.getBlockAt(x,y+3,z+4);
            blocks[6]=world.getBlockAt(x,y+4,z+1);
            blocks[7]=world.getBlockAt(x,y+4,z+4);
            blocks[8]=world.getBlockAt(x,y+5,z+1);
            blocks[9]=world.getBlockAt(x,y+5,z+4);
            blocks[10]=world.getBlockAt(x,y+6,z+1);
            blocks[11]=world.getBlockAt(x,y+6,z+4);
            blocks[12]=world.getBlockAt(x,y+7,z+2);
            blocks[13]=world.getBlockAt(x,y+7,z+3);
            for(int i=0;i<=13;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt2spieler2(){
            Block blocks[]=new Block[13];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+1);
            blocks[1]=world.getBlockAt(x,y+1,z+2);
            blocks[2]=world.getBlockAt(x,y+1,z+3);
            blocks[3]=world.getBlockAt(x,y+1,z+4);
            blocks[4]=world.getBlockAt(x,y+2,z+1);
            blocks[5]=world.getBlockAt(x,y+3,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+5,z+1);
            blocks[9]=world.getBlockAt(x,y+6,z+4);
            blocks[10]=world.getBlockAt(x,y+6,z+1);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            blocks[12]=world.getBlockAt(x,y+7,z+2);
            for(int i=0;i<=12;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt3spieler2(){
            Block blocks[]=new Block[12];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+1);
            blocks[1]=world.getBlockAt(x,y+1,z+2);
            blocks[2]=world.getBlockAt(x,y+1,z+3);
            blocks[3]=world.getBlockAt(x,y+2,z+4);
            blocks[4]=world.getBlockAt(x,y+3,z+4);
            blocks[5]=world.getBlockAt(x,y+4,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+6,z+4);
            blocks[9]=world.getBlockAt(x,y+7,z+1);
            blocks[10]=world.getBlockAt(x,y+7,z+2);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            for(int i=0;i<=11;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt4spieler2(){
            Block blocks[]=new Block[12];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+4);
            blocks[1]=world.getBlockAt(x,y+2,z+4);
            blocks[2]=world.getBlockAt(x,y+3,z+4);
            blocks[3]=world.getBlockAt(x,y+4,z+2);
            blocks[4]=world.getBlockAt(x,y+4,z+3);
            blocks[5]=world.getBlockAt(x,y+4,z+4);
            blocks[6]=world.getBlockAt(x,y+5,z+1);
            blocks[7]=world.getBlockAt(x,y+5,z+4);
            blocks[8]=world.getBlockAt(x,y+6,z+1);
            blocks[9]=world.getBlockAt(x,y+6,z+4);
            blocks[10]=world.getBlockAt(x,y+7,z+1);
            blocks[11]=world.getBlockAt(x,y+7,z+4);
            for(int i=0;i<=11;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
        private void punkt5spieler2(){
            Block blocks[]=new Block[14];
            int x,y,z;
            World world=Bukkit.getWorld("world");
            x=plugin.getConfig().getInt("scoreboard.p2.x");
            y=plugin.getConfig().getInt("scoreboard.p2.y");
            z=plugin.getConfig().getInt("scoreboard.p2.z");
            for(int zi=plugin.getConfig().getInt("scoreboard.p2.z");zi<z+6;){
                for(int yi=plugin.getConfig().getInt("scoreboard.p2.y");yi<y+9;){
                    Block b=world.getBlockAt(x, yi, zi);
                    b.setTypeId(112);
                    yi++;
                }
                zi++;
            }
            blocks[0]=world.getBlockAt(x,y+1,z+2);
            blocks[1]=world.getBlockAt(x,y+1,z+3);
            blocks[2]=world.getBlockAt(x,y+2,z+4);
            blocks[3]=world.getBlockAt(x,y+3,z+4);
            blocks[4]=world.getBlockAt(x,y+4,z+1);
            blocks[5]=world.getBlockAt(x,y+4,z+2);
            blocks[6]=world.getBlockAt(x,y+4,z+3);
            blocks[7]=world.getBlockAt(x,y+5,z+1);
            blocks[8]=world.getBlockAt(x,y+6,z+1);
            blocks[9]=world.getBlockAt(x,y+7,z+1);
            blocks[10]=world.getBlockAt(x,y+7,z+2);
            blocks[11]=world.getBlockAt(x,y+7,z+3);
            blocks[12]=world.getBlockAt(x,y+7,z+4);
            blocks[13]=world.getBlockAt(x,y+1,z+1);
            for(int i=0;i<=13;){
                blocks[i].setTypeId(35);
                i++;
            }
        }
    }
     
    
     
  15. Offline

    fireblast709

    what does it do (what it should not do), what does it not do (what it actually should do)
     
  16. Offline

    Rubikscuber202

    it is a spleef plugin so it teleports you into an arena, resets the ground, creates a glasscage around you, counts down (but without any delay between the numbers, this only happens when the timer starts the second time) then the glass cages dissapear and you can spleef the listener reacts when you touch water and the hole thing starts again.

    so the only thing it should do is to wait a bit before the countdown start and it should wait between the numbers.
    i know that maybe the schedule runs not exact but theres a start delay of 5 seconds , but there is no delay
    its like it just ignores it
     
  17. Offline

    fireblast709

    any errors?
     
  18. Offline

    Rubikscuber202

    no the only thing i just noticed is that the countdown works perfekt the first time i call it in the constructer the Spleefspiel method. the other times i call it in the listener so maybe theres the problem but even if it is the problem i dont know how to solve it
     
Thread Status:
Not open for further replies.

Share This Page