From 027f3a55bb9e803b78f1e3a5e02bc226c0cc1e89 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sun, 3 Nov 2024 18:50:08 -0500 Subject: [PATCH] short circuit if 10k blocks have already been counted --- .../create/content/fluids/transfer/FluidDrainingBehaviour.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/fluids/transfer/FluidDrainingBehaviour.java b/src/main/java/com/simibubi/create/content/fluids/transfer/FluidDrainingBehaviour.java index bb33a8c69..406fbacf6 100644 --- a/src/main/java/com/simibubi/create/content/fluids/transfer/FluidDrainingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/fluids/transfer/FluidDrainingBehaviour.java @@ -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()) {