Package me.xxastaspastaxx.dimensions
Class DimensionsUtils
java.lang.Object
me.xxastaspastaxx.dimensions.DimensionsUtils
Contains methods that are commonly used
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 axisstatic int
getRandom(int min, int max)
Return a random integer in the given rangestatic boolean
isAir(org.bukkit.block.Block block)
Check if the block is airstatic boolean
isBlockFacezAxis(org.bukkit.block.BlockFace face)
Check if the given BlockFace is placed along the Z Axisstatic boolean
Check if string can be parsed as integerstatic String
locationToString(org.bukkit.Location loc, String delim)
Convert a location to stringstatic org.bukkit.Location
parseLocationFromString(String str, String delim)
Parse a location from a stringstatic org.bukkit.block.BlockFace
yawToFace(float yaw)
Get blockface from location yaw
-
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
- inclusivemax
- 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
Parse a location from a string- Parameters:
str
- the string containing the locationdelim
- delimiter seperating the data- Returns:
- the parsed location
-
locationToString
Convert a location to string- Parameters:
loc
- the location to be stringifieddelim
- the delimeter to seperate the data- Returns:
- the stringified location
-
isInt
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)
-