Added async PreLoginEvent to change online mode per connection.
This commit is contained in:
@@ -43,4 +43,18 @@ public interface PendingConnection extends Connection
|
||||
* @return the UUID
|
||||
*/
|
||||
String getUUID();
|
||||
|
||||
/**
|
||||
* Get this connection's online mode.
|
||||
*
|
||||
* @return the online mode
|
||||
*/
|
||||
boolean isOnlineMode();
|
||||
|
||||
/**
|
||||
* Set this connection's online mode.
|
||||
*
|
||||
* @param onlineMode
|
||||
*/
|
||||
void setOnlineMode(boolean onlineMode);
|
||||
}
|
||||
|
@@ -0,0 +1,37 @@
|
||||
package net.md_5.bungee.api.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import net.md_5.bungee.api.Callback;
|
||||
import net.md_5.bungee.api.connection.PendingConnection;
|
||||
import net.md_5.bungee.api.plugin.Cancellable;
|
||||
|
||||
/**
|
||||
* Event called to represent a player first making their presence and username
|
||||
* known.
|
||||
*/
|
||||
@Data
|
||||
@ToString(callSuper = false)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PreLoginEvent extends AsyncEvent<PreLoginEvent> implements Cancellable {
|
||||
|
||||
/**
|
||||
* Cancelled state.
|
||||
*/
|
||||
private boolean cancelled;
|
||||
/**
|
||||
* Message to use when kicking if this event is canceled.
|
||||
*/
|
||||
private String cancelReason;
|
||||
/**
|
||||
* Connection attempting to login.
|
||||
*/
|
||||
private final PendingConnection connection;
|
||||
|
||||
public PreLoginEvent(PendingConnection connection, Callback<PreLoginEvent> done)
|
||||
{
|
||||
super( done );
|
||||
this.connection = connection;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user