Deadrik/TFCraft — pull request #573 by ProgrammerHero (2014-08-01 23:02:58+00:00)
Title: [0.79] Removing unnecessary tick handlers and simplifying others

There are a couple of tick handlers that are covering more ground than they need to. This will lead to some unneeded calculations every tick that can be eliminated. This is a small optimization, nothing more - its that little piece of me that craves high performance computing by removing wasted cpu cycles.

1 There was an empty ServerTickEvent handler listening for the player tick event, is has been removed.
2 The EntityLivingHandler was processing the EntityLivingUpdate for every loaded entity and each time it was asking "instanceof Player". Instead, I changed the handler to listen for PlayerTickEvent (and renamed the class accordingly) which is the player specific version of EntityLivingUpdate. This will cause the listener to fire twice per tick per player (pre and post - post is ignored) instead of once per loaded entity. A weird side-effect is we have to register this listener on two message busses.

I have played with this for some time, and it ticked properly in all my play-testing.

You can see the difference between the two events by looking at
EntityPlayer:274 - the player's tick event
EntityLivingBase:1774 - every other entity's tick event (also fired by the player on EntityPlayer:342)