Skip to content

Commit 6c0ef27

Browse files
committed
docs: rewrite reference, containers, crafting, effects, enchantments, networking, storage, tile-entities in casual tone
1 parent b92f972 commit 6c0ef27

12 files changed

Lines changed: 226 additions & 226 deletions

File tree

src/content/docs/reference/entity-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Entity types are registered in `EntityIO::staticCtor()` in
88
`EntityIO::setId()` maps a factory function, an internal enum value (`eINSTANCEOF`),
99
a string identifier, and a numeric ID.
1010

11-
Entities that are spawnable in Creative mode via the Monster Placer (Spawn Egg) also
11+
Entities that can be spawned in Creative mode through the Monster Placer (Spawn Egg) also
1212
include egg colors and a name string ID.
1313

1414
## Entity ID Table
@@ -63,14 +63,14 @@ include egg colors and a name string ID.
6363

6464
:::note
6565
IDs 3-8, 19, 22-39, 42-47, 64-89, 100-119, 121-199, 201-999 are unassigned.
66-
The base types `Mob` (48) and `Monster` (49) are registered but serve as generic
66+
The base types `Mob` (48) and `Monster` (49) are registered but act as generic
6767
fallbacks; specific mob types override them.
6868
:::
6969

7070
## Spawnable Entities (Spawn Eggs)
7171

72-
The following entities can be spawned via the Monster Placer item (ID 383) using the
73-
entity ID as the data value. These are the entities registered with the
72+
These entities can be spawned with the Monster Placer item (ID 383) using the
73+
entity ID as the data value. They're the entities registered with the
7474
`SpawnableMobInfo` overload of `setId()`:
7575

7676
| Entity ID | Name | Egg Colors |

src/content/docs/reference/file-index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ title: Complete File Index
33
description: Index of all source files in both LCEMP modules.
44
---
55

6-
LCEMP consists of two modules: **Minecraft.World** (game logic, networking, world simulation) and **Minecraft.Client** (rendering, UI, platform integration, server hosting). This page indexes every `.cpp` and `.h` source file in both.
6+
LCEMP has two modules: **Minecraft.World** (game logic, networking, world simulation) and **Minecraft.Client** (rendering, UI, platform integration, server hosting). This page lists every `.cpp` and `.h` source file in both.
77

8-
**Totals: 1,567 files in Minecraft.World -- 1,392 files in Minecraft.Client -- 2,959 files overall.**
8+
**Totals: 1,567 files in Minecraft.World, 1,392 files in Minecraft.Client, 2,959 files overall.**
99

1010
---
1111

1212
## Minecraft.World (1,567 files)
1313

14-
All files reside in a flat directory (`Minecraft.World/`) except for 7 headers in `x64headers/`.
14+
All files live in a flat directory (`Minecraft.World/`) except for 7 headers in `x64headers/`.
1515

1616
### Tiles / Blocks (200 files)
1717

@@ -207,7 +207,7 @@ Platform-specific headers for Xbox 360 / x64: `extraX64.h`, `qnet.h`, `xmcore.h`
207207

208208
The Client module has a deeper directory structure with platform-specific subdirectories.
209209

210-
### Root Directory -- Rendering (174 files)
210+
### Root Directory: Rendering (174 files)
211211

212212
Core rendering, models, entity renderers, and particle effects at the top level.
213213

@@ -232,7 +232,7 @@ BreakingItemParticle, BubbleParticle, CritParticle, CritParticle2, DragonBreathP
232232

233233
</details>
234234

235-
### Root Directory -- Screens / UI (82 files)
235+
### Root Directory: Screens / UI (82 files)
236236

237237
<details>
238238
<summary>Screen classes</summary>
@@ -241,7 +241,7 @@ AbstractContainerScreen, AchievementPopup, AchievementScreen, Button, ChatScreen
241241

242242
</details>
243243

244-
### Root Directory -- Core Engine (90 files)
244+
### Root Directory: Core Engine (90 files)
245245

246246
<details>
247247
<summary>Core client classes</summary>
@@ -250,7 +250,7 @@ AllowAllCuller, Camera, Chunk, ClientConnection, ClientConstants, ClockTexture,
250250

251251
</details>
252252

253-
### Root Directory -- Textures (38 files)
253+
### Root Directory: Textures (38 files)
254254

255255
<details>
256256
<summary>Texture system</summary>
@@ -259,7 +259,7 @@ AbstractTexturePack, ArchiveFile, BufferedImage, DefaultTexturePack, DLCTextureP
259259

260260
</details>
261261

