tutorial:networking
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:networking [2023/04/16 01:01] – Make sure to show how to make the ID fx | tutorial:networking [2023/04/16 01:04] – proper packet id - I hate this editor already fx | ||
---|---|---|---|
Line 79: | Line 79: | ||
Next, we need to send the packet to the game client. First, you need to define an '' | Next, we need to send the packet to the game client. First, you need to define an '' | ||
+ | <code java> | ||
+ | public class TutorialNetworkingConstants { | ||
+ | // Save the id of the packet so we can reference it later | ||
+ | public static final Identifier HIGHLIGHT_PACKET_ID = new Identifier(" | ||
+ | } | ||
+ | </ | ||
To send the packet to the player, we will use some of the methods inside of '' | To send the packet to the player, we will use some of the methods inside of '' | ||
Line 90: | Line 96: | ||
Since we are not writing any data to the packet, for now, we will send the packet with an empty payload. A buf with an empty payload may be created using '' | Since we are not writing any data to the packet, for now, we will send the packet with an empty payload. A buf with an empty payload may be created using '' | ||
- | |||
- | (Note that the identifier we will put in a class accessible from both sides) | ||
- | |||
- | <code java> | ||
- | public class TutorialNetworkingConstants { | ||
- | // Save the id of the packet so we can reference it later | ||
- | public static final Identifier HIGHLIGHT_PACKET_ID = new Identifier(" | ||
- | } | ||
- | </ | ||
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" |
tutorial/networking.txt · Last modified: 2024/04/24 18:53 by skycatminepokie