Package kr.toxicity.hud.api.adapter
Record Class LocationWrapper
java.lang.Object
java.lang.Record
kr.toxicity.hud.api.adapter.LocationWrapper
- Record Components:
world- worldx- x coordinatey- y coordinatez- z coordinatepitch- player's pitchyaw- player's yaw
public record LocationWrapper(@NotNull WorldWrapper world, double x, double y, double z, float pitch, float yaw)
extends Record
A wrapper class of location.
-
Constructor Summary
ConstructorsConstructorDescriptionLocationWrapper(@NotNull WorldWrapper world, double x, double y, double z, float pitch, float yaw) Creates an instance of aLocationWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull LocationWrapperdeserialize(@NotNull com.google.gson.JsonObject data) Finds location from JSON.static @NotNull LocationWrapperdeserialize(@NotNull YamlObject data) Finds location from YAML.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatpitch()Returns the value of thepitchrecord component.Serializes to map.final StringtoString()Returns a string representation of this record class.@NotNull WorldWrapperworld()Returns the value of theworldrecord component.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.floatyaw()Returns the value of theyawrecord component.doublez()Returns the value of thezrecord component.
-
Constructor Details
-
LocationWrapper
public LocationWrapper(@NotNull @NotNull WorldWrapper world, double x, double y, double z, float pitch, float yaw) Creates an instance of aLocationWrapperrecord class.
-
-
Method Details
-
deserialize
Finds location from YAML.- Parameters:
data- raw data- Returns:
- location
-
deserialize
@NotNull public static @NotNull LocationWrapper deserialize(@NotNull @NotNull com.google.gson.JsonObject data) Finds location from JSON.- Parameters:
data- raw data- Returns:
- location
-
serialize
Serializes to map.- Returns:
- map
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
world
Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord 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
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
yaw
public float yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-