Record Class LocalizedCollisionBox
java.lang.Object
java.lang.Record
com.zenith.mc.block.LocalizedCollisionBox
public record LocalizedCollisionBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double x, double y, double z)
extends Record
CollisionBox localized to coordinates
-
Constructor Summary
ConstructorsConstructorDescriptionLocalizedCollisionBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double x, double y, double z) Creates an instance of aLocalizedCollisionBoxrecord class.LocalizedCollisionBox(CollisionBox cb, double x, double y, double z) -
Method Summary
Modifier and TypeMethodDescriptiondoublecenterX()doublecenterY()doublecenterZ()static doublecollidePushOut(double box1Min, double box1Max, double box2Min, double box2Max, double speed) doublecollideX(LocalizedCollisionBox other, double x) doublecollideY(LocalizedCollisionBox other, double y) doublecollideZ(LocalizedCollisionBox other, double z) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inflate(double x, double y, double z) booleanintersects(double oMinX, double oMaxX, double oMinY, double oMaxY, double oMinZ, double oMaxZ) booleanintersects(LocalizedCollisionBox other) doublemaxX()Returns the value of themaxXrecord component.doublemaxY()Returns the value of themaxYrecord component.doublemaxZ()Returns the value of themaxZrecord component.doubleminX()Returns the value of theminXrecord component.doubleminY()Returns the value of theminYrecord component.doubleminZ()Returns the value of theminZrecord component.move(double x, double y, double z) booleanbooleanboolean@Nullable RayIntersectionrayIntersection(double x1, double y1, double z1, double x2, double y2, double z2) stretch(double x, double y, double z) final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.doublez()Returns the value of thezrecord component.
-
Constructor Details
-
LocalizedCollisionBox
-
LocalizedCollisionBox
public LocalizedCollisionBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double x, double y, double z) Creates an instance of aLocalizedCollisionBoxrecord class.- Parameters:
minX- the value for theminXrecord componentmaxX- the value for themaxXrecord componentminY- the value for theminYrecord componentmaxY- the value for themaxYrecord componentminZ- the value for theminZrecord componentmaxZ- the value for themaxZrecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
stretch
-
inflate
-
move
-
collideX
-
collideY
-
collideZ
-
collidePushOut
public static double collidePushOut(double box1Min, double box1Max, double box2Min, double box2Max, double speed) -
noXIntersection
-
noYIntersection
-
noZIntersection
-
intersects
-
intersects
public boolean intersects(double oMinX, double oMaxX, double oMinY, double oMaxY, double oMinZ, double oMaxZ) -
rayIntersection
public @Nullable RayIntersection rayIntersection(double x1, double y1, double z1, double x2, double y2, double z2) -
centerX
public double centerX() -
centerY
public double centerY() -
centerZ
public double centerZ() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
minX
public double minX()Returns the value of theminXrecord component.- Returns:
- the value of the
minXrecord component
-
maxX
public double maxX()Returns the value of themaxXrecord component.- Returns:
- the value of the
maxXrecord component
-
minY
public double minY()Returns the value of theminYrecord component.- Returns:
- the value of the
minYrecord component
-
maxY
public double maxY()Returns the value of themaxYrecord component.- Returns:
- the value of the
maxYrecord component
-
minZ
public double minZ()Returns the value of theminZrecord component.- Returns:
- the value of the
minZrecord component
-
maxZ
public double maxZ()Returns the value of themaxZrecord component.- Returns:
- the value of the
maxZrecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-