Class LinkExtensions
Namespace: Void.Minecraft.Links.Extensions
Assembly: Void.Minecraft.dll
Provides packet-oriented send operations for player-to-server links.
public static class LinkExtensionsInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
SendPacketAsync<T>(ILink, CancellationToken)
Constructs and sends a parameterless Minecraft message to the side implied by its marker interface.
public static ValueTask SendPacketAsync<T>(this ILink link, CancellationToken cancellationToken) where T : class, IMinecraftMessage, new()Parameters
link ILink
The link through which the message is sent.
cancellationToken CancellationToken
A token used to cancel sending and event publication.
Returns
A task that completes after the message is sent and the sent event is processed.
Type Parameters
T
The message type to construct and send.
Exceptions
T is neither clientbound nor serverbound.
SendPacketAsync<T>(ILink, T, CancellationToken)
Sends a Minecraft message to the side implied by its marker interface.
public static ValueTask SendPacketAsync<T>(this ILink link, T packet, CancellationToken cancellationToken) where T : class, IMinecraftMessageParameters
link ILink
The link through which the message is sent.
packet T
The message instance to send.
cancellationToken CancellationToken
A token used to cancel sending and event publication.
Returns
A task that completes after the message is sent and the sent event is processed.
Type Parameters
T
The message type.
Exceptions
packet is neither clientbound nor serverbound.
SendPacketAsync<T>(ILink, Side, T, CancellationToken)
Sends a Minecraft message to an explicitly selected link side and publishes a corresponding message-sent event.
public static ValueTask SendPacketAsync<T>(this ILink link, Side side, T packet, CancellationToken cancellationToken) where T : IMinecraftMessageParameters
link ILink
The link through which the message is sent.
side Side
The destination side.
packet T
The message instance to send.
cancellationToken CancellationToken
A token used to cancel sending and event publication.
Returns
A task that completes after the message is sent and the sent event is processed.
Type Parameters
T
The message type.
Exceptions
side is