Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent fluids from flowing outside the island #511

Closed
Poslovitch opened this issue Feb 2, 2019 · 3 comments
Closed

Prevent fluids from flowing outside the island #511

Poslovitch opened this issue Feb 2, 2019 · 3 comments
Assignees
Labels
Type: Enhancement Improvement or modification which is usually a new feature.
Milestone

Comments

@Poslovitch
Copy link
Member

Is your feature request related to a problem? Please describe.
Fluids flowing outside the island can result in cobblestone/stone/obsidian being formed in the area between two islands' protection ranges, thus unbreakable by neighbouring players.

Describe the solution you'd like
A WORLD_SETTING flag that'd prevent this.

Additional context
It may be a performance intensive flag, if enabled. However, I think it's better to set it to true by default.
According to some server owners, PlotSquared has this feature - we may want to have a look at it and see how they did.

@Poslovitch Poslovitch added the Type: Enhancement Improvement or modification which is usually a new feature. label Feb 2, 2019
@Poslovitch Poslovitch added this to the 1.3.0 milestone Feb 2, 2019
@Poslovitch Poslovitch self-assigned this Feb 2, 2019
@tastybento
Copy link
Member

I did this in Greenhouses: https://github.com/BentoBoxWorld/Greenhouses/blob/master/src/main/java/world/bentobox/greenhouses/listeners/GreenhouseGuard.java

You have to have really efficient way to check in or out of an island because these flows can occur continuously. Also, you may want to not check any y-coordinate flows only, just x and z differences.

@Poslovitch
Copy link
Member Author

Poslovitch commented Feb 3, 2019

Wow, it took me quite a long time to get it working, but here are the results!

It is blocked at the edge of the protected range:
image

As you can see, water can still flow vertically, even next to the protected range:
image

I'm however encountering this issue when the water source is next to the protected range: it will flow vertically, but not sideways:
image

And, for reference, a water block in the area between islands remain still - but it can flow vertically as well:
image

I won't be fixing this bug unless asked, there's no proper API to make it work correctly right now.
I will however write a unit test before committing the code.

Poslovitch added a commit that referenced this issue Feb 3, 2019
Also fixed some Javadoc in Flags, and I've also done my very first test unit!

#511
@Poslovitch
Copy link
Member Author

And done!

Writing test units is very time consuming... Hope it'll do its job and help us avoid any sneaky regression in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improvement or modification which is usually a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants