Interface ProfileTransformer
- All Known Implementing Classes:
ProfileTransformer.MakeNotStackable,ProfileTransformer.RemoveMetadata
public interface ProfileTransformer
Modifies a
GameProfile by a set of defined operations.
Transformers can be composed and should be applied in order.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the results of this transformation can be cached or not.static ProfileTransformerMakes the items non-stackable (x64 stack) Readstackable()for more info.static ProfileTransformerRemoves extra properties from this profile.static ProfileTransformerBy default, due to internal changes to theGameProfile, (specially the Base64-encoded textures property) the items are considered "different" (for exampleItemStack.isSimilar(ItemStack)would return false) which means they cannot be stacked together in the game.@NotNull com.mojang.authlib.GameProfiletransform(@NotNull com.mojang.authlib.GameProfile profile) Transforms the given profile by the defined operations.
-
Method Details
-
transform
@NotNull @NotNull com.mojang.authlib.GameProfile transform(@NotNull @NotNull com.mojang.authlib.GameProfile profile) Transforms the given profile by the defined operations. The operations are applied on the same instance of the profile.- Parameters:
profile- the profile to apply the operations on.- Returns:
- may return the same or a new instance.
-
canBeCached
@Internal boolean canBeCached()Whether the results of this transformation can be cached or not. -
stackable
By default, due to internal changes to theGameProfile, (specially the Base64-encoded textures property) the items are considered "different" (for exampleItemStack.isSimilar(ItemStack)would return false) which means they cannot be stacked together in the game.These changes can include:
- Mojang's cache/API might add/remove properties from the profile.
- Mojang's API adds a timestamp property that shows when was the last time the profile was updated. This can be frequent or take up to hours to change.
- Mojang's cache/API might change the order or format of the textures JSON.
- Players that change a portion of their skin (other than the head) will still be visually the same, but their texture URL will be changed.
- Profiles created/modified by XSeries have a special signature added.
This transformer, makes the items stackable (x64 stack) This currently has no observable effect on blocks. Technically the same asremoveMetadata()but it's here for future compatibility purposes.- See Also:
-
nonStackable
Makes the items non-stackable (x64 stack) Readstackable()for more info. This adds additional properties other than the ones mentioned in the other method that ensures items can never be stacked no matter how similar they are.- See Also:
-
removeMetadata
Removes extra properties from this profile. This includes the XSeries signature and the timestamp of the profile. Both which have no effect when removed, but the XSeries signature could be useful in debugging.- See Also:
-