Skip to content

Commit

Permalink
improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Aug 14, 2024
1 parent 6459aef commit 8fa8b79
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pumpkin-protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 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
#[derive(Serialize)]
```
Expand All @@ -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
#[derive(Serialize)]
#[packet(0x1D)]
Expand All @@ -60,4 +61,12 @@ impl CPlayDisconnect {
Self { reason }
}
}
```
Thats a Serverbound packet
```rust
#[derive(Deserialize)]
#[packet(0x1D)]
pub struct CPlayDisconnect {
reason: TextComponent,
}
``
1 change: 1 addition & 0 deletions pumpkin-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct Registry {
}

impl Registry {
/// We should parse this from a JSON in the future
pub fn get_static() -> Vec<Self> {
let dimensions = Registry {
registry_id: "minecraft:dimension_type".to_string(),
Expand Down
46 changes: 46 additions & 0 deletions pumpkin-text/README.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8fa8b79

Please sign in to comment.