pufferfish-gg / Pufferfish

A high-performance fork of Paper designed for large servers.
GNU General Public License v3.0
561 stars 117 forks source link

"Skip cloning loot parameters" patch is useless #85

Open MrPowerGamerBR opened 11 months ago

MrPowerGamerBR commented 11 months ago

I was looking into Pufferfish's patches, and while I was looking into it, I looked at the https://github.com/pufferfish-gg/Pufferfish/blob/ver/1.20/patches/server/0031-Skip-cloning-loot-parameters.patch patch... and it feels like it is useless and is causing two unnecessary allocations.

If you look at the original patch from Airplane, it makes sense why they made that change: Vanilla used ImmutableMap.copyOf to copy the maps, but on recent versions this is useless since it doesn't do that anymore: https://github.com/TECHNOVE/Airplane/blob/ver/1.17/patches/server/0030-Skip-cloning-loot-parameters.patch

And on another note, the "Reduce entity allocations" allocate a MutableBlockPos for each created entity, but that cachedBlockPos variable is never used! Heck, not even in Airplane that variable seems to be used.

Potothingi commented 8 months ago

@kev626 Please read the issues.