Merge pull request #52 from Leymooo/header-footer

Add Header and Footer. Resolves #50
This commit is contained in:
Andrew Steinborn
2018-08-24 21:46:03 -04:00
committed by GitHub
7 changed files with 103 additions and 11 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

@@ -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,21 @@ 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(Component header, Component footer);
/**
* Clears a header and footer for the player
*/
void clearHeaderAndFooter();
/**
* 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;
}