mojira.dev

Martin Zeller

Assigned

No issues.

Reported

No issues.

Comments

Still happens on 1.12.
As md_5 pointed out, the net.minecraft.entity.item.EntityEnderPearl.onUpdate() method kills the entity if the thrower is "dead", meaning not in the world any more.
To fix this issue, I have removed said check, which makes the pearl stay, but renders it defunct if the player left the game.

In net.minecraft.entity.projectile.EntityThrowable, I have changed the meaning of throwerName to be the UUID of the player. The field is only used if the thrower is a player, anyway.
In getThrower(), I replaced the getEntityFromUuid logic, to get from player UUID instead.
In writeEntityToNBT and readEntityFromNBT, I made it default to the thrower's profile UUID if throwerName is null or empty.
Finally, I also made it put the thrower's UUIDS in throwerName in the constructor, so it should in theory always be available.

This seems to work quite well on our server, though I've only done some preliminary testing. Logging out when the pearl is loaded works fine, as well as when the pearl is in an unloaded chunk.
It also survived a server restart and the pearl was fully functional after each of these.

This is a fairly easy fix, so... this way or some other way, but can we get an official fix for this? Please?

(I decompiled MC with MCP 9.40 for MC 1.12)