Record Class WorldPos
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.data.WorldPos
- All Implemented Interfaces:
NetworkBuffer.Writer
public record WorldPos(@NotNull String dimension, @NotNull Point blockPosition)
extends Record
implements NetworkBuffer.Writer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryTagSerializer<WorldPos> static final NetworkBuffer.Type<WorldPos> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aWorldPosrecord class.WorldPos(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@NotNull PointReturns the value of theblockPositionrecord component.@NotNull StringReturns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.@NotNull WorldPoswithBlockPosition(@NotNull Point blockPosition) @NotNull WorldPoswithDimension(@NotNull String dimension) voidwrite(@NotNull NetworkBuffer writer)
-
Field Details
-
NETWORK_TYPE
-
NBT_TYPE
-
-
Constructor Details
-
WorldPos
-
WorldPos
Creates an instance of aWorldPosrecord class.- Parameters:
dimension- the value for thedimensionrecord componentblockPosition- the value for theblockPositionrecord component
-
-
Method Details
-
withDimension
-
withBlockPosition
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
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 withObjects::equals(Object,Object). -
dimension
Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
blockPosition
Returns the value of theblockPositionrecord component.- Returns:
- the value of the
blockPositionrecord component
-