Class ProtocolLibProfileFactory

java.lang.Object
com.github.juliarn.npclib.bukkit.protocol.ProtocolLibProfileFactory

final class ProtocolLibProfileFactory extends Object
Factory for GameProfiles when working with ProtocolLib, as the new authlib v7 types are not properly supported.
  • Field Details

    • CONSTRUCT_PROFILE_MODERN

      private static final MethodHandle CONSTRUCT_PROFILE_MODERN
    • CONSTRUCT_PROFILE_PROPERTY_MODERN

      private static final MethodHandle CONSTRUCT_PROFILE_PROPERTY_MODERN
  • Constructor Details

    • ProtocolLibProfileFactory

      private ProtocolLibProfileFactory()
  • Method Details

    • wrapProfile

      @NotNull public static @NotNull com.comphenix.protocol.wrappers.WrappedGameProfile wrapProfile(@NotNull com.github.juliarn.npclib.api.profile.Profile.Resolved profile)
      Wraps the given resolved profile into a ProtocolLib WrappedGameProfile.
      Parameters:
      profile - the profile to wrap.
      Returns:
      the given profile wrapped into a WrappedGameProfile.
      Throws:
      NullPointerException - if the given profile is null.
      IllegalArgumentException - if the given profile is invalid.
      IllegalStateException - if the profile construction failed for some reason.