dogetrix Joined Feb 18, 2017 Messages 176 Jun 25, 2017 Thread Author #1 I read in the jdocs: static Player getLocal() Gets the local player, also known as your character. Then I used it and a user got NPE. Am I wrong to assume that the player will be automatically logged in before onStart is called for a LoopingBot?
I read in the jdocs: static Player getLocal() Gets the local player, also known as your character. Then I used it and a user got NPE. Am I wrong to assume that the player will be automatically logged in before onStart is called for a LoopingBot?
savior Java Warlord Joined Nov 17, 2014 Messages 4,906 Jun 25, 2017 #2 There pretty much is not a single type of game entity that is always loaded, including the local player. Just nullcheck everything you get from the game. Edit: The local player may even be null if you are logged in, just fyi.
There pretty much is not a single type of game entity that is always loaded, including the local player. Just nullcheck everything you get from the game. Edit: The local player may even be null if you are logged in, just fyi.
snufalufugus Joined Aug 23, 2015 Messages 1,970 Jun 25, 2017 #3 Any time you use the word 'get', you need to null check.
savior Java Warlord Joined Nov 17, 2014 Messages 4,906 Jun 25, 2017 #4 Snufalufugus said: Any time you use the word 'get', you need to null check. Click to expand... That's a bit extreme
Snufalufugus said: Any time you use the word 'get', you need to null check. Click to expand... That's a bit extreme
snufalufugus Joined Aug 23, 2015 Messages 1,970 Jun 25, 2017 #5 Savior said: That's a bit extreme Click to expand... Yeah, but it's a good rule of thumb.