Scale hose pulley timer with server's infinite block threshold (#1752)

Thanks for the detailed writeup!
This commit is contained in:
HebaruSan 2021-06-14 17:02:47 -05:00 committed by GitHub
parent ec2a66357f
commit 18af709c9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,6 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour {
List<BlockPosEntry> frontier;
Set<BlockPos> 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() {