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

Limit creeper explosion reconstruction to owned areas #267

Open
cyberfox opened this issue Sep 15, 2024 · 1 comment
Open

Limit creeper explosion reconstruction to owned areas #267

cyberfox opened this issue Sep 15, 2024 · 1 comment
Labels
feature New feature or request

Comments

@cyberfox
Copy link

I like the reconstruction capability for creeper explosions, but I want them to be normally destructive when away from the places where players own their homes.

I don't know if the answer is an object that you have in your home that marks a zone around it as 'reconstructable', or using the existing region system, but it would be a really nice feature.

I haven't spent any time looking into the implementation, to see how hard this is yet.

@oddlama
Copy link
Owner

oddlama commented Sep 18, 2024

I agree this would be a nice feature.

Regarding implementation: If you want a setting per region-group, it's going to be quite some work. If you are fine with a global toggle then it's relatively simple and you can mostly copy existing code. Similar to the portals <-> regions integration, the admin module would need a callback like this one in portals, but slightly adjusted so it can check whether a coordinate is in a region.

// Lightweight callbacks to the regions module, if it is installed.
// Lifting the callback storage into the portals module saves us
// from having to ship regions api with this module.
private Function2<Portal, Portal, Boolean> is_in_same_region_group_callback = null;
public void set_is_in_same_region_group_callback(final Function2<Portal, Portal, Boolean> callback) {
is_in_same_region_group_callback = callback;
}

In the initialization of vane-regions, it will provide that callback to vane-admin if necessary (we want regions to softdepend on admin not the other way around). That can also be mostly copied from the RegionPortalIntegration.java as a new RegionAdminIntegration.java.

Then a single config needs to be added to vane-admin like only_in_regions which determines where the creeper rebuild applies. And in the explosion events just remove all blocks that are not in a region if that toggle is set.

@oddlama oddlama added the feature New feature or request label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants