tutorial:side
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:side [2019/05/12 12:22] – tyra314 | tutorial:side [2019/05/26 15:28] – [Communication] Add information about in-memory vs. networked packets jamieswhiteshirt | ||
---|---|---|---|
Line 22: | Line 22: | ||
===== Logical Sides ===== | ===== Logical Sides ===== | ||
- | Logical sides are about the actual logic running during the execution. | + | Logical sides are about the actual |
- | The client does rendering, sends player inputs to the server, handles resource packs, and the server | + | The logical |
- | The logical | + | The client |
net.minecraft.world.World | net.minecraft.world.World | ||
net.minecraft.entity.Entity | net.minecraft.entity.Entity | ||
net.minecraft.block.entity.BlockEntity | net.minecraft.block.entity.BlockEntity | ||
</ | </ | ||
- | These shared classes | + | These replicated objects |
- | + | ||
- | Usually, to distinguish | + | |
===== Detailed look into all sides ===== | ===== Detailed look into all sides ===== | ||
Line 65: | Line 62: | ||
==== Logical Server ==== | ==== Logical Server ==== | ||
- | The logical server is where most of the game logic is going on. Data packs, world updates, block entity and entity ticks, mob AI, game/world saving, | + | The logical server is where most of the game logic is executed. Data packs, world updates, block entity and entity ticks, mob AI, game/world saving, |
The logical server on the physical client is called the " | The logical server on the physical client is called the " | ||
- | The logical server | + | The logical server runs in its own main thread, even on physical servers, |
- | + | ||
- | Most universal mods target the logical server so that they can work on physical sides. | + | |
+ | Most universal mods target the logical server so that they can work both in single player and multi player scenarios. | ||
===== Communication===== | ===== Communication===== | ||
- | The only correct way to exchange data between | + | The only correct way to exchange data between |
Logical clients send C2S (Client-To-Server) packets to the logical server. | Logical clients send C2S (Client-To-Server) packets to the logical server. | ||
The logical server sends S2C (Server-To-Client) packets the logical clients. | The logical server sends S2C (Server-To-Client) packets the logical clients. | ||
- | Packets are sent be a write method in a network thread and received by a call to a read method in a network thread. | + | Packets are sent by a write method in a network thread and received by a call to a read method in a network thread. |
For more details on how to handle networking, see [[tutorial: | For more details on how to handle networking, see [[tutorial: |
tutorial/side.txt · Last modified: 2022/04/13 04:32 by 127.0.0.1