ModFest / fireblanket

A mod that improves performance, fixes bugs, and adds utilities for Modfest events.
https://example.com/?no modrinth because users are mean :(
Other
10 stars 9 forks source link

reduce Create's Mechanical/Windmill/Clockwork Bearing sync frequency #15

Closed quat1024 closed 1 year ago

quat1024 commented 1 year ago

Mechanical bearing syncs are one of the top sources of network packets just because people have placed a lot of them (especially in Solar) and they send a packet every 3 ticks rain-or-shine. Over a 139-second capture with my tool i observed 11,625 create:mechanical_bearing sync packets, or 83 per second.

It's important for these to sync occasionally since it's how the angle stays accurate, but a lot of these bearings are just used for idly spinning signs or other decorative purposes where accurate collision is not very important.

This pr hacks the default interval from every 3 ticks to every 50 ticks, and if an NBT tag fbLazy exists containing a positive integer, the sync interval will be set to that, so it can be customized per-bearing if need be.

further work:

quat1024 commented 1 year ago

yeah, it's an old world type. I would make a new one but i am getting hangs when creating new singleplayer worlds :/