Record Class CosmeticTrigger
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.cosmetics.CosmeticTrigger
- Record Components:
type- the typemoment- the momentplayer- the player whose cosmetic it is; onlinecosmetic- the cosmetic the player has equippedgame- the matchother- the other player of akillordeath, when online; null otherwiselocation- 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 Summary
ConstructorsConstructorDescriptionCosmeticTrigger(@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) Creates an instance of aCosmeticTriggerrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull CosmeticDefinitioncosmetic()Returns the value of thecosmeticrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull ZentrixGamegame()Returns the value of thegamerecord component.@NotNull Optional<org.bukkit.entity.Player> getOther()The other player of a kill or death, when there is one online.final inthashCode()Returns a hash code value for this object.@NotNull org.bukkit.Locationlocation()A copy of where it happened.@NotNull CosmeticMomentmoment()Returns the value of themomentrecord component.@Nullable org.bukkit.entity.Playerother()Returns the value of theotherrecord component.@NotNull org.bukkit.entity.Playerplayer()Returns the value of theplayerrecord component.final StringtoString()Returns a string representation of this record class.@NotNull CosmeticTypeKeytype()Returns the value of thetyperecord component.
-
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 aCosmeticTriggerrecord class.- Parameters:
type- the value for thetyperecord componentmoment- the value for themomentrecord componentplayer- the value for theplayerrecord componentcosmetic- the value for thecosmeticrecord componentgame- the value for thegamerecord componentother- the value for theotherrecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
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
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
moment
Returns the value of themomentrecord component.- Returns:
- the value of the
momentrecord component
-
player
@NotNull public @NotNull org.bukkit.entity.Player player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
cosmetic
Returns the value of thecosmeticrecord component.- Returns:
- the value of the
cosmeticrecord component
-
game
Returns the value of thegamerecord component.- Returns:
- the value of the
gamerecord component
-
other
@Nullable public @Nullable org.bukkit.entity.Player other()Returns the value of theotherrecord component.- Returns:
- the value of the
otherrecord component
-