Class Locations

java.lang.Object
com.Moshu.Misc.Locations

public class Locations extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    blacklistedBiome(org.bukkit.Location loc)
    Checks if the biome at the location is a blacklisted biome
    static boolean
    check(org.bukkit.Location loc, int maxTreasureDistance)
     
    static double
    distanceTo(org.bukkit.Location loc1, org.bukkit.Location loc2)
     
    static double
    getBorder(org.bukkit.World w)
     
    static org.bukkit.Location
    getRandomLocationMoreThan(org.bukkit.World w, int maxTreasureDistance, double distance, double min)
    Get a safe, random location
    static boolean
    inAir(org.bukkit.Location loc)
    Checks if the location under the location is air
    static void
     
    static boolean
    isAir(org.bukkit.Location l)
    Checks if the block at the location is air
    static boolean
    isAllowedWorld(org.bukkit.World w)
     
    static boolean
    isInBorder(org.bukkit.Location l, int maxTreasureDistance)
     
    static boolean
    isInRegion(org.bukkit.Chunk c, int y)
    Checks if the chunk is in a region at all
    static boolean
    isInRegion(org.bukkit.Location loc)
    Checks if the location is in a region at all
    static boolean
    isInRegion(org.bukkit.Location loc, String regionName)
    Checks if current location is in a WorldGuard region
    static boolean
    isLeaves(org.bukkit.Location loc)
    Checks if the block at the location is a type of leaf
    static boolean
    isLiquid(org.bukkit.Location loc)
    Checks if location is a liqud
    static boolean
    isLiquidAbove(org.bukkit.Location loc)
    Checks if the location above the location is a liqud
    static boolean
    isLiquidUnder(org.bukkit.Location loc)
    Checks if location under the location is a liqud
    static boolean
    isPassableBlockUnder(org.bukkit.Location loc)
     
    static boolean
    isSafeEnough(org.bukkit.Location loc)
     
    static boolean
    isUnsafe(org.bukkit.Location loc, int maxTreasureDistance)
    Checks if a location is considered unsafe based on check()
    static void
    load(org.bukkit.Location l)
    Loads a chunk

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Locations

      public Locations()
  • Method Details

    • init

      public static void init()
    • isAllowedWorld

      public static boolean isAllowedWorld(org.bukkit.World w)
    • isInRegion

      public static boolean isInRegion(org.bukkit.Location loc, String regionName)
      Checks if current location is in a WorldGuard region
      Parameters:
      loc - the location
      regionName - the regions name
      Returns:
      true/false
    • isInRegion

      public static boolean isInRegion(org.bukkit.Location loc)
      Checks if the location is in a region at all
      Parameters:
      loc - the location
      Returns:
      true/false
    • isInRegion

      public static boolean isInRegion(org.bukkit.Chunk c, int y)
      Checks if the chunk is in a region at all
      Parameters:
      c - the chunk
      Returns:
      true/false
    • isLiquid

      public static boolean isLiquid(org.bukkit.Location loc)
      Checks if location is a liqud
      Parameters:
      loc - the location
      Returns:
      true/false
    • isLiquidAbove

      public static boolean isLiquidAbove(org.bukkit.Location loc)
      Checks if the location above the location is a liqud
      Parameters:
      loc - the location
      Returns:
      true/false
    • isLiquidUnder

      public static boolean isLiquidUnder(org.bukkit.Location loc)
      Checks if location under the location is a liqud
      Parameters:
      loc - the location
      Returns:
      true/false
    • isUnsafe

      public static boolean isUnsafe(org.bukkit.Location loc, int maxTreasureDistance)
      Checks if a location is considered unsafe based on check()
      Parameters:
      loc - the location
      Returns:
      true/false
    • isSafeEnough

      public static boolean isSafeEnough(org.bukkit.Location loc)
    • check

      public static boolean check(org.bukkit.Location loc, int maxTreasureDistance)
      Parameters:
      loc - , the location
      Returns:
      true if the location is safe and false if the location is not suitable for a player
    • isPassableBlockUnder

      public static boolean isPassableBlockUnder(org.bukkit.Location loc)
    • inAir

      public static boolean inAir(org.bukkit.Location loc)
      Checks if the location under the location is air
      Parameters:
      loc - the location
      Returns:
      true/false
    • load

      public static void load(org.bukkit.Location l)
      Loads a chunk
      Parameters:
      l - the location
    • blacklistedBiome

      public static boolean blacklistedBiome(org.bukkit.Location loc)
      Checks if the biome at the location is a blacklisted biome
      Parameters:
      loc - the location
      Returns:
      true/false
    • isLeaves

      public static boolean isLeaves(org.bukkit.Location loc)
      Checks if the block at the location is a type of leaf
      Parameters:
      loc - the location
      Returns:
      true/false
    • isAir

      public static boolean isAir(org.bukkit.Location l)
      Checks if the block at the location is air
      Parameters:
      l - the location
      Returns:
      true/false
    • isInBorder

      public static boolean isInBorder(org.bukkit.Location l, int maxTreasureDistance)
    • distanceTo

      public static double distanceTo(org.bukkit.Location loc1, org.bukkit.Location loc2)
    • getBorder

      public static double getBorder(org.bukkit.World w)
    • getRandomLocationMoreThan

      public static org.bukkit.Location getRandomLocationMoreThan(org.bukkit.World w, int maxTreasureDistance, double distance, double min)
      Get a safe, random location
      Parameters:
      w - the world of the treasure
      distance - the distance from the center of the world
      Returns:
      the safe location