User Tools

Site Tools


tutorial:networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:networking [2023/01/11 19:25] – [Example: Why is networking important?] netusergettutorial:networking [2023/04/16 01:01] – Make sure to show how to make the ID fx
Line 90: Line 90:
  
 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 ''PacketByteBufs.empty()''. 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 ''PacketByteBufs.empty()''.
 +
 +(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("example", "highlight");
 +}
 +</code>
  
 <code java [enable_line_numbers="true", highlight_lines_extra="2"]> <code java [enable_line_numbers="true", highlight_lines_extra="2"]>
tutorial/networking.txt · Last modified: 2024/05/04 19:51 by bluemeanial