Dynamic Lights

Dynamic Lights

15M Downloads

Lag spikes from MM_Ender.teleportTo

sfPlayer1 opened this issue ยท 3 comments

commented

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:

https://github.com/AtomicStryker/atomicstrykers-minecraft-mods/blob/1.11/InfernalMobs/src/main/java/atomicstryker/infernalmobs/common/mods/MM_Ender.java#L84

commented

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.

commented

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.

commented

b7d231a
7f027e8
e59cb98
83b24a4
aa60058
d3641fb

WHY IS THERE SO MANY VERSIONS