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

Full worldguard support #105

Open
Sean1472 opened this issue Jan 2, 2021 · 1 comment
Open

Full worldguard support #105

Sean1472 opened this issue Jan 2, 2021 · 1 comment

Comments

@Sean1472
Copy link

Sean1472 commented Jan 2, 2021

Hey, I saw the update on SpigotMC and here is a wrapper I use to support Worldguard 6 & 7 out the box.

https://github.com/CodeMC/WorldGuardWrapper

This is how I used it in my code;

private final org.codemc.worldguardwrapper.WorldGuardWrapper worldGuard = org.codemc.worldguardwrapper.WorldGuardWrapper.getInstance();


    public boolean isInRegion(final String regionId, final Location location) {
        for (IWrappedRegion region : worldGuard.getRegions(location))
            if (region.contains(location) && region.getId().equalsIgnoreCase(regionId)) return true;
        return false;
    }
@egold555
Copy link
Owner

egold555 commented Jan 3, 2021

Hey, I saw the update on SpigotMC and here is a wrapper I use to support Worldguard 6 & 7 out the box.

https://github.com/CodeMC/WorldGuardWrapper

This is how I used it in my code;

private final org.codemc.worldguardwrapper.WorldGuardWrapper worldGuard = org.codemc.worldguardwrapper.WorldGuardWrapper.getInstance();


    public boolean isInRegion(final String regionId, final Location location) {
        for (IWrappedRegion region : worldGuard.getRegions(location))
            if (region.contains(location) && region.getId().equalsIgnoreCase(regionId)) return true;
        return false;
    }

I will take a look at this, thank you so much! This might be exactly what I am looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants