Properly implement fallback support.

This commit is contained in:
Andrew Steinborn
2019-02-15 15:07:38 -05:00
parent c5fefd55ed
commit 12f5bdfc48
3 changed files with 74 additions and 27 deletions

View File

@@ -41,6 +41,25 @@ public final class KickedFromServerEvent implements
this.result = new Notify(fancyReason);
}
/**
* Creates a {@code KickedFromServerEvent} instance.
* @param player the player affected
* @param server the server the player disconnected from
* @param originalReason the reason for being kicked, optional
* @param duringServerConnect whether or not the player was kicked during the connection process
* @param result the initial result
*/
public KickedFromServerEvent(Player player,
RegisteredServer server,
@Nullable Component originalReason, boolean duringServerConnect,
ServerKickResult result) {
this.player = Preconditions.checkNotNull(player, "player");
this.server = Preconditions.checkNotNull(server, "server");
this.originalReason = originalReason;
this.duringServerConnect = duringServerConnect;
this.result = Preconditions.checkNotNull(result, "result");
}
@Override
public ServerKickResult getResult() {
return result;