Class OnboardingService

java.lang.Object
com.gamersafer.minecraft.auth.paper.onboarding.OnboardingService
All Implemented Interfaces:
com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService

public class OnboardingService extends Object implements com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
Handles player onboarding functionality.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OnboardingService(@NonNull GSAuthPaper plugin, @NonNull com.gamersafer.minecraft.auth.common.configuration.ServerConfiguration config)
    Constructs OnboardingService.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Adds a player to the onboarding room.
    void
    Disables the onboarding room.
    void
    Enables the onboarding room.
    void
    handlePlayerJoin(@NonNull org.bukkit.entity.Player newPlayer)
    Handles a player join (used for hiding new players from onboarders)
    boolean
    inRoom(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Returns true if the player is in the onboarding room (will return true for a player who is still going through the onboarding process).
    boolean
    inWorld(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Returns true if the player is in the onboarding room's world.
    boolean
    Returns true if the onboarding world is enabled.
    void
    Reloads the onboarding service's hologram and book handlers.
    void
    remove(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Removes a player from the onboarding room.
    void
    showBook(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Opens the onboarding room book for player.
    @NonNull WorldLoader
    Returns the world loader.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OnboardingService

      public OnboardingService(@NonNull GSAuthPaper plugin, @NonNull com.gamersafer.minecraft.auth.common.configuration.ServerConfiguration config)
      Constructs OnboardingService.
      Parameters:
      plugin - the plugin
  • Method Details

    • enable

      public void enable()
      Enables the onboarding room. Will attempt to load the onboarding room if the configuration allows it.

      If the onboarding room is disabled, then this method will immediately return.

    • disable

      public void disable()
      Disables the onboarding room.
    • reload

      public void reload()
      Reloads the onboarding service's hologram and book handlers.
      Specified by:
      reload in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
    • add

      public void add(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Adds a player to the onboarding room.
      Specified by:
      add in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Parameters:
      player - the player
    • remove

      public void remove(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Removes a player from the onboarding room.
      Specified by:
      remove in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Parameters:
      player - the player
    • handlePlayerJoin

      public void handlePlayerJoin(@NonNull org.bukkit.entity.Player newPlayer)
      Handles a player join (used for hiding new players from onboarders)
      Parameters:
      newPlayer - the new player
    • inWorld

      public boolean inWorld(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Returns true if the player is in the onboarding room's world.
      Specified by:
      inWorld in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Parameters:
      player - the player
      Returns:
      true or false
    • inRoom

      public boolean inRoom(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Returns true if the player is in the onboarding room (will return true for a player who is still going through the onboarding process).
      Specified by:
      inRoom in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Parameters:
      player - the player
      Returns:
      true or false
    • showBook

      public void showBook(@NonNull com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Opens the onboarding room book for player.
      Specified by:
      showBook in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Parameters:
      player - the player
    • worldLoader

      public @NonNull WorldLoader worldLoader()
      Returns the world loader.
      Returns:
      the world loader
    • isEnabled

      public boolean isEnabled()
      Returns true if the onboarding world is enabled.
      Specified by:
      isEnabled in interface com.gamersafer.minecraft.auth.common.onboarding.IOnboardingService
      Returns:
      true or false