Solved Skipping Iterations in BukkitRunnables?

Discussion in 'Plugin Development' started by Leviticalpixel10, Jan 11, 2017.

Thread Status:
Not open for further replies.
  1. Hi yall, I've got a BukkitRunnable that has a number and I want it to act like a for loop in some ways. So right now I have it with an int that increased each time it runs, and that int is the index for a list like this:
    Code:
    int x = 0;
    public void run(){
    //blocklist is a ArrayList that has blocks
    Block block = blocklist.get(x);
    }
    but I'm testing if the block is TNT, and if it is, I just want to move onto the next block so I have this:
    Code:
    if(block.getType() == Material.tnt) ...
    I don't know where to go from here. Ive tried just doing return; but it just cancels the runnable. I do have a null checker with the block to make sure its not null, too, and I want to do the same with that. So I just want to skip the rest of the code in the loop to make sure I don't have the tnt or null blocks
    thanks!

    edit I have realised a mistake I made so I don't need help :)
     
    Last edited: Jan 11, 2017
Thread Status:
Not open for further replies.

Share This Page