Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Merge pull request #74 from Leymooo/properties
Allow to edit GameProfile properties.
Dieser Commit ist enthalten in:
Commit
db5645f80e
@ -5,8 +5,11 @@ import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
|
||||
import com.velocitypowered.api.proxy.player.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import com.velocitypowered.api.util.GameProfile;
|
||||
import com.velocitypowered.api.util.MessagePosition;
|
||||
import com.velocitypowered.api.util.title.Title;
|
||||
import java.util.List;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
@ -35,6 +38,10 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
|
||||
*/
|
||||
Optional<ServerConnection> getCurrentServer();
|
||||
|
||||
/**
|
||||
* Returns the player settings
|
||||
* @return the settings
|
||||
*/
|
||||
PlayerSettings getPlayerSettings();
|
||||
|
||||
/**
|
||||
@ -65,6 +72,18 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
|
||||
*/
|
||||
ConnectionRequestBuilder createConnectionRequest(@NonNull RegisteredServer server);
|
||||
|
||||
/**
|
||||
* Gets a game profile properties of player
|
||||
* @return a immutable list of properties
|
||||
*/
|
||||
List<GameProfile.Property> getGameProfileProperties();
|
||||
|
||||
/**
|
||||
* Sets a GameProfile properties({@link GameProfile.Property)
|
||||
* @param properties a properties to set
|
||||
*/
|
||||
void setGameProfileProperties(List<GameProfile.Property> properties);
|
||||
|
||||
/**
|
||||
* Sets the tab list header and footer for the player.
|
||||
* @param header the header component
|
||||
|
@ -55,7 +55,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
|
||||
private final MinecraftConnection connection;
|
||||
private final InetSocketAddress virtualHost;
|
||||
private final GameProfile profile;
|
||||
private GameProfile profile;
|
||||
private PermissionFunction permissionFunction = null;
|
||||
private int tryIndex = 0;
|
||||
private long ping = -1;
|
||||
@ -173,6 +173,17 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
return new ConnectionRequestBuilderImpl(server);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GameProfile.Property> getGameProfileProperties() {
|
||||
return this.profile.getProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGameProfileProperties(List<GameProfile.Property> properties) {
|
||||
Preconditions.checkNotNull(properties);
|
||||
this.profile = new GameProfile(profile.getId(), profile.getName(), properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeaderAndFooter(@NonNull Component header, @NonNull Component footer) {
|
||||
Preconditions.checkNotNull(header, "header");
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren