Class LocalPlayerPreLoginEvent.Result

java.lang.Object
eu.cloudnetservice.modules.bridge.node.event.LocalPlayerPreLoginEvent.Result
Enclosing class:
LocalPlayerPreLoginEvent

public static final class LocalPlayerPreLoginEvent.Result extends Object
Represents the outcome of the login event.
Since:
4.0
  • Field Details

  • Constructor Details

    • Result

      private Result(boolean allowed, @Nullable @Nullable Component result)
      Constructs a new result for the player pre login event.
      Parameters:
      allowed - whether the player is allowed to connect or not.
      result - the reason for denying the login.
  • Method Details

    • allowed

      Gets a jvm static result that allows the login.
      Returns:
      an allowing result.
    • denied

      Creates a new result that denies the login of the player and sets the given reason.
      Parameters:
      reason - the reason for denying the login.
      Returns:
      the new result denying the login.
    • permitLogin

      public boolean permitLogin()
      Gets whether this result allows the login or not.
      Returns:
      true if the login is allowed, false otherwise.
    • result

      public @UnknownNullability Component result()
      Gets the text component that is displayed to the player if the login is denied.
      Returns:
      the reason to display to the player, might be null if the component is not set.