mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 06:27:42 +01:00
feat: PlayerChannelUnregisterEvent (#1686)
* feat: PlayerChannelUnregisterEvent * style: fix checkstyle issues
This commit is contained in:
@@ -24,6 +24,7 @@ import com.mojang.brigadier.suggestion.Suggestion;
|
||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||
import com.velocitypowered.api.event.player.CookieReceiveEvent;
|
||||
import com.velocitypowered.api.event.player.PlayerChannelRegisterEvent;
|
||||
import com.velocitypowered.api.event.player.PlayerChannelUnregisterEvent;
|
||||
import com.velocitypowered.api.event.player.PlayerClientBrandEvent;
|
||||
import com.velocitypowered.api.event.player.TabCompleteEvent;
|
||||
import com.velocitypowered.api.event.player.configuration.PlayerEnteredConfigurationEvent;
|
||||
@@ -318,8 +319,12 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
||||
new PlayerChannelRegisterEvent(player, ImmutableList.copyOf(channels)));
|
||||
backendConn.write(packet.retain());
|
||||
} else if (PluginMessageUtil.isUnregister(packet)) {
|
||||
player.getClientsideChannels()
|
||||
.removeAll(PluginMessageUtil.getChannels(0, packet, this.player.getProtocolVersion()));
|
||||
List<ChannelIdentifier> channels =
|
||||
PluginMessageUtil.getChannels(0, packet, this.player.getProtocolVersion());
|
||||
player.getClientsideChannels().removeAll(channels);
|
||||
server.getEventManager()
|
||||
.fireAndForget(
|
||||
new PlayerChannelUnregisterEvent(player, ImmutableList.copyOf(channels)));
|
||||
backendConn.write(packet.retain());
|
||||
} else if (PluginMessageUtil.isMcBrand(packet)) {
|
||||
String brand = PluginMessageUtil.readBrandMessage(packet.content());
|
||||
|
||||
Reference in New Issue
Block a user