Isolate Posted April 19, 2014 Share Posted April 19, 2014 (edited) Edit: Going to stick with the normal way i code then. your API is silly enough as is, im not changing my whole style for it. Edited April 19, 2014 by Isolate Link to comment Share on other sites More sharing options...
PolishCivil Posted April 19, 2014 Share Posted April 19, 2014 Are you logged in? Link to comment Share on other sites More sharing options...
Isolate Posted April 19, 2014 Author Share Posted April 19, 2014 Are you logged in? Yes i am logged in Link to comment Share on other sites More sharing options...
PolishCivil Posted April 19, 2014 Share Posted April 19, 2014 Yes i am logged in add System.out.println(client.myPlayer());System.out.println(client.getPosition());System.out.println(client.getPosition().getZ()); show output But yh u can always try script.client.getPlane() Link to comment Share on other sites More sharing options...
Isolate Posted April 19, 2014 Author Share Posted April 19, 2014 (edited) add System.out.println(client.myPlayer());System.out.println(client.getPosition());System.out.println(client.getPosition().getZ()); show output But yh u can always try script.client.getPlane() i'll try that EDIT: nope error still Edited April 19, 2014 by Isolate Link to comment Share on other sites More sharing options...
Joseph Posted April 19, 2014 Share Posted April 19, 2014 i'll try that EDIT: nope error still its a null pointer exception so check to see if your player isnt null null checking it plane Link to comment Share on other sites More sharing options...
Swizzbeat Posted April 19, 2014 Share Posted April 19, 2014 You should be using an ArrayList here (while programming to the interface as well): List<ScriptTask> tasks = new ArrayList<ScriptTask>(); LinkedList orders elements sequentially, so their good when you need to add/remove things. ArrayList on the other hand has faster read access. It's not a big deal here but it's just something I noticed As for your actual question, most likely client is returning null because you don't have an instance of it. Actually, on second look that is 100% the issue because you're extending Script in your class which is giving you another instance of script besides the one that was actually initialized. You need to pass the Script instance from your main class to the separate classes you use. Link to comment Share on other sites More sharing options...
Joseph Posted April 19, 2014 Share Posted April 19, 2014 dont let onGround extend script, make a constructor for the onGround and like swizz said initialize it. Use this as an example. Link to comment Share on other sites More sharing options...
Isolate Posted April 19, 2014 Author Share Posted April 19, 2014 (edited) Going to stick with the normal way i code then. your API is silly enough as is, im not changing my whole style for it. Edited April 19, 2014 by Isolate Link to comment Share on other sites More sharing options...