Lag spikes from MM_Ender.teleportTo
sfPlayer1 opened this issue ยท 3 comments
I've observed the method in the subject spending over 17 seconds in teleportTo within a single tick. There's no recursion involved, the version is 1.10.
Looking at the code I think the following loop underflows y, it certainly doesn't handle negative y:
No it does not. Though to be fair, this would only happen if there are holes into the void in the world, as in any other case there would be movement blocking blocks atleast one layer deep at some y over 0.
I'm pretty sure i copied the vanilla Enderman teleport code at that point in time.
Don't ask me why they get below y=0 or it doesn't hit a solid block, I just don't see any other cause for the excess getMaterial calls that most certainly go to Blocks.AIR via the y bounds check. Vanilla currently checks y > 0, not y < 96.