SpigotMC/Spigot — pull request #180 by pruby (2014-06-25 03:36:44+00:00)
Title: Organise the world's tile entities by tick period, signs don't tick

This reorganises the world's list of tile entities from being a single set to grouping them by a "tick period".

The tick period is returned by a method on the tile entity, and must be consistent for any given entity. Tile entities are only called every "tick period" ticks rather than every one. All tile entities with the same tick period are called in the same tick - doesn't space them out.

The only tile entity where behaviour should actually be changed by this patch itself is TileEntitySign, which is set to return a period of 0. Signs will not receive tile entity ticks as a result.

This could be applied to reduce the frequency with which any given tile entity ticks - furnaces, etc. Because the tick period test happens outside the individual tile entities, we don't have to spend time every tick looping through ones which won't do anything.