Record Class CosmeticPreview

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.cosmetics.CosmeticPreview
Record Components:
location - where the cosmetic should appear
showcase - whether the preview shows in the showcase

public record CosmeticPreview(@NotNull org.bukkit.Location location, boolean showcase) extends Record
Where a cosmetic preview shows, and how, as passed to CosmeticHandler.startPreview(org.bukkit.entity.Player, CosmeticDefinition, CosmeticPreview, Runnable).

In place, location() is the player's own location and the cosmetic shows on them. In the showcase, the player watches a still model of themselves from a viewing spot, and the cosmetic shows at the model's location instead - not on the player, who may be some distance away.

Since:
1.13.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    CosmeticPreview(@NotNull org.bukkit.Location location, boolean showcase)
    Creates an instance of a CosmeticPreview record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull org.bukkit.Location
    Returns the value of the location record component.
    boolean
    Returns the value of the showcase record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CosmeticPreview

      public CosmeticPreview(@NotNull @NotNull org.bukkit.Location location, boolean showcase)
      Creates an instance of a CosmeticPreview record class.
      Parameters:
      location - the value for the location record component
      showcase - the value for the showcase record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • location

      @NotNull public @NotNull org.bukkit.Location location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • showcase

      public boolean showcase()
      Returns the value of the showcase record component.
      Returns:
      the value of the showcase record component