Added javadocs
This commit is contained in:
parent
aa99aae2f7
commit
e670ed38c0
@ -54,7 +54,7 @@ public class AuthMeVelocityPlugin {
|
||||
}
|
||||
|
||||
protected ProxyServer getProxy(){
|
||||
return proxy;
|
||||
return this.proxy;
|
||||
}
|
||||
|
||||
public static AuthMeVelocityPlugin getInstance(){
|
||||
|
@ -7,6 +7,10 @@ import com.velocitypowered.api.event.ResultedEvent.GenericResult;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
|
||||
/**
|
||||
* Event to be executed just before sending a player to another server after login/registration.
|
||||
* Here you have the ability to deny the event.
|
||||
*/
|
||||
public class PreSendOnLoginEvent implements ResultedEvent<GenericResult> {
|
||||
|
||||
private GenericResult result = GenericResult.allowed();
|
||||
@ -14,29 +18,54 @@ public class PreSendOnLoginEvent implements ResultedEvent<GenericResult> {
|
||||
private final RegisteredServer actualserver;
|
||||
private final RegisteredServer serverToSend;
|
||||
|
||||
/**
|
||||
* Create a new PreSendOnLoginEvent
|
||||
* @param player the player logged
|
||||
* @param actualServer the server on which the player is located
|
||||
* @param serverToSend the server to which the player will be sent
|
||||
*/
|
||||
public PreSendOnLoginEvent(Player player, RegisteredServer actualServer, RegisteredServer serverToSend){
|
||||
this.player = player;
|
||||
this.actualserver = actualServer;
|
||||
this.serverToSend = serverToSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the logged player
|
||||
* @return the player
|
||||
*/
|
||||
public Player getPlayer(){
|
||||
return this.player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the server on which the player is located
|
||||
* @return the actual server of the player
|
||||
*/
|
||||
public RegisteredServer getActualServer(){
|
||||
return this.actualserver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the server to which the player will be sent
|
||||
* @return the server to send the player
|
||||
*/
|
||||
public RegisteredServer getSendServer(){
|
||||
return this.serverToSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the result of the event
|
||||
*/
|
||||
@Override
|
||||
public GenericResult getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the result of the event
|
||||
* @param newresult the new result
|
||||
*/
|
||||
@Override
|
||||
public void setResult(GenericResult newresult) {
|
||||
this.result = Objects.requireNonNull(newresult);
|
||||
|
@ -3,7 +3,9 @@ package com.glyart.authmevelocity.proxy.event;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Event executed in case the player is successfully logged in
|
||||
*/
|
||||
public record ProxyLoginEvent(Player player, RegisteredServer server) {}
|
||||
public record ProxyLoginEvent(@NotNull Player player, @NotNull RegisteredServer server) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user