BBL Flight Blocks

BBL Flight Blocks

60.2k Downloads

Lag when multiple players use flight blocks

WursoXP opened this issue ยท 2 comments

commented

I'm playing on a server with friends, and I've noticed that when the number of players * the number of flight blocks exceeds 5 (e.g., 3 players with 2 flight blocks) in the same dimension, the game starts to lag โ€” but only for the non-host players.

After reading through your code, it seems that every tick the mod checks whether all players are within the range of a flight block, and this might be the source of the lag.

If that's the case, would it be possible to optimize this check? Maybe you could use a system similar to how beacons or conduits work, where the effect is applied every 80 or 40 ticks instead of every tick.

Edit:
I modified the code to add the delay inside onPlayerTick, but the lag still occurs. I also noticed what seems to be a memory or network leak: after placing just 2 flight blocks, the ping (ms) for non-host players starts to slowly increase over time until they eventually get disconnected from the server. The host does not experience this issue.

commented

is this with the range on ?

commented

i have done some changes hoepfully it improves performace but let me know if not