Solved Enum Error

Discussion in 'Plugin Development' started by Artellet, Sep 26, 2017.

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

    Artellet

    So I'm running a task which checks if a player is wearing certain armour, and I am trying to slim down my code and make it more efficient in doing this, so I tried making an Enum to check if the player is wearing said armour, however I'm running into an error.

    Error (open)

    Code:
    *snip*

    Apparently it's not initialized but since I'm unfamiliar with Enum's I don't know how I would go about doing this. I figured everything was going to run smoothly considering there's no errors.

    Here's the Enum and method I'm using to check if the player is wearing said armour:
    Clicky (open)
    Code:
    *snip*
    


    I'd appreciate any help, even if it's just a step on the way to fixing this error.
     
    Last edited: Sep 26, 2017
  2. Offline

    Caderape2

    @Artellet I dun see a problem in the enum. That might comefrom the method where you call this.
     
  3. Offline

    yPedx

    @Artellet
    Please post the whole Armour class and point out line 75.
     
  4. Offline

    Artellet

    That's not a good idea, as the class is huge, here's line 75:
    Code:
    *snip*
    That's why I pasted the boolean that I used. Since it's a task timer it just runs through every kit, so every error are just the following lines:
    Code:
    *snip*
    So on and so fourth.
     
    Last edited: Sep 26, 2017
  5. Offline

    Caderape2

    @Artellet We can't help you with just this. As i said, you have to show th whole method, including the scheduler you use
     
  6. Offline

    Artellet

    Scheduler used is just the Bukkit one. Called like this:
    Code:
    *snip*
    Code:
    *snip*
    The rest of the method is irrelevant in terms of this error, I showed you where I call my boolean, which is where my Enum's come into play, they are not referenced anywhere else in the code.

    As the error says:
    Code:
    *snip*
    My Enum is not being initialized... How would I go about initializing it when it's used in this way?

    /Solved
    Turned out I was reading the wrong error, it was printing in my console so fast I never saw it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 26, 2017
Thread Status:
Not open for further replies.

Share This Page