|
1 | 1 | package com.lambda.event.events |
2 | 2 |
|
3 | 3 | import com.lambda.event.Event |
4 | | -import com.lambda.event.EventFlow |
5 | | -import com.lambda.event.events.TickEvent.Post |
6 | | -import com.lambda.event.events.TickEvent.Pre |
7 | 4 |
|
8 | | -/** |
9 | | - * An abstract class representing a [TickEvent] in the [EventFlow]. |
10 | | - * |
11 | | - * A [TickEvent] is a type of [Event] that is triggered at each tick of the game loop. |
12 | | - * It has two subclasses: [Pre] and [Post], which are triggered before and after the tick, respectively. |
13 | | - * |
14 | | - * The [TickEvent] class is designed to be extended by any class that needs to react to ticks. |
15 | | - * |
16 | | - * @see Pre |
17 | | - * @see Post |
18 | | - */ |
19 | 5 | abstract class TickEvent : Event { |
20 | 6 | /** |
21 | | - * A class representing a [TickEvent] that is triggered before each tick of the tick loop. |
| 7 | + * Triggered before each iteration of the game loop. |
| 8 | + * |
| 9 | + * Phases: |
| 10 | + * |
| 11 | + * 1. **Pre-Tick**: Increments uptime, steps world tick manager, decrement item use cooldown. |
| 12 | + * 2. **GUI Update**: Processes delayed messages, updates HUD. |
| 13 | + * 3. **Game Mode Update**: Updates targeted entity, ticks tutorial, and interaction managers. |
| 14 | + * 4. **Texture Update**: Ticks texture manager. |
| 15 | + * 5. **Screen Handling**: Manages screen logic, ticks current screen. |
| 16 | + * 6. **Debug HUD Update**: Resets debug HUD chunk. |
| 17 | + * 7. **Input Handling**: Handles input events, decrements attack cooldown. |
| 18 | + * 8. **World Update**: Ticks game and world renderers, world entities. |
| 19 | + * 9. **Music and Sound Update**: Ticks music tracker and sound manager. |
| 20 | + * 10. **Tutorial and Social Interactions**: Handles tutorial and social interactions, ticks world. |
| 21 | + * 11. **Pending Connection**: Ticks integrated server connection. |
| 22 | + * 12. **Keyboard Handling**: Polls for debug crash key presses. |
| 23 | + * |
| 24 | + * @see net.minecraft.client.MinecraftClient.tick |
22 | 25 | */ |
23 | 26 | class Pre : TickEvent() |
24 | 27 |
|
25 | 28 | /** |
26 | | - * A class representing a [TickEvent] that is triggered after each tick of the tick loop. |
| 29 | + * Triggered after each iteration of the game loop. |
| 30 | + * Targeted at 20 ticks per second. |
| 31 | + * |
| 32 | + * Phases: |
| 33 | + * |
| 34 | + * 1. **Pre-Tick**: Increments uptime, steps world tick manager, decrement item use cooldown. |
| 35 | + * 2. **GUI Update**: Processes delayed messages, updates HUD. |
| 36 | + * 3. **Game Mode Update**: Updates targeted entity, ticks tutorial, and interaction managers. |
| 37 | + * 4. **Texture Update**: Ticks texture manager. |
| 38 | + * 5. **Screen Handling**: Manages screen logic, ticks current screen. |
| 39 | + * 6. **Debug HUD Update**: Resets debug HUD chunk. |
| 40 | + * 7. **Input Handling**: Handles input events, decrements attack cooldown. |
| 41 | + * 8. **World Update**: Ticks game and world renderers, world entities (such as [TickEvent.Player]). |
| 42 | + * 9. **Music and Sound Update**: Ticks music tracker and sound manager. |
| 43 | + * 10. **Tutorial and Social Interactions**: Handles tutorial and social interactions, ticks world. |
| 44 | + * 11. **Pending Connection**: Ticks integrated server connection. |
| 45 | + * 12. **Keyboard Handling**: Polls for debug crash key presses. |
| 46 | + * |
| 47 | + * @see net.minecraft.client.MinecraftClient.tick |
27 | 48 | */ |
28 | 49 | class Post : TickEvent() |
29 | 50 |
|
30 | 51 | /** |
31 | | - * A class representing a [TickEvent] that is triggered on each tick of the game loop. |
| 52 | + * Triggered before ([Pre]) and after ([Post]) each render tick. |
| 53 | + * |
| 54 | + * Phases: |
| 55 | + * |
| 56 | + * 1. **Pre-Render**: Prepares the window for rendering, checks for window close, handles resource reloads. |
| 57 | + * 2. **Task Execution**: Executes pending render tasks. |
| 58 | + * 3. **Client Tick**: Ticks the client ([TickEvent.Pre] and [TickEvent.Post]) until tick target was met. |
| 59 | + * 4. **Render**: Performs the actual rendering of the game. |
| 60 | + * 5. **Post-Render**: Finalizes the rendering process, updates the window. |
| 61 | + * |
| 62 | + * @see net.minecraft.client.MinecraftClient.render |
32 | 63 | */ |
33 | | - abstract class GameLoop : TickEvent() { |
| 64 | + abstract class Render : TickEvent() { |
34 | 65 | /** |
35 | | - * A class representing a [TickEvent.Player] that is triggered before each tick of the game loop. |
| 66 | + * Triggered before each render tick ([TickEvent.Render]) of the game loop. |
36 | 67 | */ |
37 | 68 | class Pre : TickEvent() |
38 | 69 |
|
39 | 70 | /** |
40 | | - * A class representing a [TickEvent.Player] that is triggered after each tick of the game loop. |
| 71 | + * Triggered after each render tick ([TickEvent.Render]) of the game loop. |
41 | 72 | */ |
42 | 73 | class Post : TickEvent() |
43 | 74 | } |
44 | 75 |
|
45 | 76 | /** |
46 | | - * A class representing a [TickEvent] that is triggered when the player gets ticked. |
| 77 | + * Triggered before ([Pre]) and after ([Post]) each player tick that is run during the game loop [TickEvent.Pre]. |
| 78 | + * |
| 79 | + * Phases: |
| 80 | + * |
| 81 | + * 1. **Pre-Tick**: Prepares player state before the tick. |
| 82 | + * 2. **Movement**: Handles player movement and input. |
| 83 | + * 3. **Action**: Processes player actions like swinging hand. |
| 84 | + * 4. **Post-Tick**: Finalizes player state after the tick. |
| 85 | + * |
| 86 | + * @see net.minecraft.client.network.ClientPlayerEntity.tick |
47 | 87 | */ |
48 | 88 | abstract class Player : TickEvent() { |
49 | 89 | /** |
50 | | - * A class representing a [TickEvent.Player] that is triggered before each player tick. |
| 90 | + * Triggered before each player tick ([TickEvent.Player]). |
51 | 91 | */ |
52 | 92 | class Pre : Player() |
53 | 93 |
|
54 | 94 | /** |
55 | | - * A class representing a [TickEvent.Player] that is triggered after each player tick. |
| 95 | + * Triggered after each player tick ([TickEvent.Player]). |
56 | 96 | */ |
57 | 97 | class Post : Player() |
58 | 98 | } |
|
0 commit comments