9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-23 00:49:28 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
MrPowerGamerBR
e371a3ef2a Update to 1.21.1 2024-08-19 15:58:08 -03:00
MrPowerGamerBR
8dbc519375 Cache coordinate key used for nearby players when ticking chunks
The "getChunkKey(...)" call is a bit expensive, using 0.24% of CPU time with 19k chunks loaded

So instead of paying the price on each tick, we pay the price when the chunk is loaded

Which, if you think about it, is actually better, since we tick chunks more than we load chunks
2023-11-22 11:10:54 -03:00
MrPowerGamerBR
53dcccb2a5 Cache tracking range type enum ordinal
Yes, I was shocked, flabbergasted even, when I found out that "Enum.ordinal()" was lagging here

But I guess it makes sense: It is a function that is called every tick for each entity, and it is a bit wasteful converting from enum to ordinal every time
2023-11-22 01:51:29 -03:00