Update FluidFillingBehaviour.java

now properly fills infinitely
This commit is contained in:
glutzer 2022-04-24 16:31:29 -05:00
parent 343c0fab62
commit f8ef7be48d

View file

@ -72,7 +72,7 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour {
(p, d) -> infinityCheckFrontier.add(new BlockPosEntry(p, d)), true); (p, d) -> infinityCheckFrontier.add(new BlockPosEntry(p, d)), true);
int maxBlocks = maxBlocks(); int maxBlocks = maxBlocks();
if (infinityCheckVisited.size() > maxBlocks && maxBlocks != -1) { if (infinityCheckVisited.size() > maxBlocks && maxBlocks != -1 && !fillInfinite()) {
if (!infinite) { if (!infinite) {
reset(); reset();
infinite = true; infinite = true;
@ -163,9 +163,11 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour {
if (visited.size() >= maxBlocks && maxBlocks != -1) { if (visited.size() >= maxBlocks && maxBlocks != -1) {
infinite = true; infinite = true;
visited.clear(); if (!fillInfinite()) {
queue.clear(); visited.clear();
return false; queue.clear();
return false;
}
} }
SpaceType spaceType = getAtPos(world, currentPos, fluid); SpaceType spaceType = getAtPos(world, currentPos, fluid);