Class BlockBox
java.lang.Object
me.hsgamer.hscore.minecraft.block.box.BlockBox
A custom box to bound blocks
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncenter()
Get the center of the boxboolean
contains
(double x, double y, double z) Check if the location is in the boxboolean
Check if the location is in the boxboolean
expand
(int x, int y, int z) Create a new block box that expands the minimum and maximum position by the given offsetexpandMax
(int x, int y, int z) Create a new block box that increases the maximum position by the given offsetexpandMin
(int x, int y, int z) Create a new block box that decreases the minimum position by the given offsetint
hashCode()
max()
Get the maximum positionCreate a new block box that increases the maximum position by one.min()
Get the minimum positiondouble
sizeX()
Get the X-size of the boxdouble
sizeY()
Get the Y-size of the boxdouble
sizeZ()
Get the Z-size of the box
-
Field Details
-
minX
public final int minXThe minimum x coordinate -
minY
public final int minYThe minimum y coordinate -
minZ
public final int minZThe minimum z coordinate -
maxX
public final int maxXThe maximum x coordinate -
maxY
public final int maxYThe maximum y coordinate -
maxZ
public final int maxZThe maximum z coordinate
-
-
Constructor Details
-
BlockBox
public BlockBox(int x1, int y1, int z1, int x2, int y2, int z2) Create a new block box- Parameters:
x1
- the first xy1
- the first yz1
- the first zx2
- the second xy2
- the second yz2
- the second z
-
BlockBox
Create a new block box- Parameters:
pos1
- the first positionpos2
- the second position
-
-
Method Details
-
expandMax
Create a new block box that increases the maximum position by the given offset- Parameters:
x
- the x-axis offsety
- the y-axis offsetz
- the z-axis offset- Returns:
- the new box
-
expandMin
Create a new block box that decreases the minimum position by the given offset- Parameters:
x
- the x-axis offsety
- the y-axis offsetz
- the z-axis offset- Returns:
- the new box
-
expand
Create a new block box that expands the minimum and maximum position by the given offset- Parameters:
x
- the x-axis offsety
- the y-axis offsetz
- the z-axis offset- Returns:
- the new box
-
maxInclusive
Create a new block box that increases the maximum position by one. Use this to include the block at the maximum position as a part of the box.- Returns:
- the new box
-
contains
public boolean contains(double x, double y, double z) Check if the location is in the box- Parameters:
x
- the xy
- the yz
- the z- Returns:
- true if it is in the box
-
contains
Check if the location is in the box- Parameters:
pos
- the position- Returns:
- true if it is in the box
-
center
Get the center of the box- Returns:
- the center
-
min
Get the minimum position- Returns:
- the minimum position
-
max
Get the maximum position- Returns:
- the maximum position
-
sizeX
public double sizeX()Get the X-size of the box- Returns:
- the size
-
sizeY
public double sizeY()Get the Y-size of the box- Returns:
- the size
-
sizeZ
public double sizeZ()Get the Z-size of the box- Returns:
- the size
-
equals
-
hashCode
public int hashCode()
-