Solved How to check if a region is on a CuboidSelection (WorldGuard/WorldEdit API)

Discussion in 'Spigot Plugin Development' started by Sami2EaCOS, Jul 11, 2018.

  1. Hello !

    I want to understand how to check if a region is on my cuboidSelection, cause i don't want to overwrite my region with a new one, can you help me ?

    Thanks for reply !
  2. But how to use a cuboidSelection with that ? because they use "Location"

    I need to check to all Location in my cuboidSelection with a for statement ?
  3. Make a region object out of your selection... Regions can find overlapping regions..
  4. Code (Java):

                        Map<String, ProtectedRegion> rg = rgManager.getRegions();
                        List<ProtectedRegion> otherRegions = Lists.newArrayList(rg.values());
                        if (region.getIntersectingRegions(otherRegions).size() > 0) {
                            p.sendMessage(ChatColor.RED + "Vous ne pouvez pas créer un claim sur une zone déjà protégée.");
                            return true;
    After a lot of try, i make something good, thanks to help me with some way to take ;)