Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 15:50:19 +01:00
Fire PlayerSettingsChangedEvent event when PlayerSettings are provided in the Configuration phase (#1118)
Dieser Commit ist enthalten in:
Ursprung
f87b05a487
Commit
2e8ef8b2ca
@ -87,7 +87,7 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler {
|
||||
|
||||
@Override
|
||||
public boolean handle(ClientSettings packet) {
|
||||
player.setClientSettingsPacket(packet);
|
||||
player.setClientSettings(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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));
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren