Package net.blueva.arcade.api.events
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
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 Summary
ConstructorsConstructorDescriptionPlayerJoinGameEvent(int arenaId, String gameId, P player) Constructs a new PlayerJoinGameEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the player attempting to join the game.booleanChecks if this event has been cancelled.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.Methods inherited from class net.blueva.arcade.api.events.GameEvent
getArenaId, getGameId
-
Constructor Details
-
PlayerJoinGameEvent
Constructs a new PlayerJoinGameEvent.- Parameters:
arenaId- the ID of the arena the player is attempting to joingameId- the unique identifier of the game moduleplayer- the player attempting to join the game
-
-
Method Details
-
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:
isCancelledin interfaceCancellable- 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:
setCancelledin interfaceCancellable- Parameters:
cancel- true to cancel the join, false to allow it
-