Record Class CosmeticTrigger

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.cosmetics.CosmeticTrigger
Record Components:
type - the type
moment - the moment
player - the player whose cosmetic it is; online
cosmetic - the cosmetic the player has equipped
game - the match
other - the other player of a kill or death, when online; null otherwise
location - where it happened: where the player died for a death, otherwise where the player is

public record CosmeticTrigger(@NotNull CosmeticTypeKey type, @NotNull CosmeticMoment moment, @NotNull org.bukkit.entity.Player player, @NotNull CosmeticDefinition cosmetic, @NotNull ZentrixGame game, @Nullable org.bukkit.entity.Player other, @NotNull org.bukkit.Location location) extends Record
A player's equipped cosmetic of an addon's type, triggered at a moment of a match.
Since:
1.11.0
  • Constructor Details

    • CosmeticTrigger

      public CosmeticTrigger(@NotNull @NotNull CosmeticTypeKey type, @NotNull @NotNull CosmeticMoment moment, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull CosmeticDefinition cosmetic, @NotNull @NotNull ZentrixGame game, @Nullable @Nullable org.bukkit.entity.Player other, @NotNull @NotNull org.bukkit.Location location)
      Creates an instance of a CosmeticTrigger record class.
      Parameters:
      type - the value for the type record component
      moment - the value for the moment record component
      player - the value for the player record component
      cosmetic - the value for the cosmetic record component
      game - the value for the game record component
      other - the value for the other record component
      location - the value for the location record component
  • Method Details

    • getOther

      @NotNull public @NotNull Optional<org.bukkit.entity.Player> getOther()
      The other player of a kill or death, when there is one online.
    • location

      @NotNull public @NotNull org.bukkit.Location location()
      A copy of where it happened.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • type

      @NotNull public @NotNull CosmeticTypeKey type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • moment

      @NotNull public @NotNull CosmeticMoment moment()
      Returns the value of the moment record component.
      Returns:
      the value of the moment record component
    • player

      @NotNull public @NotNull org.bukkit.entity.Player player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • cosmetic

      @NotNull public @NotNull CosmeticDefinition cosmetic()
      Returns the value of the cosmetic record component.
      Returns:
      the value of the cosmetic record component
    • game

      @NotNull public @NotNull ZentrixGame game()
      Returns the value of the game record component.
      Returns:
      the value of the game record component
    • other

      @Nullable public @Nullable org.bukkit.entity.Player other()
      Returns the value of the other record component.
      Returns:
      the value of the other record component