3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Add Player#getGameProfile() to make tab list plugins easier to make.

Dieser Commit ist enthalten in:
Andrew Steinborn 2019-03-29 15:01:52 -04:00
Ursprung 118574e535
Commit 564cb99861
5 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -106,6 +106,11 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
*/
void setGameProfileProperties(List<GameProfile.Property> properties);
/**
* Returns the player's game profile.
*/
GameProfile getGameProfile();
/**
* Sets the tab list header and footer for the player.
*

Datei anzeigen

@ -72,7 +72,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
response.setId(packet.getId());
response.setData(createForwardingData(configuration.getForwardingSecret(),
serverConn.getPlayer().getRemoteAddress().getHostString(),
serverConn.getPlayer().getProfile()));
serverConn.getPlayer().getGameProfile()));
mc.write(response);
informationForwarded = true;
} else {

Datei anzeigen

@ -126,9 +126,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
.append('\0')
.append(proxyPlayer.getRemoteAddress().getHostString())
.append('\0')
.append(proxyPlayer.getProfile().getUndashedId())
.append(proxyPlayer.getGameProfile().getUndashedId())
.append('\0');
GSON.toJson(proxyPlayer.getProfile().getProperties(), data);
GSON.toJson(proxyPlayer.getGameProfile().getProperties(), data);
return data.toString();
}
@ -192,8 +192,8 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
@Override
public String toString() {
return "[server connection] " + proxyPlayer.getProfile().getName() + " -> " + registeredServer
.getServerInfo().getName();
return "[server connection] " + proxyPlayer.getGameProfile().getName() + " -> "
+ registeredServer.getServerInfo().getName();
}
@Override

Datei anzeigen

@ -109,8 +109,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
return false;
}
} catch (Exception e) {
logger
.info("Exception occurred while running command for {}", player.getProfile().getName(),
logger.info("Exception occurred while running command for {}", player.getUsername(),
e);
player.sendMessage(
TextComponent.of("An error occurred while running this command.", TextColor.RED));

Datei anzeigen

@ -114,7 +114,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
return Optional.ofNullable(connectedServer);
}
public GameProfile getProfile() {
@Override
public GameProfile getGameProfile() {
return profile;
}