Class PlayerJoinGameEvent<P>

java.lang.Object
net.blueva.arcade.api.events.GameEvent
net.blueva.arcade.api.events.PlayerJoinGameEvent<P>
Type Parameters:
P - the player type (platform-specific)
All Implemented Interfaces:
Cancellable

public class PlayerJoinGameEvent<P> extends GameEvent implements Cancellable
Event fired when a player attempts to join a game.

This event is cancellable. If cancelled, the player will not be allowed to join the game. Game modules can listen to this event to implement custom join conditions or restrictions.

  • Constructor Details

    • PlayerJoinGameEvent

      public PlayerJoinGameEvent(int arenaId, String gameId, P player)
      Constructs a new PlayerJoinGameEvent.
      Parameters:
      arenaId - the ID of the arena the player is attempting to join
      gameId - the unique identifier of the game module
      player - the player attempting to join the game
  • Method Details

    • getPlayer

      public P getPlayer()
      Gets the player attempting to join the game.
      Returns:
      the player trying to join
    • isCancelled

      public boolean isCancelled()
      Checks if this event has been cancelled.
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if the join has been cancelled, false otherwise
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets the cancellation state of this event.

      If set to true, the player will not be allowed to join the game.

      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true to cancel the join, false to allow it