Solved How to check if WG region is __global__?

Discussion in 'Plugin Development' started by ROKLGAMES, May 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ROKLGAMES

    I've already tried checking for null because the __global__ regions isnt a region at all, but it passes through the check. Ive tried getting the name for the area but all that gets returned is nothing. I have never used the WG api before so i am very new to it, so i couldnt find anything to check for this global area. I need a check that can identify whether the region is only __global__, can anyone help me?
     
  2. Offline

    Me4502


    __global__ isn't really a region as such, it is more of a set of allowances.
     
  3. Offline

    ROKLGAMES

    Yes i know that, so how do i go about checking if a player is in __global__?
     
  4. Offline

    Me4502


    A player is always in __global__??
     
  5. Offline

    ROKLGAMES

    Yes, i see that. I mean how would i check if a player is in the area that is not defined or "Global Area"?
     
  6. Offline

    Me4502

    Just get a list of regions that player is in, and if its empty, they're not in a region.
     
  7. Offline

    ROKLGAMES

    That is what i've been trying. mind showing some code?
     
  8. Offline

    Minecrell

    ROKLGAMES
    Code:java
    1. if (WorldGuard.getRegionManager(world).getApplicableRegions(location).size() == 0) {
    2. // No regions
    3. }
     
    ROKLGAMES likes this.
  9. Offline

    ROKLGAMES

    Wonderful! I can't believe i didn't try that! I'm so tired i must have missed using .size(). Thank you for the help :)
     
Thread Status:
Not open for further replies.

Share This Page