From 18af709c9bfe38a7c288d60a068bc2367e7b689a Mon Sep 17 00:00:00 2001 From: HebaruSan Date: Mon, 14 Jun 2021 17:02:47 -0500 Subject: [PATCH] Scale hose pulley timer with server's infinite block threshold (#1752) Thanks for the detailed writeup! --- .../fluids/actors/FluidManipulationBehaviour.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java index 16e61b211..02e3182e3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidManipulationBehaviour.java @@ -53,7 +53,6 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { List frontier; Set visited; - static final int validationTimer = 160; int revalidateIn; public FluidManipulationBehaviour(SmartTileEntity te) { @@ -68,12 +67,20 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour { counterpartActed = true; } + private int validationTimer() { + int maxBlocks = maxBlocks(); + return infinite || maxBlocks < 0 + ? 160 + // Allow enough time for the server's infinite block threshold to be reached + : maxBlocks / searchedPerTick; + } + protected int setValidationTimer() { - return revalidateIn = validationTimer; + return revalidateIn = validationTimer(); } protected int setLongValidationTimer() { - return revalidateIn = validationTimer * 2; + return revalidateIn = validationTimer() * 2; } protected int maxRange() {