Blocking the flow of fluids once and for all!

This seems easy but it unravels into a tricky one…

Here is what I need: Chunk claiming system, specifically a way to stop block updates(in this case Liquids) from transferring between Chunks that represent different territories.

Here is what I’ve tried: Everything with pure forge, allegedly not even possible. For SpongeForge I tried everything around ChangeBlockEvent.Place event, lead by some suggestions on this forum, very old mind you, so they had to be reworked(BlockSnapshot → SpongeLocatableBlock)

Here is where I am: Stuck :slight_smile: , I managed to stop water from flowing to the chunk edge, but ANY chunk edge! And even then, when the water is removed, it leaves residual water blocks connected to that edge, so not really ideal.

Another thing I’ve managed (updated copy&paste code from the forum) stops water flow anywhere. But has this weird thing that based on random ticks it tries to reflow, and even worse, blocks around it behave “almost as the flow happened”… Look at the image, the Redstone breaks, but doesn’t really…

So I’m asking for help: Is there any bloody way to do this, I’m making a modded roleplay server and without this and a few other tricks it’s gonna have to be plain old stinking Spigot…(maybe Paper :P)

@Listener
public void blockChange(ChangeBlockEvent.Place e)
{
	if(e.getCause().root() instanceof SpongeLocatableBlock)
	{
		SpongeLocatableBlock b = (SpongeLocatableBlock) e.getCause().root();
		Optional<MatterProperty> matter = b.getBlockState().getProperty(MatterProperty.class);
		if(matter.isPresent() && matter.get().getValue() == Matter.LIQUID)
		{
			broadcast(b.getLocation().getBlockPosition().toString());
			e.setCancelled(true);
		}
	}		
}

20

Maybe try setting beforeModifications in the @Listener annotation: https://jd.spongepowered.org/7.1.0/org/spongepowered/api/event/Listener.html#beforeModifications--

Also try setting the order in the annotation to something very early.

If all that doesn’t work. open a new issue on the SpongeCommon/SpongeForge GitHub.

Tried, same result :confused:
EDIT:
I made an issue there, thanks for the suggestion BTW
I’m sad :frowning:

Bump.
Anybody?
:frowning: