use of org.spongepowered.common.accessor.network.protocol.login.ClientboundCustomQueryPacketAccessor in project SpongeCommon by SpongePowered.
the class SpongeChannelManager method handleLoginRequestPayload.
public boolean handleLoginRequestPayload(final EngineConnection connection, final ClientboundCustomQueryPacket packet) {
// Server -> Client request
final ClientboundCustomQueryPacketAccessor accessor = (ClientboundCustomQueryPacketAccessor) packet;
final ResourceKey channel = (ResourceKey) (Object) accessor.accessor$identifier();
final int transactionId = accessor.accessor$transactionId();
final ChannelBuf payload = (ChannelBuf) accessor.accessor$data();
try {
return this.handleLoginRequestPayload(connection, channel, transactionId, payload);
} finally {
ChannelBuffers.release(payload);
}
}
use of org.spongepowered.common.accessor.network.protocol.login.ClientboundCustomQueryPacketAccessor in project SpongeCommon by SpongePowered.
the class PacketUtil method createLoginPayloadRequest.
public static net.minecraft.network.protocol.Packet<?> createLoginPayloadRequest(final ResourceKey channel, final ChannelBuf payload, final int transactionId) {
final ClientboundCustomQueryPacket packet = new ClientboundCustomQueryPacket();
final ClientboundCustomQueryPacketAccessor accessor = (ClientboundCustomQueryPacketAccessor) packet;
accessor.accessor$identifier((ResourceLocation) (Object) channel);
accessor.accessor$transactionId(transactionId);
accessor.accessor$data((FriendlyByteBuf) payload);
return packet;
}
Aggregations