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

75 Commits

Author SHA1 Message Date
MrPowerGamerBR
67e846409b Update to Paper 1.21 2024-06-17 23:22:18 -03:00
MrPowerGamerBR
a65807bc69 Fix tests again because I'm stupid 2024-06-13 13:19:53 -03:00
MrPowerGamerBR
8252a38f3d Add some SparklyPower-specific patches, update README 2024-06-13 12:18:15 -03:00
MrPowerGamerBR
bf4c9b5b18 Allow setting the packet object in the ClientboundPacketPreDispatchEvent 2024-06-11 02:06:40 -03:00
MrPowerGamerBR
e679b13c01 A bunch of new patches that we need for SparklyPower features 2024-06-10 18:54:03 -03:00
MrPowerGamerBR
404a4945d0 Reset dirty flag when loading maps from the disk
By default, the server will start rewriting all map datas to the disk after loading it, even if the map didn't have any changes

This also slows down world saving a lot if you have a lot of maps
2024-06-05 15:29:03 -03:00
MrPowerGamerBR
0710140816 Whoops 2024-06-04 11:33:53 -03:00
MrPowerGamerBR
95cc305b33 Remove empty diff from the Blazing Simple Farm Checks patch 2024-06-04 11:30:48 -03:00
MrPowerGamerBR
ad88829cde Fix missing namespaces on the SparklyPower Legacy NBT remapper 2024-06-01 11:00:30 -03:00
MrPowerGamerBR
35a6a315fc Remap SparklyPower hacky legacy NBT tags + Branding changes 2024-06-01 01:40:34 -03:00
MrPowerGamerBR
2063f83130 Update to Paper 1.20.6 2024-05-30 20:22:23 -03:00
MrPowerGamerBR
a48bd8375e Fix build 2024-04-20 15:51:02 -03:00
MrPowerGamerBR
d8d1aade1b Whoops 2024-03-20 14:12:47 -03:00
MrPowerGamerBR
89d1082cf2 Move RedstoneWireTurbo instance to be per world instead of sharing a global instance
Fixes #12
2024-03-20 14:08:37 -03:00
MrPowerGamerBR
7a80199414 Update upstream (yay finally)
Not tested in production yet, but soon it will be
2024-02-18 15:02:29 -03:00
MrPowerGamerBR
9be5db7f52 Update Upstream (Paper) 2024-01-03 01:44:34 -03:00
MrPowerGamerBR
5889520bba Disable Nether and End portals for non-player entities
We don't need portals for them on SparklyPower

Fixes #9
2023-12-26 17:19:16 -03:00
MrPowerGamerBR
22b3025da2 Update upstream 2023-12-26 16:54:59 -03:00
MrPowerGamerBR
b305e4fcd1 Update upstream 2023-12-21 21:03:23 -03:00
MrPowerGamerBR
6989f768a7 Update to Minecraft 1.20.4 2023-12-09 15:48:30 -03:00
MrPowerGamerBR
95a2786276 Update Upstream
Yet another patch merged into Paper, yay!
2023-12-02 22:26:02 -03:00
MrPowerGamerBR
ad57a126fa Update EntityScheduler optimization patch to match Paper PR 2023-12-01 13:12:45 -03:00
MrPowerGamerBR
909dd2c1b9 Move inventory close stacktrace debug to "sparklypaper.logContainerCreationStacktraces" property 2023-11-30 13:09:48 -03:00
MrPowerGamerBR
5391e9c4bc More improvements 2023-11-28 02:23:23 -03:00
MrPowerGamerBR
07ee63724e Improve Fix TE Unload Lag Spike patch 2023-11-28 02:17:40 -03:00
MrPowerGamerBR
6e182d7d93 "this" 2023-11-26 16:49:41 -03:00
MrPowerGamerBR
6b2c63f6e1 Fix build 2023-11-26 14:30:43 -03:00
MrPowerGamerBR
b82e1078fe Split the tickBlockEntities optimization into two patches 2023-11-26 14:15:51 -03:00
MrPowerGamerBR
d8ba56e45b Update Upstream and Fix Build 2023-11-25 21:46:56 -03:00
MrPowerGamerBR
b96d6f8f38 [ci skip] Add proper explanation 2023-11-24 23:47:25 -03:00
MrPowerGamerBR
f1f43018a1 Just use get directly instead of using our hacky hack
The real reason I reverted this was because this was throwing an exception, idk why tho because tbh it doesn't make any sense
2023-11-24 23:42:45 -03:00
MrPowerGamerBR
3b27299c78 Fix our custom block entity list
Yeah, I probably should've tested it a bit further

