Class DimensionsUtils

java.lang.Object
me.xxastaspastaxx.dimensions.DimensionsUtils

public class DimensionsUtils extends Object
Contains methods that are commonly used
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    cloneEntity​(org.bukkit.entity.Entity en, org.bukkit.entity.Entity newEn)
     
    static org.bukkit.block.data.BlockData
    getNetherPortalEffect​(boolean zAxis)
    Get the nether portal BlockData for the axis
    static int
    getRandom​(int min, int max)
    Return a random integer in the given range
    static boolean
    isAir​(org.bukkit.block.Block block)
    Check if the block is air
    static boolean
    isBlockFacezAxis​(org.bukkit.block.BlockFace face)
    Check if the given BlockFace is placed along the Z Axis
    static boolean
    isInt​(String string)
    Check if string can be parsed as integer
    static String
    locationToString​(org.bukkit.Location loc, String delim)
    Convert a location to string
    static org.bukkit.Location
    Parse a location from a string
    static org.bukkit.block.BlockFace
    yawToFace​(float yaw)
    Get blockface from location yaw

    Methods inherited from class java.lang.Object

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

    • DimensionsUtils

      public DimensionsUtils()
  • Method Details

    • isAir

      public static boolean isAir(org.bukkit.block.Block block)
      Check if the block is air
      Parameters:
      block - block that is being checked
      Returns:
      true if the type of the block is AIR or CAVE_AIR
    • getRandom

      public static int getRandom(int min, int max)
      Return a random integer in the given range
      Parameters:
      min - inclusive
      max - inclusive
      Returns:
      a random integer
    • getNetherPortalEffect

      public static org.bukkit.block.data.BlockData getNetherPortalEffect(boolean zAxis)
      Get the nether portal BlockData for the axis
      Parameters:
      zAxis - if the BlockData must have zAxis
      Returns:
      NETHER_PORTAL BlockData facing the set Axis
    • parseLocationFromString

      public static org.bukkit.Location parseLocationFromString(String str, String delim)
      Parse a location from a string
      Parameters:
      str - the string containing the location
      delim - delimiter seperating the data
      Returns:
      the parsed location
    • locationToString

      public static String locationToString(org.bukkit.Location loc, String delim)
      Convert a location to string
      Parameters:
      loc - the location to be stringified
      delim - the delimeter to seperate the data
      Returns:
      the stringified location
    • isInt

      public static boolean isInt(String string)
      Check if string can be parsed as integer
      Parameters:
      string - string to check
      Returns:
      true if string is integer
    • yawToFace

      public static org.bukkit.block.BlockFace yawToFace(float yaw)
      Get blockface from location yaw
      Parameters:
      yaw - the yaw of the location
      Returns:
      BlockFace from yaw
    • isBlockFacezAxis

      public static boolean isBlockFacezAxis(org.bukkit.block.BlockFace face)
      Check if the given BlockFace is placed along the Z Axis
      Parameters:
      face - BlockFace to check
      Returns:
      true if the BlockFace is WEST or EAST
    • cloneEntity

      public static void cloneEntity(org.bukkit.entity.Entity en, org.bukkit.entity.Entity newEn)