Package com.stardevllc.starmclib
Class Cuboid
java.lang.Object
com.stardevllc.starmclib.Cuboid
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(org.bukkit.entity.Entity entity) Returns if this cuboid contains an entitybooleancontains(org.bukkit.Location loc) Checks to see if this cuboid contains a locationbooleancontains(org.bukkit.Location loc, double marge) Checks to see if this cuboid contains a location, with a marginebooleancontains(org.bukkit.World world, int x, int y, int z) Checks to see if this cuboid contains the coordinatesvoidcreateOutline(org.bukkit.Material material) booleanCollection<org.bukkit.block.Block> Gets all blocks within this cuboidCollection<org.bukkit.block.Block> getBlockList(boolean removeAir) Gets all blocks within this cuboid with a flag to remove airorg.bukkit.LocationGets the center of this cuboid as a Bukkit LocationdoubleGets the distance of this cuboiddoubleintGets the height of this cuboidorg.bukkit.LocationGets the maximum corner as a Locationorg.bukkit.LocationGets the minimum corner as a Locationorg.bukkit.LocationGets a random location within this cuboidintGets the total area size represented by this cuboidorg.bukkit.WorldgetWorld()Gets the world that this cuboid exists inintgetXMax()doubleintgetXMin()doubleintGets the x width of this cuboidintgetYMax()doubleintgetYMin()doubleintgetZMax()doubleintgetZMin()doubleintGets the z width of this cuboidinthashCode()protected voidsetBounds(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) protected voidsetBounds(org.bukkit.Location pos1, org.bukkit.Location pos2) protected voidsetWorldName(String worldName) protected voidsetXMax(int xMax) protected voidsetXMin(int xMin) protected voidsetYMax(int yMax) protected voidsetYMin(int yMin) protected voidsetZMax(int zMax) protected voidsetZMin(int zMin)
-
Field Details
-
worldName
-
world
protected transient org.bukkit.World world -
xMin
protected int xMin -
yMin
protected int yMin -
zMin
protected int zMin -
xMax
protected int xMax -
yMax
protected int yMax -
zMax
protected int zMax
-
-
Constructor Details
-
Cuboid
public Cuboid(org.bukkit.Location pos1, org.bukkit.Location pos2) -
Cuboid
-
-
Method Details
-
setBounds
protected void setBounds(org.bukkit.Location pos1, org.bukkit.Location pos2) -
setBounds
protected void setBounds(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) -
createOutline
public void createOutline(org.bukkit.Material material) -
setWorldName
-
setXMin
protected void setXMin(int xMin) -
setYMin
protected void setYMin(int yMin) -
setZMin
protected void setZMin(int zMin) -
setXMax
protected void setXMax(int xMax) -
setYMax
protected void setYMax(int yMax) -
setZMax
protected void setZMax(int zMax) -
getWorldName
-
getXMin
public int getXMin() -
getYMin
public int getYMin() -
getZMin
public int getZMin() -
getXMax
public int getXMax() -
getYMax
public int getYMax() -
getZMax
public int getZMax() -
getXMinCentered
public double getXMinCentered() -
getYMinCentered
public double getYMinCentered() -
getZMinCentered
public double getZMinCentered() -
getXMaxCentered
public double getXMaxCentered() -
getYMaxCentered
public double getYMaxCentered() -
getZMaxCentered
public double getZMaxCentered() -
getBlockList
Gets all blocks within this cuboid- Returns:
- The blocks
-
getBlockList
Gets all blocks within this cuboid with a flag to remove air- Parameters:
removeAir- If air should be counted in the block list- Returns:
- The list of blocks
-
getTotalBlockSize
public int getTotalBlockSize()Gets the total area size represented by this cuboid- Returns:
- The total size
-
getWorld
public org.bukkit.World getWorld()Gets the world that this cuboid exists in- Returns:
- The world
-
getHeight
public int getHeight()Gets the height of this cuboid- Returns:
- The height
-
getXWidth
public int getXWidth()Gets the x width of this cuboid- Returns:
- The x width
-
getZWidth
public int getZWidth()Gets the z width of this cuboid- Returns:
- The z width
-
contains
public boolean contains(org.bukkit.entity.Entity entity) Returns if this cuboid contains an entity- Parameters:
entity- The entity- Returns:
- If the entity exists within this cuboid
-
contains
public boolean contains(org.bukkit.Location loc) Checks to see if this cuboid contains a location- Parameters:
loc- The location- Returns:
- If this cuboid contains the location
-
getCenter
public org.bukkit.Location getCenter()Gets the center of this cuboid as a Bukkit Location- Returns:
- The center
-
getDistance
public double getDistance()Gets the distance of this cuboid- Returns:
- The distance
-
getMinimum
public org.bukkit.Location getMinimum()Gets the minimum corner as a Location- Returns:
- The Minimum corner
-
getMaximum
public org.bukkit.Location getMaximum()Gets the maximum corner as a Location- Returns:
- The Maximum corner
-
getDistanceSquared
public double getDistanceSquared() -
getRandomLocation
public org.bukkit.Location getRandomLocation()Gets a random location within this cuboid- Returns:
- The random location
-
contains
public boolean contains(org.bukkit.World world, int x, int y, int z) Checks to see if this cuboid contains the coordinates- Parameters:
world- The worldx- The xy- The yz- The z- Returns:
- If it contains this
-
contains
public boolean contains(org.bukkit.Location loc, double marge) Checks to see if this cuboid contains a location, with a margine- Parameters:
loc- The locationmarge- The margine- Returns:
- If it does contain the location
-
hashCode
public int hashCode() -
equals
-