9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00
Files
Leaf/patches
Dreeam 4dc313c4e4 Simplify canHoldFluid condition logic
Cache the result of half of canHoldFluid logic, since there is a state#is in this method,
it uses map contains to do iteration to check whether a block has a specific block tag key,
which the contains iteration call is very expensive if called everytime
Also, I simplified the condition logic in the original method to be more readable.
It is actually useless since the result is cached, just makes it look better.

In the test, it can improve ~30% performance in ~1577000 times of canHoldFluid calls (~159ms -> ~111ms)
2024-11-29 17:59:02 -05:00
..