Skip to content

Commit

Permalink
include readmes in crate lvl docs, improve clarity, fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
earomc committed Aug 29, 2024
1 parent 0c886ea commit 0d21436
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pumpkin-protocol/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### Pumpkin Protocol
Contains all Serverbound(Client->Server) and Clientbound(Server->Client) Packets.
Contains all serverbound and clientbound packets.

**Clientbound** meaning that it's a packet being sent from the server to the client. (Server->Client)

**Serverbound** meaning that it's a packet the client sends to the server. (Client->Server)

Packets in the Pumpkin protocol are organized by functionality and state.

Expand Down
2 changes: 2 additions & 0 deletions pumpkin-protocol/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../README.md")]

use bytebuf::{packet_id::Packet, ByteBuffer, DeserializerError};
use bytes::Buf;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-registry/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Pumpkin Registry
Here you find all the registry data we have.
Registries are repositories of data that contain entries pertaining to certain aspects of the game, such as the world, the player, among others.
Registry data usually send by the Clientbound Registry data Packet.
Registry data is usually send by the clientbound CRegistryData packet.
A list of Registry entries can be found at https://wiki.vg/Registry_Data
2 changes: 2 additions & 0 deletions pumpkin-registry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../README.md")]

use biomes::Biome;
use chat_type::ChatType;
use dimensions::Dimension;
Expand Down
1 change: 1 addition & 0 deletions pumpkin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl Default for PlayerConfig {
}
}

/// Represents a Minecraft client connected to, or attempting to connect to the server.
pub struct Client {
pub gameprofile: Option<GameProfile>,

Expand Down
3 changes: 2 additions & 1 deletion pumpkin/src/client/player_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ fn modulus(a: f32, b: f32) -> f32 {
((a % b) + b) % b
}

/// Handles all Play Packets send by a real Player
/// Contains method implementations for handling play packets regarding a specific Minecraft player connected to the server.
/// Handles all Play packets sent by a real Player
/// NEVER TRUST THE CLIENT. HANDLE EVERY ERROR, UNWRAP/EXPECT ARE FORBIDDEN
impl Player {
pub fn handle_confirm_teleport(
Expand Down
3 changes: 3 additions & 0 deletions pumpkin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![doc = include_str!("../../README.md")]
#![doc = include_str!("../../STRUCTURE.md")]

#![allow(clippy::await_holding_refcell_ref)]
#![allow(clippy::await_holding_lock)]

Expand Down

0 comments on commit 0d21436

Please sign in to comment.