Package dev.latvian.mods.klib.shape
Record Class CylinderShape
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.shape.CylinderShape
- All Implemented Interfaces:
Shape
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<CylinderShape> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, CylinderShape> static final ShapeTypestatic final CylinderShapeFields inherited from interface dev.latvian.mods.klib.shape.Shape
DATA_TYPE, DIRECT_CODEC, DIRECT_STREAM_CODEC, UNIT_OR_DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCylinderShape(float radius, float height) Creates an instance of aCylinderShaperecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildLines(float x, float y, float z, VertexCallback callback) static voidbuildLines(float x, float y, float z, VertexCallback callback, float radius, float height, int detail, int hdetail) voidbuildQuads(float x, float y, float z, VertexCallback callback) static voidbuildQuads(float x, float y, float z, VertexCallback callback, float radius, float height, int detail) booleancontains(org.joml.Vector3fc p) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.optimize()floatradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.type()
-
Field Details
-
UNIT
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,CylinderShape> STREAM_CODEC -
TYPE
-
-
Constructor Details
-
CylinderShape
public CylinderShape(float radius, float height) Creates an instance of aCylinderShaperecord class.- Parameters:
radius- the value for theradiusrecord componentheight- the value for theheightrecord component
-
-
Method Details
-
type
-
optimize
-
buildLines
- Specified by:
buildLinesin interfaceShape
-
buildLines
public static void buildLines(float x, float y, float z, VertexCallback callback, float radius, float height, int detail, int hdetail) -
buildQuads
- Specified by:
buildQuadsin interfaceShape
-
buildQuads
public static void buildQuads(float x, float y, float z, VertexCallback callback, float radius, float height, int detail) -
contains
public boolean contains(org.joml.Vector3fc p) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
radius
public float radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
height
public float height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-