Fixed Some typos
This commit is contained in:
parent
09d6eb6da2
commit
484009bb9e
@ -33,15 +33,21 @@ The Documentation of Pumpkin can be found at <https://pumpkinmc.org/>
|
||||
|
||||
### Coding Guidelines
|
||||
|
||||
Things need to be done before this Pull Request can be merged. Your CI also checks most of them automaticly and fill fail if something is not fulfilled
|
||||
Note: Pumpkin's clippy settings are relativly strict, this can be may frustrating but is necesarry so the code says clean and conssistent
|
||||
Things need to be done before this Pull Request can be merged. Your CI also checks most of them automatically and fill fail if something is not fulfilled
|
||||
Note: Pumpkin's clippy settings are relatively strict, this can be may frustrating but is necessary so the code says clean and conssistent
|
||||
**Basic**
|
||||
|
||||
- **Code Formatting:** Code must be well-formatted and follow the project's style guidelines. You can achieve this by running `cargo fmt`.
|
||||
- **No Clippy Warnings:** Code should not produce any warnings from the Clippy linter. You can check for warnings using `cargo clippy --all-targets`.
|
||||
- **Title:** Use a concise and informative title that clearly communicates the purpose of the PR. Anyone reviewing the PR should quickly understand the changes being proposed.
|
||||
- **Description:** Provide a comprehensive description of the changes. Explain:
|
||||
- What was changed?
|
||||
- Why was this change necessary?
|
||||
- What is the impact of this change?
|
||||
- Are there any known issues or limitations?
|
||||
- Include any relevant context, such as related issues or discussions.
|
||||
- **No Clippy Warnings:** Address all warnings reported by the Clippy linter. You can check for warnings using `cargo clippy --all-targets`.
|
||||
- **Passing Unit Tests:** All existing unit tests must pass successfully. You can run the tests with `cargo test`.
|
||||
|
||||
**Best Pratice**
|
||||
**Best Practice**
|
||||
|
||||
- **Writing Unit Tests:** When adding new features or modifying existing code, consider adding unit tests to prevent regressions in the future. Refer to the Rust documentation for guidance on writing tests: https://doc.rust-lang.org/book/ch11-01-writing-tests.html
|
||||
- **Benchmarking:** If your changes might impact performance, consider adding benchmarks to track performance regressions or improvements. We use the Criterion library for benchmarking. Refer to their Quick Start guide for more information: https://github.com/bheisler/criterion.rs#quickstart
|
||||
|
||||
@ -67,7 +67,7 @@ and customizable experience. It prioritizes performance and player enjoyment whi
|
||||
- [x] Player Inventory
|
||||
- [x] Player Combat
|
||||
- Entities
|
||||
- [ ] Non-Living (Minecart, Eggs...)
|
||||
- [x] Non-Living (Minecart, Eggs...)
|
||||
- [x] Players
|
||||
- [x] Mobs
|
||||
- [x] Animals
|
||||
@ -82,6 +82,7 @@ and customizable experience. It prioritizes performance and player enjoyment whi
|
||||
- [x] Chat
|
||||
- [x] Commands
|
||||
- [x] Permissions
|
||||
- [x] Translations
|
||||
- Proxy
|
||||
- [x] Bungeecord
|
||||
- [x] Velocity
|
||||
|
||||
@ -1 +1 @@
|
||||
pub mod entity_registry;
|
||||
pub mod registry;
|
||||
|
||||
@ -26,12 +26,12 @@ pub struct LootPoolEntry {
|
||||
#[serde(rename = "snake_case")]
|
||||
pub enum LootTableType {
|
||||
#[serde(rename = "minecraft:empty")]
|
||||
/// Nothing will be droped
|
||||
/// Nothing will be dropped
|
||||
Empty,
|
||||
#[serde(rename = "minecraft:block")]
|
||||
/// A Block will be droped
|
||||
/// A Block will be dropped
|
||||
Block,
|
||||
#[serde(rename = "minecraft:chest")]
|
||||
/// A Item will be droped
|
||||
/// A Item will be dropped
|
||||
Chest,
|
||||
}
|
||||
|
||||
@ -4,13 +4,13 @@ use pumpkin_util::math::vector3::Vector3;
|
||||
|
||||
use super::{living::LivingEntity, Entity, EntityBase};
|
||||
|
||||
pub struct ThrownItem {
|
||||
pub struct ThrownItemEntity {
|
||||
entity: Entity,
|
||||
}
|
||||
|
||||
const DEG_PER_RAD_F32: f32 = 180.0 / PI;
|
||||
|
||||
impl ThrownItem {
|
||||
impl ThrownItemEntity {
|
||||
pub fn new(entity: Entity, owner: &Entity) -> Self {
|
||||
let mut owner_pos = owner.pos.load();
|
||||
owner_pos.y = (owner_pos.y + f64::from(owner.standing_eye_height)) - 0.1;
|
||||
@ -77,7 +77,7 @@ impl ThrownItem {
|
||||
}
|
||||
}
|
||||
|
||||
impl EntityBase for ThrownItem {
|
||||
impl EntityBase for ThrownItemEntity {
|
||||
fn get_entity(&self) -> &Entity {
|
||||
&self.entity
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::entity::player::Player;
|
||||
use crate::entity::projectile::ThrownItem;
|
||||
use crate::entity::projectile::ThrownItemEntity;
|
||||
use crate::item::pumpkin_item::PumpkinItem;
|
||||
use crate::server::Server;
|
||||
use async_trait::async_trait;
|
||||
@ -28,7 +28,7 @@ impl PumpkinItem for EggItem {
|
||||
.await;
|
||||
// TODO: Implement eggs the right way, so there is a chance of spawning chickens
|
||||
let entity = server.add_entity(position, EntityType::Egg, world);
|
||||
let snowball = ThrownItem::new(entity, &player.living_entity.entity);
|
||||
let snowball = ThrownItemEntity::new(entity, &player.living_entity.entity);
|
||||
let yaw = player.living_entity.entity.yaw.load();
|
||||
let pitch = player.living_entity.entity.pitch.load();
|
||||
snowball.set_velocity_from(&player.living_entity.entity, pitch, yaw, 0.0, POWER, 1.0);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::entity::player::Player;
|
||||
use crate::entity::projectile::ThrownItem;
|
||||
use crate::entity::projectile::ThrownItemEntity;
|
||||
use crate::item::pumpkin_item::PumpkinItem;
|
||||
use crate::server::Server;
|
||||
use async_trait::async_trait;
|
||||
@ -27,7 +27,7 @@ impl PumpkinItem for SnowBallItem {
|
||||
)
|
||||
.await;
|
||||
let entity = server.add_entity(position, EntityType::Snowball, world);
|
||||
let snowball = ThrownItem::new(entity, &player.living_entity.entity);
|
||||
let snowball = ThrownItemEntity::new(entity, &player.living_entity.entity);
|
||||
let yaw = player.living_entity.entity.yaw.load();
|
||||
let pitch = player.living_entity.entity.pitch.load();
|
||||
snowball.set_velocity_from(&player.living_entity.entity, pitch, yaw, 0.0, POWER, 1.0);
|
||||
|
||||
@ -49,7 +49,7 @@ use pumpkin_world::item::registry::{get_item_by_id, get_name_by_id};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::{
|
||||
block::{registry::get_block_by_item, BlockDirection},
|
||||
entity::entity_registry::get_entity_id,
|
||||
entity::registry::get_entity_id,
|
||||
item::registry::get_spawn_egg,
|
||||
};
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_util::GameMode;
|
||||
use pumpkin_world::block::registry::Block;
|
||||
use pumpkin_world::dimension::Dimension;
|
||||
use pumpkin_world::entity::entity_registry::get_entity_by_id;
|
||||
use pumpkin_world::entity::registry::get_entity_by_id;
|
||||
use rand::prelude::SliceRandom;
|
||||
use std::collections::HashMap;
|
||||
use std::net::IpAddr;
|
||||
|
||||
@ -8,13 +8,6 @@ pub struct LevelTime {
|
||||
pub rain_time: i64,
|
||||
}
|
||||
|
||||
pub enum DayTime {
|
||||
Day = 1000,
|
||||
Night = 13000,
|
||||
Noon = 6000,
|
||||
Midnight = 18000,
|
||||
}
|
||||
|
||||
impl Default for LevelTime {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user