Variables that update inside a runnable?

Discussion in 'Plugin Development' started by sheodox, Apr 11, 2013.

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

    sheodox

    In a class I have has a runnable that has to access some variables but they aren't changing when other methods in the class change them, how do I make them update?
     
  2. Offline

    TGF

    Code pls?
     
  3. Offline

    sheodox

    Code:
    @Override
        public void run() {
            if(!playerQueue.isEmpty()){ //only check stuff if someone has an active barrier
                long t = timeQueue.element(); // grab the time we're waiting for
               
                if (t == playerQueue.element().getWorld().getTime()){
                    for(int i = 0; i < blockCountQueue.element(); i++){
                        locationOfBlocks.remove().getBlock().setType(Material.AIR);
                    }
                    blockCountQueue.remove(); //remove the fronts of all queues
                    playerQueue.remove();
                    timeQueue.remove();
                }
            }
        }
     
  4. Nothing there that would suggest something wrong, post more code, like the entire task.

    You should also debug values at certain points to be sure you're parsing them correctly.
     
    devilquak likes this.
Thread Status:
Not open for further replies.

Share This Page