mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-11-21 03:11:38 +08:00
Allow the BungeeCord plugin messaging channel to be used by the server at transition time
This commit is contained in:
parent
4ca1798994
commit
d1135bd190
@ -51,6 +51,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
||||
private final VelocityServer server;
|
||||
private final VelocityServerConnection serverConn;
|
||||
private final CompletableFuture<Impl> resultFuture;
|
||||
private final BungeeCordMessageResponder bungeecordMessageResponder;
|
||||
|
||||
/**
|
||||
* Creates the new transition handler.
|
||||
@ -64,6 +65,8 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
||||
this.server = server;
|
||||
this.serverConn = serverConn;
|
||||
this.resultFuture = resultFuture;
|
||||
this.bungeecordMessageResponder = new BungeeCordMessageResponder(server,
|
||||
serverConn.getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,6 +171,10 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
||||
|
||||
@Override
|
||||
public boolean handle(PluginMessage packet) {
|
||||
if (bungeecordMessageResponder.process(packet)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PluginMessageUtil.isRegister(packet)) {
|
||||
serverConn.getPlayer().getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));
|
||||
} else if (PluginMessageUtil.isUnregister(packet)) {
|
||||
|
Loading…
Reference in New Issue
Block a user