Interface DelegateProfileable
- All Superinterfaces:
Profileable
- All Known Implementing Classes:
ProfileContainer.BlockProfileContainer,ProfileContainer.ItemStackProfileContainer,ProfileInstruction
getDelegateProfile() was protected.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.cryptomorin.xseries.profiles.objects.Profileable
Profileable.GameProfileProfileable, Profileable.PlayerProfileable, Profileable.StringProfileable, Profileable.UsernameProfileable, Profileable.UUIDProfileable -
Method Summary
Modifier and TypeMethodDescription@NotNull ProfileableThe profileable object which handles all the operations.default @Nullable com.mojang.authlib.GameProfileSame asProfileable.getProfile(), except some implementations ofProfileablecannot inherently return any original instance as they're not cacheable, so this method ensures that no duplicate cloning ofGameProfileoccurs for performance.default @Nullable @Unmodifiable com.mojang.authlib.GameProfileThis method should not be used directly unless you know what you're doing.default @Nullable StringA string representation of theProfileable.getProfile()which is useful for data storage which can be serialized back usingProfileable.detect(String).default @Nullable ProfileExceptiontest()Tests whether this profile has any issues or throws any exception.default @NotNull Profileabletransform(@NotNull ProfileTransformer... transformers) Adds transformer (readProfileTransformer) information to a copied version of this profile (so it doesn't affect this instance, but the class type will change).
-
Method Details
-
getDelegateProfile
The profileable object which handles all the operations. It doesn't necessarily have to be a constant object, it can change dynamically. -
getProfile
@Nullable default @Nullable @Unmodifiable com.mojang.authlib.GameProfile getProfile()Description copied from interface:ProfileableThis method should not be used directly unless you know what you're doing.The texture which might be cached. If any errors occur, the check may be re-evaluated. The cached values might also be re-evaluated due to expiration.
- Specified by:
getProfilein interfaceProfileable- Returns:
- the original profile (not cloned if possible) for an instance that's always guaranteed to be a copy
you can use
Profileable.getDisposableProfile()instead. Null if no profile is set (only happens forProfileContainer).
-
test
Description copied from interface:ProfileableTests whether this profile has any issues or throws any exception. This is a good way if you're going to be checking for user issues before trying toProfileInstruction.apply()them. For now, this is basically equivalent to callingProfileable.getProfile()and catching exceptions. Which means that the profile will be cached if a cache is behind this profile.These issues include, wrong username, network issues, etc. Note that some issues only occur when
ProfileInstruction.apply()is used. Any other type of exception that might happen are still ignored.- Specified by:
testin interfaceProfileable
-
getDisposableProfile
@Nullable default @Nullable com.mojang.authlib.GameProfile getDisposableProfile()Description copied from interface:ProfileableSame asProfileable.getProfile(), except some implementations ofProfileablecannot inherently return any original instance as they're not cacheable, so this method ensures that no duplicate cloning ofGameProfileoccurs for performance.For most implementations however, this defaults to a simple cloning of the cached instances.
- Specified by:
getDisposableProfilein interfaceProfileable- Returns:
- always a copied version of
Profileable.getProfile()that you can change. Null ifProfileable.getProfile()is null
-
transform
@NotNull default @NotNull Profileable transform(@NotNull @NotNull ProfileTransformer... transformers) Description copied from interface:ProfileableAdds transformer (readProfileTransformer) information to a copied version of this profile (so it doesn't affect this instance, but the class type will change). So it's recommended to not chain this method and instead collect all transformers and call this method once for performance when necessary.Profiles are copied before being transformed, so the main cache remains intact but the result of transformed profiles are never cached.
- Specified by:
transformin interfaceProfileable- Parameters:
transformers- a list of transformers to apply in order onceProfileable.getProfile()is called.
-
getProfileValue
Description copied from interface:ProfileableA string representation of theProfileable.getProfile()which is useful for data storage which can be serialized back usingProfileable.detect(String).Note that in some cases this is the Base64 value of the textures property, but some may provide less verbose data when possible. Items and blocks can also provide compact data if their profile was built using
ProfileTransformer.includeOriginalValue().- Specified by:
getProfileValuein interfaceProfileable- Returns:
- null if
Profileable.getProfile()is null or the set profile doesn't have a texture property.
-