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 Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the results of this transformation can be cached or not.
    Makes the items non-stackable (x64 stack) Read stackable() for more info.
    Removes extra properties from this profile.
    By default, due to internal changes to the GameProfile, (specially the Base64-encoded textures property) the items are considered "different" (for example ItemStack.isSimilar(ItemStack) would return false) which means they cannot be stacked together in the game.
    @NotNull com.mojang.authlib.GameProfile
    transform(@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

      static ProfileTransformer stackable()
      By default, due to internal changes to the GameProfile, (specially the Base64-encoded textures property) the items are considered "different" (for example ItemStack.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 as removeMetadata() but it's here for future compatibility purposes.
      See Also:
    • nonStackable

      static ProfileTransformer nonStackable()
      Makes the items non-stackable (x64 stack) Read stackable() 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

      static ProfileTransformer 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: