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 revision
Previous revision
Next revisionBoth sides next revision
tutorial:networking [2020/12/10 19:13] – Rewrite for networking v1 - v0 has been moved i509vcbtutorial:networking [2020/12/14 00:57] – Transposed words in identifier PlayClientNetworking zulrang
Line 76: Line 76:
         // BAD CODE: DON'T EVER DO THIS!         // BAD CODE: DON'T EVER DO THIS!
         ClientBlockHighlighting.highlightBlock(MinecraftClient.getInstance(), target);         ClientBlockHighlighting.highlightBlock(MinecraftClient.getInstance(), target);
-        return TypedActionResult.success(user.getHandStack(hand));+        return TypedActionResult.success(user.getStackInHand(hand));
     }     }
 </code> </code>
Line 107: Line 107:
 In your client entrypoint, you will register the receiver for your packet using ''PlayClientNetworking.registerGlobalReceiver(Identifier channelName, ChannelHandler channelHandler)'' In your client entrypoint, you will register the receiver for your packet using ''PlayClientNetworking.registerGlobalReceiver(Identifier channelName, ChannelHandler channelHandler)''
  
-The ''Identifier'' should match the same Identifier you use to send the packet to the client. The ''ChannelHandler'' is the functional interface you will use to implement how the packet is handled. **Note the ''ChannelHandler'' should be the one that is a nested interface of ''PlayClientNetworking''**+The ''Identifier'' should match the same Identifier you use to send the packet to the client. The ''ChannelHandler'' is the functional interface you will use to implement how the packet is handled. **Note the ''ChannelHandler'' should be the one that is a nested interface of ''ClientPlayNetworking''**
  
 The example below implements the play channel handler as a lambda: The example below implements the play channel handler as a lambda:
tutorial/networking.txt · Last modified: 2024/05/04 19:51 by bluemeanial