BukkitRunnable #runTaskLater() ignores delay

Discussion in 'Plugin Development' started by ipodtouch0218, Apr 4, 2017.

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

    ipodtouch0218

  2. Offline

    ipodtouch0218

  3. Offline

    ipodtouch0218

    *bumps vigorously*
     
  4. Offline

    Side8StarLite

    @ipodtouch0218
    What have you tried so far in terms of debugging other than checking the call stack? Are you going off of what the chat says? Because it seems here
    Code:
    if (sub.equals("start")) {
                plugin.setActiveParty(partyManager);
                plugin.startActiveParty();
                sender.sendMessage(Util.msgFromConfig("partyStarted", partyManager.getName()));
                return true;
            }
    That as soon you're starting a party, you're sending a message that says party is already started, signaling the party started even though it hasn't yet. Have you tried putting a broadcastMessage inside the run method to see when the code inside is being called?
    I'm shooting in the dark right here, so please don't feel offended if I sound assuming :p....
     
  5. Offline

    ipodtouch0218

    @Side8StarLite
    Nope, it actually starts the party, not just a message in the chat.
    partyStarted is actually just a returned message for the CommandSender, and there is another message sent when the party actually starts to the whole server, which is still sent.
     
  6. Offline

    ipodtouch0218

  7. Offline

    Side8StarLite

    @ipodtouch0218 THat is such a weird bug....
    Sorry but going back to what you said...
    Are you referring to this piece of code
    Code:
    public void queueParty() {
            status = 1;
            Bukkit.broadcastMessage(Util.msgFromConfig("dropPartyStarting", null));
          
            new BukkitRunnable() {
                @Override
                public void run() {
                    startParty();
                }
            }.runTaskLater(mainInstance, 20*60);
        }
    Is it the message "dropPartyStarting"? Considering it's outside the run method, it's the only message that would appear right when the queueParty starts.....
    Have you tried putting a broadcastMessage inside the run method, and seeing when it appears?
     
  8. Offline

    ipodtouch0218

    @Side8StarLite
    Sadly, no, "dropPartyStarting" is supposed to run right as queueParty() starts, waits 60 seconds, and then runs startParty(). startParty() is still ran, which is the problem, not just messages
     
  9. Offline

    Side8StarLite

    @ipodtouch0218
    Would you mind posting your whole commandSender class and main class? I want to try recreate the error
     
    Last edited by a moderator: Apr 11, 2017
Thread Status:
Not open for further replies.

Share This Page