egold555 / CorpseReborn

Port of spigot Corpses plugin that I ported to version 1.7.10-1.16.4
https://www.spigotmc.org/resources/corpsereborn.29875/
27 stars 22 forks source link

Full worldguard support #105

Open Sean1472 opened 3 years ago

Sean1472 commented 3 years ago

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 commented 3 years ago

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!