Fix some minor typos
This commit is contained in:
parent
43fbb6a68d
commit
1a21290e0f
@ -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.
|
We appreciate your interest in contributing to Pumpkin! This document outlines the guidelines for submitting bug reports, feature suggestions, and code changes.
|
||||||
Getting Started
|
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
|
### How to Contribute
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ and customizable experience. It prioritizes performance and player enjoyment whi
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### What Pumpkin wants to achive:
|
### What Pumpkin wants to achieve:
|
||||||
- **Performance**: Leveraging multi-threading for maximum speed and efficiency.
|
- **Performance**: Leveraging multi-threading for maximum speed and efficiency.
|
||||||
- **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics.
|
- **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics.
|
||||||
- **Security**: Prioritizes security by preventing known exploits.
|
- **Security**: Prioritizes security by preventing known exploits.
|
||||||
@ -83,13 +83,13 @@ Make sure to generate chunks close to (0,0) since that is where the player gets
|
|||||||
|
|
||||||
Then run:
|
Then run:
|
||||||
> [!NOTE]
|
> [!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
|
RUSTFLAGS="-C target-cpu=native" cargo run --release
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
Contributions are welcome!. See [CONTRIBUTING.md](CONTRIBUTING.md)
|
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||||
|
|
||||||
## Communication
|
## Communication
|
||||||
Consider joining our [discord](https://discord.gg/wT8XjrjKkf) to stay up-to-date on events, updates, and connect with other members.
|
Consider joining our [discord](https://discord.gg/wT8XjrjKkf) to stay up-to-date on events, updates, and connect with other members.
|
||||||
|
|||||||
@ -21,7 +21,7 @@ impl PlayerInventory {
|
|||||||
items: [None; 36],
|
items: [None; 36],
|
||||||
armor: [None; 4],
|
armor: [None; 4],
|
||||||
offhand: None,
|
offhand: None,
|
||||||
// TODO: What when player spawns in with an diffrent index ?
|
// TODO: What when player spawns in with an different index ?
|
||||||
selected: 0,
|
selected: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
### Pumpkin Registry
|
### Pumpkin Registry
|
||||||
Here you find all the registry data we have.
|
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.
|
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
|
A list of Registry entries can be found at https://wiki.vg/Registry_Data
|
||||||
@ -63,7 +63,7 @@ const NAMES: &[&str] = &[
|
|||||||
"wither_skull",
|
"wither_skull",
|
||||||
];
|
];
|
||||||
|
|
||||||
pub(super) fn entires() -> Vec<RegistryEntry<'static>> {
|
pub(super) fn entries() -> Vec<RegistryEntry<'static>> {
|
||||||
let items: Vec<_> = NAMES
|
let items: Vec<_> = NAMES
|
||||||
.iter()
|
.iter()
|
||||||
.map(|name| RegistryEntry {
|
.map(|name| RegistryEntry {
|
||||||
|
|||||||
@ -64,7 +64,7 @@ impl Registry {
|
|||||||
|
|
||||||
let damage_types = Registry {
|
let damage_types = Registry {
|
||||||
registry_id: "minecraft:damage_type".to_string(),
|
registry_id: "minecraft:damage_type".to_string(),
|
||||||
registry_entries: damage_type::entires(),
|
registry_entries: damage_type::entries(),
|
||||||
};
|
};
|
||||||
let paintings = Registry {
|
let paintings = Registry {
|
||||||
registry_id: "minecraft:painting_variant".to_string(),
|
registry_id: "minecraft:painting_variant".to_string(),
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "action", content = "value", rename_all = "snake_case")]
|
#[serde(tag = "action", content = "value", rename_all = "snake_case")]
|
||||||
pub enum ClickEvent {
|
pub enum ClickEvent {
|
||||||
/// Opens an URL
|
/// Opens a URL
|
||||||
OpenUrl(String),
|
OpenUrl(String),
|
||||||
/// Works in signs, but only on the root text component
|
/// Works in signs, but only on the root text component
|
||||||
RunCommand(String),
|
RunCommand(String),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ pub mod style;
|
|||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
pub struct Text(pub Box<TextComponent>);
|
pub struct Text(pub Box<TextComponent>);
|
||||||
|
|
||||||
// Fepresents a Text component
|
// Represents a Text component
|
||||||
// Reference: https://wiki.vg/Text_formatting#Text_components
|
// Reference: https://wiki.vg/Text_formatting#Text_components
|
||||||
#[derive(Clone, Default, Debug, Deserialize)]
|
#[derive(Clone, Default, Debug, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
@ -24,7 +24,7 @@ pub struct TextComponent {
|
|||||||
/// The actual text
|
/// The actual text
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub content: TextContent,
|
pub content: TextContent,
|
||||||
/// Style of the text. Bold, Italic, unterline, Color...
|
/// Style of the text. Bold, Italic, underline, Color...
|
||||||
/// Also has `ClickEvent
|
/// Also has `ClickEvent
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
|
|||||||
@ -13,19 +13,19 @@ pub struct Style {
|
|||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub bold: Option<u8>,
|
pub bold: Option<u8>,
|
||||||
/// Whether to render the content in italic.
|
/// 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")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub italic: Option<u8>,
|
pub italic: Option<u8>,
|
||||||
/// Whether to render the content in underlined.
|
/// 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")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub underlined: Option<u8>,
|
pub underlined: Option<u8>,
|
||||||
/// Whether to render the content in strikethrough.
|
/// 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")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub strikethrough: Option<u8>,
|
pub strikethrough: Option<u8>,
|
||||||
/// Whether to render the content in obfuscated.
|
/// 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")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub obfuscated: Option<u8>,
|
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
|
/// 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
|
||||||
|
|||||||
@ -14,7 +14,7 @@ impl<T: Math + Copy> Vector3<T> {
|
|||||||
Vector3 { x, y, z }
|
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
|
self.x * self.x + self.y * self.y + self.z * self.z
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ impl<T: Math + Copy> Vector3<T> {
|
|||||||
|
|
||||||
impl<T: Math + Copy + Float> Vector3<T> {
|
impl<T: Math + Copy + Float> Vector3<T> {
|
||||||
pub fn length(&self) -> T {
|
pub fn length(&self) -> T {
|
||||||
self.length_sqared().sqrt()
|
self.length_squared().sqrt()
|
||||||
}
|
}
|
||||||
pub fn normalize(&self) -> Self {
|
pub fn normalize(&self) -> Self {
|
||||||
let length = self.length();
|
let length = self.length();
|
||||||
|
|||||||
@ -81,7 +81,7 @@ impl Level {
|
|||||||
|
|
||||||
// /// Read one chunk in the world
|
// /// 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> {
|
// pub async fn read_chunk(&self, chunk: (i32, i32)) -> Result<ChunkData, WorldError> {
|
||||||
// self.read_chunks(vec![chunk])
|
// self.read_chunks(vec![chunk])
|
||||||
// .await
|
// .await
|
||||||
|
|||||||
@ -65,7 +65,7 @@ pub struct Client {
|
|||||||
|
|
||||||
pub protocol_version: i32,
|
pub protocol_version: i32,
|
||||||
pub connection_state: ConnectionState,
|
pub connection_state: ConnectionState,
|
||||||
pub encrytion: bool,
|
pub encryption: bool,
|
||||||
pub closed: bool,
|
pub closed: bool,
|
||||||
pub token: Rc<Token>,
|
pub token: Rc<Token>,
|
||||||
pub connection: TcpStream,
|
pub connection: TcpStream,
|
||||||
@ -89,7 +89,7 @@ impl Client {
|
|||||||
connection,
|
connection,
|
||||||
enc: PacketEncoder::default(),
|
enc: PacketEncoder::default(),
|
||||||
dec: PacketDecoder::default(),
|
dec: PacketDecoder::default(),
|
||||||
encrytion: true,
|
encryption: true,
|
||||||
closed: false,
|
closed: false,
|
||||||
client_packets_queue: VecDeque::new(),
|
client_packets_queue: VecDeque::new(),
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ impl Client {
|
|||||||
&mut self,
|
&mut self,
|
||||||
shared_secret: &[u8], // decrypted
|
shared_secret: &[u8], // decrypted
|
||||||
) -> Result<(), EncryptionError> {
|
) -> Result<(), EncryptionError> {
|
||||||
self.encrytion = true;
|
self.encryption = true;
|
||||||
let crypt_key: [u8; 16] = shared_secret
|
let crypt_key: [u8; 16] = shared_secret
|
||||||
.try_into()
|
.try_into()
|
||||||
.map_err(|_| EncryptionError::SharedWrongLength)?;
|
.map_err(|_| EncryptionError::SharedWrongLength)?;
|
||||||
@ -379,7 +379,7 @@ impl Client {
|
|||||||
.unwrap_or_else(|_| self.close());
|
.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()
|
self.close()
|
||||||
|
|||||||
@ -15,7 +15,7 @@ pub mod resource_pack;
|
|||||||
const CURRENT_BASE_VERSION: &str = "1.0.0";
|
const CURRENT_BASE_VERSION: &str = "1.0.0";
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[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.
|
/// This also allows you get some Performance or Resource boosts.
|
||||||
/// Important: The Configuration should match Vanilla by default
|
/// Important: The Configuration should match Vanilla by default
|
||||||
pub struct AdvancedConfiguration {
|
pub struct AdvancedConfiguration {
|
||||||
@ -182,7 +182,7 @@ impl AdvancedConfiguration {
|
|||||||
if path.as_ref().exists() {
|
if path.as_ref().exists() {
|
||||||
let toml = std::fs::read_to_string(path).expect("Couldn't read configuration");
|
let toml = std::fs::read_to_string(path).expect("Couldn't read configuration");
|
||||||
let config: AdvancedConfiguration =
|
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.validate();
|
||||||
config
|
config
|
||||||
} else {
|
} else {
|
||||||
@ -202,7 +202,7 @@ impl BasicConfiguration {
|
|||||||
pub fn load<P: AsRef<Path>>(path: P) -> BasicConfiguration {
|
pub fn load<P: AsRef<Path>>(path: P) -> BasicConfiguration {
|
||||||
if path.as_ref().exists() {
|
if path.as_ref().exists() {
|
||||||
let toml = std::fs::read_to_string(path).expect("Couldn't read configuration");
|
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.validate();
|
||||||
config
|
config
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ pub struct ResourcePackConfig {
|
|||||||
pub resource_pack_url: String,
|
pub resource_pack_url: String,
|
||||||
/// The SHA1 hash (40) of the resource pack.
|
/// The SHA1 hash (40) of the resource pack.
|
||||||
pub resource_pack_sha1: String,
|
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,
|
pub prompt_message: String,
|
||||||
/// Will force the Player to accept the resource pack
|
/// Will force the Player to accept the resource pack
|
||||||
pub force: bool,
|
pub force: bool,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user