Merge pull request #74 from Leymooo/properties

Allow to edit GameProfile properties.
This commit is contained in:
Andrew Steinborn
2018-09-25 01:53:15 -04:00
committed by GitHub
2 changed files with 31 additions and 1 deletions

View File

@@ -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;
@@ -172,6 +172,17 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
public ConnectionRequestBuilder createConnectionRequest(@NonNull RegisteredServer server) {
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) {