Mob Grinding Utils

Mob Grinding Utils

80M Downloads

Crash: Null pointer exception in head drop event

randomhippo opened this issue ยท 9 comments

commented

The mob masher seems to have a problem handling head drops from mobs that do not have heads.

To reproduce crash, just send a lot of slimes towards a grinder 20 at a time should suffice.

crash-2017-02-16_19.58.02-server.txt

commented

Forgot to mention, I am using version 0.1.8.16.

commented

This and #23 are the same issue check here for things @JoeyJo0

I have done some testing and I'm at a loss as to this bug. The code hasn't changed for this particular feature in any of the recent releases. The results of my tests have come up inconclusive and I can't seem to replicate the crash.

http://imgur.com/a/hJbII

As you can see from the pics, I genuinely spawned in hundreds and hundreds of slimes to try and replicate what you have suggested. I will leave this issue open and investigate further.

commented

@vadis365 I did check, but I also spent some time checking some stuff and making the issue. If you look at the timestamps, you can see I made my issue exactly 10 minutes after this one.

commented

it's ok - I just wanted to consolidate the 2 issues and pinged you so you knew I was handling it here :)

commented

I did look into the code, and the error occurs when the fake player drops the fake sword.

I believe this is caused by the "infernal mobs"-mod, in this case the Sticky ability (if you hit a mob with the sticky ability, you will drop your weapon, and it seems like this also affect fake players).

One way to prevent the crash is to add the following statement entityHeadDrop event (after getting fake player, row 41 in the current version):

if(fakePlayer.getHeldItemMainhand() == null)
return;

That stops the crash, but head drop does not work correctly then.

There is also a work around (for those who do not want to compile their own version of the mod), and that is to turn off sticky in the infernal mobs config.

commented

This was my personal fix, too. (Although I didn't know it was because of sticky infernal mobs.)

Is there not a way to make the sword anti-sticky?

Maybe generate a new sword when you get disarmed?

commented

Hello,
I know exactly where in the code the crash is happening - but to be honest adding unnecessary code to the method is just making it worse. If the crash is caused by another mod's code not properly checking for instances of fake players then surely they should handle it at their end? I'm really not able to add special cases for every mod out there that interacts with players and doesn't check for fake players.
Would it be possible for this issue to be reported to the infernal mobs author? - as they may wish to change the way their 'Sticky' ability handles fake player interactions. I'm going to leave this issue open still because I'm curious as to weather any other mods are affected/ing this.
Thanks,
Me.
*Edit - recompiling my mod with code changes is not the answer as I will close issues instantly and refuse support for anything like that. I cannot support or debug code that is not official.

commented

I will report this to the infernal mobs author. As the fake player comes from forge, it should probably not be messed with in that way.
Also there is no telling how messing with the fake player affects other mods. So as I see it the bug is not in your code.

And of course you should not support unofficial code. That would be a waste of development time.

commented

Actually other grinders also use fake players. IE. draconic evolution. Fake players are used do deal with special drops from mobs that technically only drop from player kills.