Record Class MaskedIdentity
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.identity.MaskedIdentity
- Record Components:
alias- the name every other client sees; 1-16 characters of[A-Za-z0-9_]skinValue- the base64texturesproperty value, or null for the default skinskinSignature- the signature Mojang issued forskinValue, or null when unsigned
public record MaskedIdentity(@NotNull String alias, @Nullable String skinValue, @Nullable String skinSignature)
extends Record
The face a player wears while they are masked: a name and, optionally, a skin.
An identity is presentation only. It never replaces the player's real profile, UUID, name, statistics or anything Zentrix stores about them — it is what other clients are told, and nothing more. That is what makes a mask safe to drop at any moment and impossible to persist by accident.
The skin is supplied the way Mojang serves it: a base64 textures property value and the
signature that came with it. Leaving both out yields a nameless-skin mask, where the client falls
back to the default Steve/Alex model derived from the alias.
- Since:
- 1.6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest name a vanilla client accepts in a player-info entry. -
Constructor Summary
ConstructorsConstructorDescriptionMaskedIdentity(@NotNull String alias, @Nullable String skinValue, @Nullable String skinSignature) Creates an instance of aMaskedIdentityrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Stringalias()Returns the value of thealiasrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasSkin()Whether this identity carries a skin of its own.@NotNull StringThe alias in the form aliases are compared by, which is case-insensitively.static @NotNull MaskedIdentityA mask with an unsigned skin, which clients accept in offline and proxied setups.static @NotNull MaskedIdentityA mask that only changes the name, leaving the client to derive a default skin.skin()@Nullable StringReturns the value of theskinSignaturerecord component.@Nullable StringReturns the value of theskinValuerecord component.final StringtoString()Returns a string representation of this record class.@NotNull MaskedIdentityThe same identity under a different name, keeping the skin.@NotNull MaskedIdentityThe same alias wearing a different skin.
-
Field Details
-
MAXIMUM_ALIAS_LENGTH
public static final int MAXIMUM_ALIAS_LENGTHThe longest name a vanilla client accepts in a player-info entry.- See Also:
-
-
Constructor Details
-
MaskedIdentity
public MaskedIdentity(@NotNull @NotNull String alias, @Nullable @Nullable String skinValue, @Nullable @Nullable String skinSignature) Creates an instance of aMaskedIdentityrecord class.- Parameters:
alias- the value for thealiasrecord componentskinValue- the value for theskinValuerecord componentskinSignature- the value for theskinSignaturerecord component
-
-
Method Details
-
ofAlias
A mask that only changes the name, leaving the client to derive a default skin. -
of
@NotNull public static @NotNull MaskedIdentity of(@NotNull @NotNull String alias, @Nullable @Nullable String skinValue) A mask with an unsigned skin, which clients accept in offline and proxied setups. -
hasSkin
public boolean hasSkin()Whether this identity carries a skin of its own. -
skin
-
signature
-
normalizedAlias
The alias in the form aliases are compared by, which is case-insensitively. -
withAlias
The same identity under a different name, keeping the skin. -
withSkin
@NotNull public @NotNull MaskedIdentity withSkin(@Nullable @Nullable String value, @Nullable @Nullable String signature) The same alias wearing a different skin. -
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). -
alias
Returns the value of thealiasrecord component.- Returns:
- the value of the
aliasrecord component
-
skinValue
Returns the value of theskinValuerecord component.- Returns:
- the value of the
skinValuerecord component
-
skinSignature
Returns the value of theskinSignaturerecord component.- Returns:
- the value of the
skinSignaturerecord component
-