mcMMO Combat Level

mcMMO Combat Level

32.1k Downloads

Null Error

madtomic opened this issue ยท 16 comments

commented

Using mcMMO 1.5.04-SNAPSHOT-b82 + McCombatLevel 2.0 + ItemControl 1.0

I included this for you to review as ItemControl has no issue. The Null is from McCombatLevel

ItemControl
Download: https://www.dropbox.com/s/w1uw04hj1dsjdto/ItemControl.jar?dl=0
Source: https://github.com/EcMiner/ItemControl

I get this null error from mcCombatLevel
http://pastebin.com/xZarxPxx

This error started after mcmmo 1.5.01+

commented

It's a different plugin:

me.ecminer.itemcontrol.listeners.LevelListener.onPlayerCombatLevelCha
nge

commented

Yes, we look at the source for both itemcontrol and mcmmo and it all leads to mccombatlevel.

commented

As itemcontrol uses mccombatlevel as API for the combatlevel events.
What the plugin does it do is, it limits what tools, armor and weapons a player can use based on mccombatlevel.

commented

Why does the plugin this?

commented

But the plugin shouldn't call the update method. McCombatLevel already does that.

And according to the stacktrace, the error happens in line 49 which is the access to a data collection within ItemControl.

commented

Sigh, I wished EcMiner could help. Do you think you could help me fix this? I had been through like 4 other devs and no one is able to fix this and I hate not having mccombatlevel on the server as it's my oldest plugin and everyone loves it.

commented

One more thing, the source on itemcontrol isn't updated.

UPDATE: the origins of this issue is from this line

oldLevel.put(player.getName(), plugin.getMcCombatLevel().getCombatLevel(player));
getCombatLevel returns null

And that's because McCombatLevel cache doesn't contain the player for some reason

commented

Did you reloaded the server or the plugin?

commented

Yes, I had and the error still comes up.

commented

I had, I created many fresh install for this test and the error still comes up when someone gains a combatlevel.

commented

Try a normal startup.

commented

normal startup as in?

commented

Restart

commented

I checked it. It's the fault of ItemControl. The account isn't loaded at the time it tries to add it to the collection.

commented

So, this is why it breaks after mcmmo 1.5.01, it changes when the player data is loaded.

commented

It looks like the author is inactive. I could write a pull request for the project.