improve doc

This commit is contained in:
Snowiiii 2024-08-14 23:16:02 +02:00
parent 6459aef027
commit 8fa8b793ee
3 changed files with 58 additions and 2 deletions

View File

@ -22,7 +22,7 @@ Packets in the Pumpkin protocol are organized by functionality and state.
You can find all Minecraft Java packets at https://wiki.vg/Protocol. There you also can see in which [State](State) they are. You can find all Minecraft Java packets at https://wiki.vg/Protocol. There you also can see in which [State](State) they are.
You also can see all the information the Packets has which we can either Write or Read depending if its Serverbound or Clientbound You also can see all the information the Packets has which we can either Write or Read depending if its Serverbound or Clientbound
#### Adding a Packet #### Adding a Packet
Adding a Packet is easy. First you have to dereive serde Serialize. Adding a Packet is easy. First you have to dereive serde Serialize for Clientbound Packets or Deserialize for Serverbound packets.
```rust ```rust
#[derive(Serialize)] #[derive(Serialize)]
``` ```
@ -47,7 +47,8 @@ impl CPlayDisconnect {
} }
} }
``` ```
At the End everything should come together At the End everything should come together,
Thats a Clientbound Packet
```rust ```rust
#[derive(Serialize)] #[derive(Serialize)]
#[packet(0x1D)] #[packet(0x1D)]
@ -60,4 +61,12 @@ impl CPlayDisconnect {
Self { reason } Self { reason }
} }
} }
```
Thats a Serverbound packet
```rust
#[derive(Deserialize)]
#[packet(0x1D)]
pub struct CPlayDisconnect {
reason: TextComponent,
}
`` ``

View File

@ -19,6 +19,7 @@ pub struct Registry {
} }
impl Registry { impl Registry {
/// We should parse this from a JSON in the future
pub fn get_static() -> Vec<Self> { pub fn get_static() -> Vec<Self> {
let dimensions = Registry { let dimensions = Registry {
registry_id: "minecraft:dimension_type".to_string(), registry_id: "minecraft:dimension_type".to_string(),

46
pumpkin-text/README.md Normal file
View File

@ -0,0 +1,46 @@
### Pumpkin Text
Here we build Mojang's Textcomponent, Which is used across many places, Often where text is send to the player.
### Features
- Colors
- [ ] RBG
- [x] Black
- [x] Dark Blue
- [x] Dark Green
- [x] Dark Aqua
- [x] Dark Red
- [x] Dark Purple
- [x] Gold
- [x] Gray
- [x] Dark Gray
- [x] Blue
- [x] Green
- [x] Aqua
- [x] Red
- [x] Light Purple
- [x] Yellow
- [x] White
- Style
- [x] Bold
- [x] Italic
- [x] Underlined
- [x] Strikethrough
- [x] Obfuscated
- [x] Insertion
- Click Event
- [x] Open URL
- [x] Run Command
- [x] Suggest Command
- [x] Change Pange (Book)
- [x] Copy to Clipboard
- Hover Event
- [x] Show Text
- [x] Show Item
- [x] ShowEntity
- Fonts
- [x] Default
- [ ] Uniform (Unicode)
- [ ] Alt
- [ ] Illageralt
Reference: https://wiki.vg/Text_formatting