mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
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)