EssentialsX

EssentialsX

2M Downloads

Affected is null on nick change from console.

V0mcog opened this issue ยท 3 comments

commented

This might be a problem with the API: NickChangeEvent.getAffected gives a null value when I change the nick of a player from console.
Testing code:

@eventhandler
public void nickChanged(NickChangeEvent e)
{
Log.info("fired");
if(e.getAffected() == null)
{
Log.info("r1");
return;
}

if(e.getAffected().getName() == null)
{
	Log.info("r2");
	return;
}

Log.info("success");

}

I type "/nick asd" for example, the event fires, and cancels with "r1". I was online all the time, and didn't misspell my name. Everything works fine when using the command in-game.

commented

Is this related to #3043 by chance?

commented

Hmm, probably. Just found it, didn't browse for it before posting. Sorry. :)

commented

No problem. That event has issues, but it seems like no one wants to change it until a major release. It's a minor inconvenience for now...