But don't worry, its performance is still way way way WAY better than the original ArrayList used
2023-11-24 22:09:53 -03:00
MrPowerGamerBR
222bdcf9f5 Remove unused stuff 2023-11-24 20:25:57 -03:00
MrPowerGamerBR
490f8a5ec6 Improve the "tickBlockEntities" patch by replacing the block entity list with a custom list that allows us to remove multiple indexes at once
Improves tile entity removal performance A LOT, no matter if only a single tile entity is being removed or a bunch of them
2023-11-24 20:17:27 -03:00
MrPowerGamerBR
7044824d2d [ci skip] Improve canSee patch commit message 2023-11-24 11:46:36 -03:00
MrPowerGamerBR
d17719e4e3 Remove some "dubious" patches
Honestly, some of these changes felt like hopium "surely this will fix the lag issues", even tho in my mind these didn't make sense

Yeah, these methods do show up in the profiler, but does these *really* make sense? I don't think so, I think these are just useless patches that only attempt to hide the pain, instead of tackling the REAL issue that is causing these methods to show up in the profiler
2023-11-24 02:48:58 -03:00
MrPowerGamerBR
e509994f65 Change check order 2023-11-23 20:37:54 -03:00
MrPowerGamerBR
6b4c6a766f Cache the block entity's chunk coordinate key in the block entity itself
Again, this is seems like a small optimization, but it is actually useful because we avoid doing calculations for each block entity, and if your server has a lot of them, it adds up
2023-11-23 19:37:09 -03:00
MrPowerGamerBR
66cab91fc1 Cache last shouldTickBlocksAt result when ticking block entities 2023-11-23 18:26:19 -03:00
MrPowerGamerBR
b1d551395f Optimize "canSee" checks
The "canSee" checks is in a hot path, invoked by each entity for each player on the server if they are in tracking range, so optimizing it is pretty nice

First, we change the original "HashMap" to fastutil's "Object2ObjectOpenHashMap", because the containsKey throughput is better

Then, we add a "isEmpty()" check before attempting to check if the map contains something

This seems stupid, but it does seem that it improves the performance a bit, and it makes sense, "containsKey(...)" does not attempt to check the map size before attempting to check if the map contains the key

We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) and we cache the "isVisibleByDefault()" result between runs (this also seems a bit overkill because "isVisibleByDefault()" is just a method that returns a boolean, but because this is a hotpath, we need all optimizations that we can get
2023-11-23 14:52:18 -03:00
MrPowerGamerBR
5248909b6f Fix CraftState use snapshot check 2023-11-22 16:14:05 -03:00
MrPowerGamerBR
a93396ebe5 Skip dirty stats copy when requesting player stats
There's literally only one getDirty call. Because the map was only retrieved once, we don't actually need to create a copy of the map just to iterate it, we can just access it directly and clear it manually after use.
2023-11-22 14:45:25 -03:00
MrPowerGamerBR
2067615d58 Thanks Gradle
I have no idea why this wasn't working
2023-11-22 13:50:35 -03:00
MrPowerGamerBR
b4a0b43344 Add build without Parallel World Ticking 2023-11-22 11:29:10 -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
MrPowerGamerBR
3f47e18bc4 Improve EntityScheduler optimization patch even... further... beyond! 2023-11-21 23:22:17 -03:00
MrPowerGamerBR
4d91dd604d Improve EntityScheduler optimization patch 2023-11-21 21:10:07 -03:00
MrPowerGamerBR
dfe57f34c4 Spooky month optimizations
The quintessential patch that other performance forks also have for... some reason

Caches when Bat's spooky season starts and ends, and when Skeleton and Zombies halloween starts and ends

Avoids unnecessary date checks, even tho that this shouldn't really improve performance that much... unless you have a lot of mobs being spawned
2023-11-21 17:08:58 -03:00
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