If is false but it should be true

Discussion in 'Plugin Development' started by ImAFlo, Jul 4, 2015.

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

    ImAFlo

    A if is false, but it should be true. I marked the line in onInteract() with a comment.
    Please help. Code: http://pastebin.com/ZRdUH4Fr
     
  2. Offline

    Zombie_Striker

    @ImAFlo
    • I don't understand what you are trying to say.
    • Posting the who class and not the specific areas that deal with your problem is not helping.
    • If something is false when it should be true, debug.
    Please debug first before you post anything, and what is the line that is causing this problem.
     
  3. Offline

    ImAFlo

    I debugged already. The if in line 158 is false, but it should be true because in the second line of my sign is standing "STONE"
     
  4. @ImAFlo
    Make it print itemline and see what it prints exactly
     
  5. Offline

    Zombie_Striker

    @ImAFlo
    Are you sure you spelled it out correctly? Are you using the caps correctly?

    Please print out what the Material.toString would be, that way you would know what the second line should be.
     
  6. Offline

    SizzlingCreeper

    Make sure you don't have any random spaces after STONE
    You can get rid of them if they are existent by saying:
    if (Material.getMaterial(itemline.trim()) != null)
     
Thread Status:
Not open for further replies.

Share This Page