Search in sources :

Example 1 with MinecraftChannelIdentifier

use of com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier in project FastLogin by games647.

the class FastLoginVelocity method sendPluginMessage.

public void sendPluginMessage(RegisteredServer server, ChannelMessage message) {
    if (server != null) {
        ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
        message.writeTo(dataOutput);
        MinecraftChannelIdentifier channel = MinecraftChannelIdentifier.create(getName(), message.getChannelName());
        server.sendPluginMessage(channel, dataOutput.toByteArray());
    }
}
Also used : MinecraftChannelIdentifier(com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier) ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Aggregations

ByteArrayDataOutput (com.google.common.io.ByteArrayDataOutput)1 MinecraftChannelIdentifier (com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier)1