jshipley / BasicFluidHopper

A Minecraft mod that adds a fluid hopper
https://modrinth.com/mod/basic-fluid-hopper/
0 stars 0 forks source link

SUGGESTION: Pull the source block of a running fluid into the hopper. #5

Open Shinchai opened 2 weeks ago

Shinchai commented 2 weeks ago

Well summed in the title.

As you mentioned, this works on infinite source generation only. To make it work in case infinite sourcing of water/lava is disabled, allow the hopper to pull in source blocks of any flowing fluid as though that source was right above the hopper. In case multiple sources converge on a hopper, give it a first-come first-serve treatment.

jshipley commented 2 weeks ago

Thanks for the suggestion!

This seems reasonable at first. Put a hopper down, and 4-8 blocks around it get drained (unless they're infinite). Place it at the bottom of a pool of finite fluids, and maybe the whole pool would be drained. Kind of like a pump, but simpler.

I'm not sure what would happen with slow flowing fluids. The hopper doesn't actually do any kind of test to see if the fluids are infinite, it just relies on source conversion for them to regenerate. I think that they're converted to source as soon as they touch, so the hopper probably wouldn't have a chance to drain adjacent source fluids before the infinite source fluid directly above it is recreated. I'd have to look into it.

If there was something like a waterfall, it would also be weird if the hopper drained a source at the top while it was sitting 60 blocks below.

I'll do some research, and decide whether and how I'd want to do this.

Shinchai commented 2 weeks ago

The only issues with this is from vanilla's own of not allowing fluid sources to move on its own, thus eventually making drained rivers have a dry split in the middle.

As for infinite sourcing, it can be disabled in a world's rules during world start, so that two sources meeting do not generate a third source.

As for the logic, it may not be necessary to add anything to the hopper itself. Instead, add logic to fluids where if the flowing fluid block can't go down, the source block moves there. If a source block is on ground and it flows on multiple directions without falling, then it seeps into the soil, hydrating it. Regarding fluid logic, I don't know if fluid sources track their resultant flows, so this could be harder than it seems.