use of org.spongepowered.common.accessor.network.protocol.login.ServerboundCustomQueryPacketAccessor in project SpongeCommon by SpongePowered.
the class PacketUtil method createLoginPayloadResponse.
public static net.minecraft.network.protocol.Packet<?> createLoginPayloadResponse(@Nullable final ChannelBuf payload, final int transactionId) {
final ServerboundCustomQueryPacket packet = new ServerboundCustomQueryPacket();
final ServerboundCustomQueryPacketAccessor accessor = (ServerboundCustomQueryPacketAccessor) packet;
accessor.accessor$transactionId(transactionId);
accessor.accessor$data((FriendlyByteBuf) payload);
return packet;
}
use of org.spongepowered.common.accessor.network.protocol.login.ServerboundCustomQueryPacketAccessor in project SpongeCommon by SpongePowered.
the class SpongeChannelManager method handleLoginResponsePayload.
public void handleLoginResponsePayload(final EngineConnection connection, final ServerboundCustomQueryPacket packet) {
// Client -> Server response
final ServerboundCustomQueryPacketAccessor accessor = (ServerboundCustomQueryPacketAccessor) packet;
final int transactionId = accessor.accessor$transactionId();
final ChannelBuf payload = (ChannelBuf) accessor.accessor$data();
try {
this.handleLoginResponsePayload(connection, transactionId, payload);
} finally {
if (payload != null) {
ChannelBuffers.release(payload);
}
}
}
Aggregations