262-
### Root Directory -- Server (18 files)
262+
### Root Directory: Server (18 files)
263263

264264
<details>
265265
<summary>Server-side classes at root</summary>

src/content/docs/reference/item-ids.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description: Complete table of all item IDs in LCEMP.
55

66
Items are registered in `Item::staticCtor()` in
77
[`Minecraft.World/Item.cpp`](/lcemp-docs/reference/file-index/). Block IDs 0-255 also
8-
occupy the item ID space (blocks are automatically wrapped in `TileItem`). True item IDs
9-
start at 256.
8+
take up space in the item ID range (blocks are automatically wrapped in `TileItem`). True
9+
item IDs start at 256.
1010

1111
The constructor argument (e.g., `new Item(9)`) is an **internal slot index**. The actual
1212
item ID is `256 + slot`, declared as `*_Id` constants in `Item.h`.
@@ -195,14 +195,14 @@ IDs 0-255 are reserved for block items (see the [Block ID Registry](/lcemp-docs/
195195
| 2267 | `record_08` | where are we now |
196196

197197
:::note
198-
The field names `record_08` through `record_12` do not correspond 1:1 with their IDs
199-
due to records being added across different title updates. The table above reflects the
198+
The field names `record_08` through `record_12` don't match up 1:1 with their IDs
199+
because records were added across different title updates. The table above shows the
200200
actual assignments in the source.
201201
:::
202202

203203
## Tool Tiers
204204

205-
Tools are constructed with a `Tier` that determines durability, speed, damage, and
205+
Tools are built with a `Tier` that sets durability, speed, damage, and
206206
enchantability:
207207

208208
| Tier | Level | Durability | Speed | Damage Bonus | Enchantability |

src/content/docs/reference/packet-ids.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ title: Packet ID Registry
33
description: Complete table of all network packet IDs in LCEMP.
44
---
55

6-
Every packet in LCEMP is registered in `Packet::staticCtor()` inside `Minecraft.World/Packet.cpp`. The `map()` call signature is:
6+
Every packet in LCEMP is registered in `Packet::staticCtor()` inside `Minecraft.World/Packet.cpp`. The `map()` call signature looks like this:
77

88
```cpp
99
map(id, receiveOnClient, receiveOnServer, sendToAnyClient, renderStats, typeid, createFn)
1010
```
1111
1212
**Direction key:**
1313
14-
- **S->C** -- Server sends to client (`receiveOnClient = true`, `receiveOnServer = false`)
15-
- **C->S** -- Client sends to server (`receiveOnClient = false`, `receiveOnServer = true`)
16-
- **Both** -- Either direction (`receiveOnClient = true`, `receiveOnServer = true`)
14+
- **S->C** means the server sends it to the client (`receiveOnClient = true`, `receiveOnServer = false`)
15+
- **C->S** means the client sends it to the server (`receiveOnClient = false`, `receiveOnServer = true`)
16+
- **Both** means either direction (`receiveOnClient = true`, `receiveOnServer = true`)
1717
1818
## Packet Table
1919
@@ -108,11 +108,11 @@ map(id, receiveOnClient, receiveOnServer, sendToAnyClient, renderStats, typeid,
108108
| 254 | `GetInfoPacket` | C->S | no | Server list ping (added 1.8.2) |
109109
| 255 | `DisconnectPacket` | Both | yes | Disconnect / kick reason |
110110
111-
**Total registered packets: 88** (IDs 0--255, with gaps)
111+
**Total registered packets: 88** (IDs 0 to 255, with gaps)
112112
113113
## Unused / Commented-Out IDs
114114
115-
The following IDs appear in comments but are not registered:
115+
These IDs show up in comments but aren't registered:
116116
117117
| ID | Class Name | Notes |
118118
|----|-----------|-------|
@@ -125,9 +125,9 @@ The following IDs appear in comments but are not registered:
125125
126126
## Notes
127127
128-
- The **Broadcast** column corresponds to the `sendToAnyClient` parameter. When `yes`, the packet is sent to all connected clients. When `no`, it is sent per-dimension per-machine (a 4J splitscreen optimization).
129-
- Packets marked **(4J added)** are custom additions by 4J Studios for the Legacy Console Edition and do not exist in vanilla Java Edition.
130-
- `MoveEntityPacketSmall` (162--165) is an optimized variant of `MoveEntityPacket` (30--33) for smaller position deltas.
128+
- The **Broadcast** column matches the `sendToAnyClient` parameter. When `yes`, the packet goes to all connected clients. When `no`, it's sent per-dimension per-machine (a 4J splitscreen optimization).
129+
- Packets marked **(4J added)** are custom additions by 4J Studios for the Legacy Console Edition and don't exist in vanilla Java Edition.
130+
- `MoveEntityPacketSmall` (162 to 165) is an optimized version of `MoveEntityPacket` (30 to 33) for smaller position changes.
131131
- `ContainerSetSlotPacket` (103) has conditional direction: in non-content-package builds it can also be sent C->S for debug purposes.
132132
133133
**Source file:** `Minecraft.World/Packet.cpp`

src/content/docs/reference/tile-classes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Tile Class Index
33
description: Index of all Tile (block) subclasses in LCEMP.
44
---
55

6-
In LCEMP, blocks are called "Tiles." Every block type is a subclass of `Tile` (defined in `Minecraft.World/Tile.h`). Some tiles inherit from intermediate base classes that provide shared behavior.
6+
In LCEMP, blocks are called "Tiles." Every block type is a subclass of `Tile` (defined in `Minecraft.World/Tile.h`). Some tiles inherit from intermediate base classes that share common behavior.
77

88
## Inheritance Hierarchy
99

@@ -164,10 +164,10 @@ Tile
164164

165165
## Notes
166166

167-
- `Bush` is declared in `Bush.h` / `Bush.cpp` and is a Tile subclass for plant-type blocks. It does not follow the `*Tile.h` naming convention.
168-
- `LiquidTile` has two concrete subclasses -- `LiquidTileDynamic` and `LiquidTileStatic` -- defined in their own files, but they are not separate `*Tile.h` headers.
169-
- `FallingTile` (in `FallingTile.h`) extends `Entity`, not `Tile`. It is the falling-block entity (sand, gravel in motion), not a block type.
167+
- `Bush` is declared in `Bush.h` / `Bush.cpp` and is a Tile subclass for plant-type blocks. It doesn't follow the `*Tile.h` naming convention.
168+
- `LiquidTile` has two concrete subclasses (`LiquidTileDynamic` and `LiquidTileStatic`) defined in their own files, but they don't have separate `*Tile.h` headers.
169+
- `FallingTile` (in `FallingTile.h`) extends `Entity`, not `Tile`. It's the falling-block entity (sand, gravel in motion), not a block type.
170170
- The `Tile` base class itself is defined in `Tile.h` / `Tile.cpp` and holds the static tile registry (all block IDs are registered there).
171-
- Related tile items (e.g., `ClothTileItem`, `StoneSlabTileItem`, `TreeTileItem`) handle aux-data variants and are in separate files.
171+
- Related tile items (like `ClothTileItem`, `StoneSlabTileItem`, `TreeTileItem`) handle aux-data variants and live in separate files.
172172

173173
**Source directory:** `Minecraft.World/`

src/content/docs/world/containers.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: Container Menus
33
description: Inventory management and container menu system in LCEMP.
44
---
55

6-
LCEMP uses a two-layer container system: **Container** objects hold raw item data, and **AbstractContainerMenu** subclasses manage the GUI logic, slot layout, click handling, and synchronization between server and client.
6+
LCEMP uses a two-layer container system: **Container** objects hold the raw item data, and **AbstractContainerMenu** subclasses manage the GUI logic, slot layout, click handling, and sync between server and client.
77

88
## Container (data layer)
99

10-
`Container` is the pure-virtual interface every item-holding object implements. It defines the fundamental storage contract.
10+
`Container` is the pure-virtual interface that every item-holding object implements. It defines the basic storage contract.
1111

1212
**Key constants and methods:**
1313

@@ -34,7 +34,7 @@ LCEMP uses a two-layer container system: **Container** objects hold raw item dat
3434
| `MerchantContainer` | Villager trade slots | 3 slots: two payment, one result. Calls `updateSellItem()` on changes. Tracks `activeRecipe` and `selectionHint`. |
3535
| `EnchantmentContainer` | Enchanting table input | Extends `SimpleContainer` with a max stack size of 1 and menu callbacks. |
3636
| `RepairContainer` | Anvil input slots | Extends `SimpleContainer`. Triggers `RepairMenu::createResult()` on changes. |
37-
| `PlayerEnderChestContainer` | Per-player ender chest | Extends `SimpleContainer`. Persists via NBT through `setItemsByTag()` / `createTag()`. Tracks the currently active `EnderChestTileEntity`. |
37+
| `PlayerEnderChestContainer` | Per-player ender chest | Extends `SimpleContainer`. Persists through NBT with `setItemsByTag()` / `createTag()`. Tracks the currently active `EnderChestTileEntity`. |
3838

3939
## AbstractContainerMenu (GUI layer)
4040

@@ -60,18 +60,18 @@ LCEMP uses a two-layer container system: **Container** objects hold raw item dat
6060

6161
### Core methods
6262

63-
- **`addSlot(Slot*)`** -- Registers a slot, assigning it a sequential index.
64-
- **`broadcastChanges()`** -- Compares each slot against `lastSlots` and fires `ContainerListener::slotChanged()` on differences.
65-
- **`clicked(slotIndex, buttonNum, clickType, player)`** -- The central click dispatcher. Handles pickup, quick-move, swap, and clone logic. Manages carried items via the player's `Inventory`.
66-
- **`quickMoveStack(player, slotIndex)`** -- Virtual. Subclasses override to define shift-click transfer rules between slot regions.
67-
- **`moveItemStackTo(itemStack, start, end, backwards)`** -- Helper that moves items into a slot range, first trying to stack with existing items, then filling empty slots.
68-
- **`removed(player)`** -- Drops any carried item when the menu closes.
69-
- **`stillValid(player)`** -- Pure virtual. Each subclass defines the distance/validity check.
70-
- **`mayCombine(slot, item)`** -- Hook for dyeable armor and damaged item combination (4J addition).
63+
- **`addSlot(Slot*)`**: Registers a slot, giving it a sequential index.
64+
- **`broadcastChanges()`**: Compares each slot against `lastSlots` and fires `ContainerListener::slotChanged()` when things differ.
65+
- **`clicked(slotIndex, buttonNum, clickType, player)`**: The main click dispatcher. Handles pickup, quick-move, swap, and clone logic. Manages carried items through the player's `Inventory`.
66+
- **`quickMoveStack(player, slotIndex)`**: Virtual. Subclasses override this to define shift-click transfer rules between slot regions.
67+
- **`moveItemStackTo(itemStack, start, end, backwards)`**: Helper that moves items into a slot range, first trying to stack with existing items, then filling empty slots.
68+
- **`removed(player)`**: Drops any carried item when the menu closes.
69+
- **`stillValid(player)`**: Pure virtual. Each subclass defines the distance/validity check.
70+
- **`mayCombine(slot, item)`**: Hook for dyeable armor and damaged item combination (4J addition).
7171

7272
### Synchronization
7373

74-
The menu tracks `unSynchedPlayers` -- a set of players whose client state is out of date. `isSynched()` and `setSynched()` control this flag. Change detection uses `ItemInstance::matches()` to compare current slot contents against `lastSlots` snapshots.
74+
The menu tracks `unSynchedPlayers`, a set of players whose client state is out of date. `isSynched()` and `setSynched()` control this flag. Change detection uses `ItemInstance::matches()` to compare current slot contents against `lastSlots` snapshots.
7575

7676
`MenuBackup` provides transactional rollback support, storing snapshots keyed by `changeUid`. It supports `save()`, `rollback()`, and `deleteBackup()`.
7777

@@ -83,38 +83,38 @@ The menu tracks `unSynchedPlayers` -- a set of players whose client state is out
8383

8484
| Method | Purpose |
8585
|---|---|
86-
| `mayPlace(item)` | Whether the item can be placed here (overridden for type-restricted slots) |
86+
| `mayPlace(item)` | Whether the item can go here (overridden for type-restricted slots) |
8787
| `mayPickup(player)` | Whether the player can take the item out |
8888
| `getMaxStackSize()` | Stack limit for this slot (delegates to container by default) |
8989
| `set(item)` / `getItem()` | Read/write the slot contents |
9090
| `remove(count)` | Split items off the slot |
9191
| `onTake(player, item)` | Callback after a player takes items (used for achievements, XP) |
9292
| `swap(other)` | Swap contents with another slot |
9393
| `mayCombine(item)` | 4J addition for item combination support |
94-
| `combine(item)` | 4J addition that performs the combination |
94+
| `combine(item)` | 4J addition that does the combination |
9595
| `isAt(container, index)` | Identity check for finding a slot by its backing container and index |
9696

97-
Specialized slot subclasses exist within menus. For example, `BrewingStandMenu::PotionSlot` restricts placement to bottles and caps stack size at 1, while `BrewingStandMenu::IngredientsSlot` only accepts valid brewing ingredients.
97+
Specialized slot subclasses exist within menus. For example, `BrewingStandMenu::PotionSlot` only allows bottles and caps stack size at 1, while `BrewingStandMenu::IngredientsSlot` only accepts valid brewing ingredients.
9898

9999
## Menu subclasses
100100

101101
### InventoryMenu
102102

103-
The player's own inventory screen. Contains a 2x2 crafting grid, 4 armor slots, 27 main inventory slots, and 9 hotbar slots.
103+
The player's own inventory screen. Has a 2x2 crafting grid, 4 armor slots, 27 main inventory slots, and 9 hotbar slots.
104104

105105
| Region | Constant | Range |
106106
|---|---|---|
107107
| Result | `RESULT_SLOT` | 0 |
108-
| Crafting grid | `CRAFT_SLOT_START` .. `CRAFT_SLOT_END` | 1--4 |
109-
| Armor | `ARMOR_SLOT_START` .. `ARMOR_SLOT_END` | 5--8 |
110-
| Main inventory | `INV_SLOT_START` .. `INV_SLOT_END` | 9--35 |
111-
| Hotbar | `USE_ROW_SLOT_START` .. `USE_ROW_SLOT_END` | 36--44 |
108+
| Crafting grid | `CRAFT_SLOT_START` .. `CRAFT_SLOT_END` | 1-4 |
109+
| Armor | `ARMOR_SLOT_START` .. `ARMOR_SLOT_END` | 5-8 |
110+
| Main inventory | `INV_SLOT_START` .. `INV_SLOT_END` | 9-35 |
111+
| Hotbar | `USE_ROW_SLOT_START` .. `USE_ROW_SLOT_END` | 36-44 |
112112

113113
Overrides `slotsChanged()` to re-check crafting recipes. Supports `mayCombine` for dyeable armor.
114114

115115
### CraftingMenu
116116

117-
The 3x3 crafting table screen. Tied to a world position for the `stillValid()` distance check. Drops crafting grid contents on close via `removed()`.
117+
The 3x3 crafting table screen. Tied to a world position for the `stillValid()` distance check. Drops crafting grid contents on close through `removed()`.
118118

119119
### FurnaceMenu
120120

@@ -132,27 +132,27 @@ Shift-click logic routes fuel items to the fuel slot, smeltable items to the ing
132132

133133
Wraps a `BrewingStandTileEntity`. Uses custom slot classes:
134134

135-
- **`PotionSlot`** -- Restricts to potion bottles, max stack 1. Fires an achievement on take.
136-
- **`IngredientsSlot`** -- Restricts to valid brewing ingredients, max stack 1.
135+
- **`PotionSlot`**: Only takes potion bottles, max stack 1. Fires an achievement on take.
136+
- **`IngredientsSlot`**: Only takes valid brewing ingredients, max stack 1.
137137

138138
Broadcasts `brewTime` as data ID 0.
139139

140140
### EnchantmentMenu
141141

142-
Single input slot (max stack 1). Generates three random enchantment `costs[]` based on nearby bookshelves. `clickMenuButton()` applies the chosen enchantment, consuming player XP. Uses a `Random` seeded by `nameSeed`.
142+
Single input slot (max stack 1). Generates three random enchantment `costs[]` based on nearby bookshelves. `clickMenuButton()` applies the chosen enchantment, spending player XP. Uses a `Random` seeded by `nameSeed`.
143143

144144
### MerchantMenu
145145

146146
Three slots: two payment inputs and one result output. Wraps a `Merchant` (villager) and a `MerchantContainer`. The `setSelectionHint()` method syncs the selected trade recipe from the trade list GUI.
147147

148148
### RepairMenu (Anvil)
149149

150-
Two input slots and one result slot. Computes `cost` (XP levels) via `createResult()`. Supports item renaming through `setItemName()`. The `DATA_TOTAL_COST` (0) data ID broadcasts the repair cost to listeners.
150+
Two input slots and one result slot. Computes `cost` (XP levels) through `createResult()`. Supports item renaming with `setItemName()`. The `DATA_TOTAL_COST` (0) data ID broadcasts the repair cost to listeners.
151151

152152
### TrapMenu (Dispenser/Dropper)
153153

154154
Simple 9-slot grid wrapping a `DispenserTileEntity`. No special slot logic beyond standard quick-move between dispenser and inventory.
155155

156156
### ContainerMenu (Generic chest)
157157

158-
Used for single and double chests. Calculates `containerRows` from the container size and creates the appropriate slot grid. Calls `startOpen()` / `stopOpen()` for chest animations.
158+
Used for single and double chests. Calculates `containerRows` from the container size and creates the right slot grid. Calls `startOpen()` / `stopOpen()` for chest animations.

0 commit comments

Comments
 (0)