Solved Boolean troubles

Discussion in 'Plugin Development' started by HackintoshMan, May 12, 2013.

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


    I have a method that runs when a player is on s point, it starts the timer. I need the timer to only run while the player is still on the point. So if the player is on the point, isBeingCaptured1 is true when he is off of the point, oisBeingCaptured1 is false.

    public void timer(final Player player, final int p) {
            Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
                public void run() {
                    if (plugin.captureTheFlagHandler.captureTime != -1) {
                        if (plugin.captureTheFlagHandler.captureTime != 0) {
                            if (plugin.captureTheFlagHandler.isBeingCaptured1 == true) {
                                                        + plugin.captureTheFlagHandler.captureTime
                                                        + " seconds left at point "
                                                        + p + "!");
                                if (plugin.captureTheFlagHandler.captureTime == 0) {
                                            player, p);
            }, 0L, 20L);
    This keeps running even when isBeingCaptured1 is false. WHY?
Thread Status:
Not open for further replies.

Share This Page