short circuit if 10k blocks have already been counted

This commit is contained in:
IThundxr 2024-11-03 18:50:08 -05:00
parent b179ffba5e
commit 027f3a55bb
Failed to generate hash of commit

View file

@ -284,6 +284,9 @@ public class FluidDrainingBehaviour extends FluidManipulationBehaviour {
for (BlockPos pos : visited) {
if (getWorld().getFluidState(pos).isSource())
sourceBlocks++;
if (sourceBlocks > maxBlocks)
return;
}
if (sourceBlocks > maxBlocks && canDrainInfinitely(fluid) && !queue.isEmpty()) {