Add Header and Footer. Resolves #50

This commit is contained in:
Leymooo
2018-08-25 04:33:27 +03:00
parent a3c4522ca0
commit 1f8c8dcd94
8 changed files with 88 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
package com.velocitypowered.api.event;
import com.google.common.base.Preconditions;
import net.kyori.text.Component;
import net.kyori.text.serializer.ComponentSerializers;
import org.checkerframework.checker.nullness.qual.NonNull;

View File

@@ -7,7 +7,6 @@ import com.velocitypowered.api.proxy.InboundConnection;
import net.kyori.text.Component;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

View File

@@ -1,16 +1,13 @@
package com.velocitypowered.api.proxy;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.event.connection.LoginEvent;
import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
import com.velocitypowered.api.server.ServerInfo;
import com.velocitypowered.api.util.GameProfile.Property;
import com.velocitypowered.api.util.MessagePosition;
import net.kyori.text.Component;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@@ -58,5 +55,16 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
*/
ConnectionRequestBuilder createConnectionRequest(@NonNull ServerInfo info);
/**
* Sets a header and footer to the player
* @param header component with header
* @param footer component with footer
*/
void setHeaderAndFooter(@NonNull Component header, @NonNull Component footer);
/**
* Disconnects the player with the reason
* @param reason component with the reason
*/
void disconnect(Component reason);
}

View File

@@ -25,7 +25,7 @@ public class GameProfile {
public UUID idAsUuid() {
return UuidUtils.fromUndashed(id);
}
public String getName() {
return name;
}