tutorial:networking
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:networking [2019/12/26 22:11] – Added Fudge's networking modmuss50 | tutorial:networking [2020/03/17 15:53] – [Client To Server (C2S) Packets] Update mappings earthcomputer | ||
---|---|---|---|
Line 41: | Line 41: | ||
===== Server To Client (S2C) Packets ===== | ===== Server To Client (S2C) Packets ===== | ||
- | Server To Client, or S2C packets for short, allow the server to tell the clients to execute predefined code with some data. The clients will first need to know what to execute, so we will tell them just that during [**client** mod initialization]($$$ LINK TO CLIENT INIT DOC | + | Server To Client, or S2C packets for short, allow the server to tell the clients to execute predefined code with some data. The clients will first need to know what to execute, so we will tell them just that during |
(Note that the identifier we will put in the class of the common initializer so it can be accessed from both sides:) | (Note that the identifier we will put in the class of the common initializer so it can be accessed from both sides:) | ||
Line 210: | Line 210: | ||
// ALWAYS validate that the information received is valid in a C2S packet! | // ALWAYS validate that the information received is valid in a C2S packet! | ||
- | if(packetContext.getPlayer().world.isHeightValidAndBlockLoaded(pos)){ | + | if(packetContext.getPlayer().world.canSetBlock(pos)){ |
// Turn to diamond | // Turn to diamond | ||
packetContext.getPlayer().world.setBlockState(pos, | packetContext.getPlayer().world.setBlockState(pos, |
tutorial/networking.txt · Last modified: 2024/04/24 18:53 by skycatminepokie