Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some minor typos #37

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We appreciate your interest in contributing to Pumpkin! This document outlines the guidelines for submitting bug reports, feature suggestions, and code changes.
Getting Started

The easisty way to get started is by asking for help in our [discord](https://discord.gg/wT8XjrjKkf)
The easiest way to get started is by asking for help in our [discord](https://discord.gg/wT8XjrjKkf)

### How to Contribute

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and customizable experience. It prioritizes performance and player enjoyment whi

![image](https://github.com/user-attachments/assets/7e2e865e-b150-4675-a2d5-b52f9900378e)

### What Pumpkin wants to achive:
### What Pumpkin wants to achieve:
- **Performance**: Leveraging multi-threading for maximum speed and efficiency.
- **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics.
- **Security**: Prioritizes security by preventing known exploits.
Expand Down Expand Up @@ -83,13 +83,13 @@ Make sure to generate chunks close to (0,0) since that is where the player gets

Then run:
> [!NOTE]
> This can take a while. Because we enabled heavy optimations for release builds
> This can take a while. Because we enabled heavy optimizations for release builds
```
RUSTFLAGS="-C target-cpu=native" cargo run --release
```

## Contributions
Contributions are welcome!. See [CONTRIBUTING.md](CONTRIBUTING.md)
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md)

## Communication
Consider joining our [discord](https://discord.gg/wT8XjrjKkf) to stay up-to-date on events, updates, and connect with other members.
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-inventory/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl PlayerInventory {
items: [None; 36],
armor: [None; 4],
offhand: None,
// TODO: What when player spawns in with an diffrent index ?
// TODO: What when player spawns in with an different index ?
selected: 0,
}
}
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.
Registery data usally send by the Clientbound Registery data Packet.
Registry data usually send by the Clientbound Registry data Packet.
A list of Registry entries can be found at https://wiki.vg/Registry_Data
2 changes: 1 addition & 1 deletion pumpkin-registry/src/damage_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const NAMES: &[&str] = &[
"wither_skull",
];

pub(super) fn entires() -> Vec<RegistryEntry<'static>> {
pub(super) fn entries() -> Vec<RegistryEntry<'static>> {
let items: Vec<_> = NAMES
.iter()
.map(|name| RegistryEntry {
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Registry {

let damage_types = Registry {
registry_id: "minecraft:damage_type".to_string(),
registry_entries: damage_type::entires(),
registry_entries: damage_type::entries(),
};
let paintings = Registry {
registry_id: "minecraft:painting_variant".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-text/src/click.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
#[serde(tag = "action", content = "value", rename_all = "snake_case")]
pub enum ClickEvent {
/// Opens an URL
/// Opens a URL
OpenUrl(String),
/// Works in signs, but only on the root text component
RunCommand(String),
Expand Down
4 changes: 2 additions & 2 deletions pumpkin-text/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub mod style;
#[serde(transparent)]
pub struct Text(pub Box<TextComponent>);

// Fepresents a Text component
// Represents a Text component
// Reference: https://wiki.vg/Text_formatting#Text_components
#[derive(Clone, Default, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TextComponent {
/// The actual text
#[serde(flatten)]
pub content: TextContent,
/// Style of the text. Bold, Italic, unterline, Color...
/// Style of the text. Bold, Italic, underline, Color...
/// Also has `ClickEvent
#[serde(flatten)]
pub style: Style,
Expand Down
8 changes: 4 additions & 4 deletions pumpkin-text/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ pub struct Style {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bold: Option<u8>,
/// Whether to render the content in italic.
/// Keep in mind that booleans are representet as bytes in nbt
/// Keep in mind that booleans are represented as bytes in nbt
#[serde(default, skip_serializing_if = "Option::is_none")]
pub italic: Option<u8>,
/// Whether to render the content in underlined.
/// Keep in mind that booleans are representet as bytes in nbt
/// Keep in mind that booleans are represented as bytes in nbt
#[serde(default, skip_serializing_if = "Option::is_none")]
pub underlined: Option<u8>,
/// Whether to render the content in strikethrough.
/// Keep in mind that booleans are representet as bytes in nbt
/// Keep in mind that booleans are represented as bytes in nbt
#[serde(default, skip_serializing_if = "Option::is_none")]
pub strikethrough: Option<u8>,
/// Whether to render the content in obfuscated.
/// Keep in mind that booleans are representet as bytes in nbt
/// Keep in mind that booleans are represented as bytes in nbt
#[serde(default, skip_serializing_if = "Option::is_none")]
pub obfuscated: Option<u8>,
/// When the text is shift-clicked by a player, this string is inserted in their chat input. It does not overwrite any existing text the player was writing. This only works in chat messages
Expand Down
4 changes: 2 additions & 2 deletions pumpkin-world/src/vector3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<T: Math + Copy> Vector3<T> {
Vector3 { x, y, z }
}

pub fn length_sqared(&self) -> T {
pub fn length_squared(&self) -> T {
self.x * self.x + self.y * self.y + self.z * self.z
}

Expand Down Expand Up @@ -45,7 +45,7 @@ impl<T: Math + Copy> Vector3<T> {

impl<T: Math + Copy + Float> Vector3<T> {
pub fn length(&self) -> T {
self.length_sqared().sqrt()
self.length_squared().sqrt()
}
pub fn normalize(&self) -> Self {
let length = self.length();
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-world/src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Level {

// /// Read one chunk in the world
// ///
// /// Do not use this function if reading many chunks is required, since in case those two chunks which are read seperately using `.read_chunk` are in the same region file, it will need to be opened and closed separately for both of them, leading to a performance loss.
// /// Do not use this function if reading many chunks is required, since in case those two chunks which are read separately using `.read_chunk` are in the same region file, it will need to be opened and closed separately for both of them, leading to a performance loss.
// pub async fn read_chunk(&self, chunk: (i32, i32)) -> Result<ChunkData, WorldError> {
// self.read_chunks(vec![chunk])
// .await
Expand Down
8 changes: 4 additions & 4 deletions pumpkin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct Client {

pub protocol_version: i32,
pub connection_state: ConnectionState,
pub encrytion: bool,
pub encryption: bool,
pub closed: bool,
pub token: Rc<Token>,
pub connection: TcpStream,
Expand All @@ -89,7 +89,7 @@ impl Client {
connection,
enc: PacketEncoder::default(),
dec: PacketDecoder::default(),
encrytion: true,
encryption: true,
closed: false,
client_packets_queue: VecDeque::new(),
}
Expand All @@ -105,7 +105,7 @@ impl Client {
&mut self,
shared_secret: &[u8], // decrypted
) -> Result<(), EncryptionError> {
self.encrytion = true;
self.encryption = true;
let crypt_key: [u8; 16] = shared_secret
.try_into()
.map_err(|_| EncryptionError::SharedWrongLength)?;
Expand Down Expand Up @@ -379,7 +379,7 @@ impl Client {
.unwrap_or_else(|_| self.close());
}
_ => {
log::warn!("Cant't kick in {:?} State", self.connection_state)
log::warn!("Can't kick in {:?} State", self.connection_state)
}
}
self.close()
Expand Down
8 changes: 4 additions & 4 deletions pumpkin/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod resource_pack;
const CURRENT_BASE_VERSION: &str = "1.0.0";

#[derive(Deserialize, Serialize)]
/// The idea is that Pumpkin should very customizable, You can Enable or Disable Features depning on your needs.
/// The idea is that Pumpkin should very customizable, You can Enable or Disable Features depending on your needs.
/// This also allows you get some Performance or Resource boosts.
/// Important: The Configuration should match Vanilla by default
pub struct AdvancedConfiguration {
Expand Down Expand Up @@ -182,7 +182,7 @@ impl AdvancedConfiguration {
if path.as_ref().exists() {
let toml = std::fs::read_to_string(path).expect("Couldn't read configuration");
let config: AdvancedConfiguration =
toml::from_str(toml.as_str()).expect("Couldn't parse features.toml, Proberbly old config, Replacing with a new one or just delete it");
toml::from_str(toml.as_str()).expect("Couldn't parse features.toml, Probably old config, Replacing with a new one or just delete it");
config.validate();
config
} else {
Expand All @@ -202,7 +202,7 @@ impl BasicConfiguration {
pub fn load<P: AsRef<Path>>(path: P) -> BasicConfiguration {
if path.as_ref().exists() {
let toml = std::fs::read_to_string(path).expect("Couldn't read configuration");
let config: BasicConfiguration = toml::from_str(toml.as_str()).expect("Couldn't parse configuration.toml, Proberbly old config, Replacing with a new one or just delete it");
let config: BasicConfiguration = toml::from_str(toml.as_str()).expect("Couldn't parse configuration.toml, Probably old config, Replacing with a new one or just delete it");
config.validate();
config
} else {
Expand All @@ -219,7 +219,7 @@ impl BasicConfiguration {
self.config_version, CURRENT_BASE_VERSION,
"Config version does not match used Config version. Please update your config"
);
assert!(self.view_distance >= 2, "View distance must be atleast 2");
assert!(self.view_distance >= 2, "View distance must be at least 2");
assert!(
self.view_distance <= 32,
"View distance must be less than 32"
Expand Down
2 changes: 1 addition & 1 deletion pumpkin/src/config/resource_pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct ResourcePackConfig {
pub resource_pack_url: String,
/// The SHA1 hash (40) of the resource pack.
pub resource_pack_sha1: String,
/// Custom propmt Text component, Leave blank for none
/// Custom prompt Text component, Leave blank for none
pub prompt_message: String,
/// Will force the Player to accept the resource pack
pub force: bool,
Expand Down