Solved [1.8] UIViewController problem (BukkitGUI related)

Discussion in 'Plugin Development' started by maux, Jul 1, 2016.

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

    maux

    Hey guys! I am having a problem.

    Backstory
    I created two classes called UIViewController and UIButton in my plugin. The UIViewController class controls the GUI of the chest and the listener. It creates a GUI with a custom name and custom buttons, or items in the chest. The UIButton class is class that allows for the developer to create a button for the UIButton's host (UIViewController) with custom properties (such as a custom name, description, ability to be enchanted, etc.) and custom functions (ex: if the player clicks the button, it will send a message to the player saying "Hi"). The server can create a GUI that can be sent to the player, with the buttons inside the ViewController.

    Problem
    The problem is that when I create two or more buttons, the first registered button executes it's proper function, the second and rest don't send out anything, not even an error message.

    Attempts at trying to fix the problem
    - I tried recoding both the classes
    - I tried debug messages
    - I checked if I had registered the listeners

    Suspicions
    I think the problem might be the for-loop in the listener.

    Projects, Classes, and Functions

    [SOLVED]
     
    Last edited: Jul 1, 2016
  2. Offline

    I Al Istannen

    @maux
    Listener Line 85:
    " return;"
    What is this for? This cancels the for loop after the first iteration, no matter what happens.
     
  3. Offline

    maux

    @I Al Istannen OH MY GOSH YOU HELPED THE CAUSE.
    I cannot thank you enough! I am very very happy. Words cannot describe. THANK YOU SO MUCH.
     
  4. Offline

    I Al Istannen

    @maux
    No problem :)

    Good luck with your Gui ;)
     
    maux likes this.
Thread Status:
Not open for further replies.

Share This Page