13
0
geforkt von Mirrors/Velocity

Fire PlayerSettingsChangedEvent event when PlayerSettings are provided in the Configuration phase (#1118)

Dieser Commit ist enthalten in:
Adrian 2023-10-29 13:44:04 -05:00 committet von GitHub
Ursprung f87b05a487
Commit 2e8ef8b2ca
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 9 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -87,7 +87,7 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler {
@Override
public boolean handle(ClientSettings packet) {
player.setClientSettingsPacket(packet);
player.setClientSettings(packet);
return true;
}

Datei anzeigen

@ -186,7 +186,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override
public boolean handle(ClientSettings packet) {
player.setPlayerSettings(packet);
player.setClientSettings(packet);
VelocityServerConnection serverConnection = player.getConnectedServer();
if (serverConnection == null) {
// No server connection yet, probably transitioning.

Datei anzeigen

@ -282,12 +282,14 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player,
return settings != null;
}
public void setClientSettingsPacket(ClientSettings clientSettingsPacket) {
/**
* Sets player settings.
*
* @param clientSettingsPacket the player settings packet
*/
public void setClientSettings(final ClientSettings clientSettingsPacket) {
this.clientSettingsPacket = clientSettingsPacket;
}
void setPlayerSettings(ClientSettings settings) {
ClientSettingsWrapper cs = new ClientSettingsWrapper(settings);
final ClientSettingsWrapper cs = new ClientSettingsWrapper(clientSettingsPacket);
this.settings = cs;
server.getEventManager().fireAndForget(new PlayerSettingsChangedEvent(this, cs));
}