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 net.minestom.server.coordinate.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 net.minestom.server.coordinate.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 net.minestom.server.coordinate.Point blockPosition) @NotNull WorldPoswithDimension(@NotNull String dimension) voidwrite(@NotNull NetworkBuffer writer)
-
Field Details
-
NETWORK_TYPE
-
NBT_TYPE
-
-
Constructor Details
-
WorldPos
-
WorldPos
public WorldPos(@NotNull @NotNull String dimension, @NotNull @NotNull net.minestom.server.coordinate.Point blockPosition) Creates an instance of aWorldPosrecord class.- Parameters:
dimension- the value for thedimensionrecord componentblockPosition- the value for theblockPositionrecord component
-
-
Method Details
-
withDimension
-
withBlockPosition
@NotNull public @NotNull WorldPos withBlockPosition(@NotNull @NotNull net.minestom.server.coordinate.Point blockPosition) -
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
@NotNull public @NotNull net.minestom.server.coordinate.Point blockPosition()Returns the value of theblockPositionrecord component.- Returns:
- the value of the
blockPositionrecord component
-