9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-21 16:09:30 +00:00
Commit Graph

26 Commits

Author SHA1 Message Date
MrPowerGamerBR
96c5de6f94 Add option to change crops to go from first age to last age directly, to avoid useless block updates 2023-11-21 16:14:45 -03:00
MrPowerGamerBR
dd77d31f76 Lazily create LootContext for criterions
For each player on each tick, enter block triggers are invoked, and these create loot contexts that are promptly thrown away since the trigger doesn't pass the predicate

To avoid this, we now lazily create the LootContext if the criterion passes the predicate AND if any of the listener triggers require a loot context instance
2023-11-21 12:20:27 -03:00
MrPowerGamerBR
53c15660ff [ci skip] Bring back haha funny tagline in the patch 2023-11-21 01:08:06 -03:00
MrPowerGamerBR
4b63f11e5a Make CraftBlockEntityState's DISABLE_SNAPSHOT thread safe 2023-11-21 01:02:49 -03:00
MrPowerGamerBR
8043704bb0 Only check for farm block moisture if the crop growth event wasn't cancelled 2023-11-21 00:50:26 -03:00
MrPowerGamerBR
0d0706ff13 Blazingly Simple Farm Checks 2023-11-20 23:07:10 -03:00
MrPowerGamerBR
8bd484c287 Patch changes 2023-11-19 20:39:51 -03:00
MrPowerGamerBR
27b4f21dfc Fix Warriorrrr's item frame track rewrite patch due to server changes 2023-11-19 14:23:57 -03:00
MrPowerGamerBR
339d27f15c Replace item frame patch 2023-11-19 14:17:46 -03:00
MrPowerGamerBR
e028bd5157 Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
On each tick, Paper runs EntityScheduler's executeTick of each entity. This is a bit expensive, due to ArrayDeque's size() call because it ain't a simple "get the current queue size" function, and due to the thread checks.

To avoid the hefty ArrayDeque's size() call, we check if we *really* need to execute the executeTick, by checking if currentlyExecuting is not empty or if oneTimeDelayed is not empty.

Most entities won't have any scheduled tasks, so this is a nice performance bonus. These optimizations, however, wouldn't work in a Folia environment, but because in SparklyPaper executeTick is always executed on the main thread, it ain't an issue for us (yay).
2023-11-19 13:41:45 -03:00
MrPowerGamerBR
06a52899fa Change optimization patch because we have commented this out 2023-11-19 03:06:24 -03:00
MrPowerGamerBR
3e549c4903 New optimization patches 2023-11-18 21:32:54 -03:00
MrPowerGamerBR
4098309e79 Refactor MapItem update skip, add synchornized to CraftMapColorCache's "isCached" function 2023-11-17 19:13:56 -03:00
MrPowerGamerBR
d0b69c2306 Make the new map data skip optimization configurable per world 2023-11-17 18:30:03 -03:00
MrPowerGamerBR
eed11e38b2 Skip "MapItem#update()" if the map does not have the CraftMapRenderer present
Optimizes "image in map" maps, without requiring the map to be locked, which some old map plugins may not do

This has the disadvantage that the vanilla map data will never be updated while the CraftMapRenderer is not present, but that's not a huuuge problem for us
2023-11-17 15:02:07 -03:00
MrPowerGamerBR
5d46676859 Skip "distanceToSqr" call in "ServerEntity#sendChanges" if the delta movement hasn't changed
The "distanceToSqr" call is a bit expensive, so avoiding it is pretty nice, around ~15% calls are skipped with this check

We could also check if the x,y,z coordinates are equal, but for now, let's just keep the identity check, which also helps us since Minecraft's code does reuse the original delta movement Vec3 object
2023-11-15 23:59:00 -03:00
MrPowerGamerBR
483056c151 Add "Optimize entity coordinate key" patch from Pufferfish
"getCoordinateKey"'s "fastFloor" call is using a lot of CPU in "getPlayersInTrackRange", so let's borrow this patch from Pufferfish
2023-11-15 21:59:33 -03:00
MrPowerGamerBR
30d0833820 Fix world MSPT calculation affecting the server's global MSPT, use a single thread per world
The single thread per world is actually better because now we can profile each world separately. We still mimick the original thread pool by using a semaphore, this way we don't end up saturating all cores
2023-11-12 23:53:55 -03:00
MrPowerGamerBR
7b92cb8f66 Experimental Parallel World Ticking 2023-11-12 20:18:51 -03:00
MrPowerGamerBR
049a8e50ae Track how much MSPT each world used 2023-11-06 22:02:49 -03:00
MrPowerGamerBR
4e105d3f9f Let's start from scratch, shall we? 2023-10-31 00:53:47 -03:00
MrPowerGamerBR
c5730fafa4 Optimize heavy EntityLookup.ArrayIterable.<init>() calls on tickChunks 2023-10-28 20:18:25 -03:00
MrPowerGamerBR
5663ab9158 Update Upstream and Update Patches 2023-10-27 13:33:43 -03:00
MrPowerGamerBR
aa295c78bc Update upstream, add new cherry-picked patches from other forks 2023-10-23 01:40:30 -03:00
MrPowerGamerBR
41a9628f7f More performance optimizations and patches 2023-10-22 15:39:29 -03:00
MrPowerGamerBR
12ada64542 First commit! 🎉 2023-10-22 11:17:21 -03:00