Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Summary

Documentation contained deprecated method calls that don't match current API patterns in ExamplePlugin.

Changes

packets.md

  • player.GetLink()player.Link property (3 instances)
  • Added recommended PacketIdDefinitions.ClientboundSetHeldItem pattern
  • Retained custom mapping array example for reference

transformations.md

  • RegisterTransformations(params)RegisterTransformations(@event.Channel, params)
  • Added missing protocol version 1.21.9 mapping

Before/After

// Before
await player.GetLink().ServerChannel.SendPacketAsync(packet, cancellationToken);
@event.Player.RegisterTransformations<T>(Transformations);

// After  
await player.Link.ServerChannel.SendPacketAsync(packet, cancellationToken);
@event.Player.RegisterTransformations<T>(@event.Channel, Transformations);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Void/Void/docs/astro/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 8, 2026 01:45
Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Copilot AI changed the title [WIP] Update outdated code examples documentation in astro directory docs(astro): 📝 updated deprecated API usage in code examples Feb 8, 2026
Copilot AI requested a review from caunt February 8, 2026 01:52
@caunt caunt marked this pull request as ready for review February 8, 2026 01:56
Copilot AI review requested due to automatic review settings February 8, 2026 01:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Astro documentation to reflect current Void/ExamplePlugin networking APIs, replacing deprecated calls and aligning examples with the preferred packet ID/transformations registration patterns.

Changes:

  • Updated packet-sending examples to use player.Link instead of the deprecated player.GetLink().
  • Added a recommended PacketIdDefinitions.ClientboundSetHeldItem registration example.
  • Updated transformations docs to use the channel-aware RegisterTransformations(@event.Channel, ...) overload and added the missing 1.21.9 packet ID mapping.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/astro/src/content/docs/docs/developing-plugins/network/transformations.md Updates transformations registration example to use the channel-aware overload and adds the 1.21.9 mapping.
docs/astro/src/content/docs/docs/developing-plugins/network/packets.md Updates packet registration/sending examples to match current API usage and recommended predefined mappings.
Comments suppressed due to low confidence (1)

docs/astro/src/content/docs/docs/developing-plugins/network/packets.md:151

  • Docs style guideline in AGENTS.md says to avoid inline code/backticks inside link captions (AGENTS.md:111-113). Here the link text includes backticks around ILink; consider using plain/bold link text (e.g., “ILink”) and keep any code formatting outside the link label.
### Sending Packets to the [**`ILink`**](/docs/developing-plugins/network/links)
You can send packets to the link with `ILink.SendPacketAsync` method.
[**`ILink`**](/docs/developing-plugins/network/links) will automatically determine the destination of the packet based on the packet interface.  

You can send packets to the server with `ILink.ServerChannel` instance.
```csharp
await player.GetLink().ServerChannel.SendPacketAsync(new SetHeldItemClientboundPacket { Slot = slot }, cancellationToken);
await player.Link.ServerChannel.SendPacketAsync(new SetHeldItemClientboundPacket { Slot = slot }, cancellationToken);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPlayer.Link is nullable (it returns ILink?), so dereferencing it directly in the example can produce a NullReferenceException and also shows a pattern that won’t compile cleanly with nullable reference types enabled. Consider using the non-null link instance from the relevant event (when available) or explicitly guarding (e.g., assign player.Link to a local variable and throw a clear exception if it’s null) before calling into ServerChannel.

Copilot uses AI. Check for mistakes.
Comment on lines +157 to +162
await player.Link.SendPacketAsync(new SetHeldItemClientboundPacket { Slot = slot }, cancellationToken);
```

When you want to explicitly send a packet to the server or client, `SendPacketAsync` has an overload that specifies the destination side.
```csharp
await player.GetLink().SendPacketAsync(Side.Client, new SetHeldItemClientboundPacket { Slot = slot }, cancellationToken);
await player.Link.SendPacketAsync(Side.Client, new SetHeldItemClientboundPacket { Slot = slot }, cancellationToken);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples dereference player.Link directly, but Link is nullable (ILink?). To avoid teaching a null-dereference pattern (and to keep the snippet compatible with nullable reference types), guard player.Link (or use the link provided by an event) before calling SendPacketAsync.

Copilot uses AI. Check for mistakes.
@caunt caunt merged commit 1f8ff13 into main Feb 8, 2026
21 checks passed
@caunt caunt deleted the copilot/update-outdated-code-docs branch February 8, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants