Solved Simple Hub Parkour plugin error

Discussion in 'Spigot Plugin Development' started by Mithrandir, Sep 11, 2019.

  1. (Spigot plugin - Novice unexperienced with java + spigot)

    Help with fixing my "SimpleHubParkour" plugin:
    https://github.com/MithrandirCraft/...rcraft/simplehubparkour/SimpleHubParkour.java

    I currently have an error somewhere within line 95's PlayerInteractEvent:
    https://gist.github.com/MithrandirCraft/0c0593d9acffe780a276d237a6c5eade

    The intention in line 155 is to check if the player is holding a barrier, and then check if the event was a right click, for the player to exit "parkour mode". This is part of what triggers the error.

    If you see anything else notably improvable and wish to let me know, please do.
     
  2. Make sure ev.getClickedBlock() is not null before getting the type. Objects.requireNonNull() will just throw a NPE if the object is null.
     
    • Friendly Friendly x 1