Event won't fire after first one

Discussion in 'Plugin Development' started by FreeMotion45, Nov 5, 2015.

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

    Scimiguy

    @mcdorli
    To be honest, it's not surprising given the code he's shown us so far.
     
  2. Offline

    mcdorli

    You are right.

    So, just for some examples, this nice "if pyramid' can be done by using the &&-s :
    Code:
    if (i > 0
         && j > 0) {
        ...;
    }
    
    And this can be done by instead of using "onefuel, twofuel, threefuel", just create an arraylist (or a simple array), and iterate trough it.
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 7, 2015
  3. Offline

    Zombie_Striker

    @FreeMotion45
    @mcdorli

    BTW, He doesn't need all those arrays, all he needs is a HashMap (that stores arrays).
     
    mcdorli likes this.
  4. Offline

    FreeMotion45

    Lets focus on this part of you quote :

    "this nice "if pyramid' can be done by using the &&"

    You know, I know some Java, it took me time to study, but I did. You thought I haven't tried that ?

    Anyways,

    About the problem.
    I did some testing and I have achieved this :

    If I am putting the first event before the second, then its vice-versa the second inventory works, but the first doesn't.

    Putting them vice-versa again, and the first inventory works but the second doesn't.
     
  5. Offline

    Zombie_Striker

    @FreeMotion45
    I already told you about this. It's because you use "return" a lot. That's why only the first "block" is the only one that is read.
     
  6. Offline

    FreeMotion45

    Its not because of the returns, I have already checked it.
     
  7. Offline

    Zombie_Striker

    @FreeMotion45
    Alright, then can you post your updated code? Can you post at what point the code gets up to before it stops working?
     
  8. Offline

    FreeMotion45

    Now I have made up all the returns again, since they are not the problem.

    Maybe I shall just make another little plugin so it will implement this listener for this event ?
    Or just do it in another class maybe ?
     
  9. Offline

    Zombie_Striker

    @FreeMotion45
    Don't make classes/other plugins that are not needed. Useless waste of memory.

    At this point, can you post your updated code so I can try to fix it?
     
  10. Offline

    FreeMotion45

    The code after I removed all of the return; or the one I have right now ?
     
  11. Offline

    Zombie_Striker

    @FreeMotion45
    Your current version. Most likely the one with the returns.
     
Thread Status:
Not open for further replies.

Share This Page