mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 22:41:30 +11:00
cargo fmt
This commit is contained in:
parent
58fce9f3aa
commit
30e05bb373
|
@ -3,7 +3,9 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use valence::block::{BlockPos, BlockState};
|
use valence::block::{BlockPos, BlockState};
|
||||||
use valence::client::{ClientEvent, ClientId, GameMode, InteractWithEntityKind, default_client_event};
|
use valence::client::{
|
||||||
|
default_client_event, ClientEvent, ClientId, GameMode, InteractWithEntityKind,
|
||||||
|
};
|
||||||
use valence::config::{Config, ServerListPing};
|
use valence::config::{Config, ServerListPing};
|
||||||
use valence::dimension::DimensionId;
|
use valence::dimension::DimensionId;
|
||||||
use valence::entity::{EntityEvent, EntityId, EntityKind};
|
use valence::entity::{EntityEvent, EntityId, EntityKind};
|
||||||
|
@ -270,4 +272,4 @@ impl Config for Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use num::Integer;
|
||||||
use rayon::iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator};
|
use rayon::iter::{IndexedParallelIterator, IntoParallelRefMutIterator, ParallelIterator};
|
||||||
use valence::biome::Biome;
|
use valence::biome::Biome;
|
||||||
use valence::block::BlockState;
|
use valence::block::BlockState;
|
||||||
use valence::client::{ClientEvent, default_client_event};
|
use valence::client::{default_client_event, ClientEvent};
|
||||||
use valence::config::{Config, ServerListPing};
|
use valence::config::{Config, ServerListPing};
|
||||||
use valence::dimension::{Dimension, DimensionId};
|
use valence::dimension::{Dimension, DimensionId};
|
||||||
use valence::entity::types::Pose;
|
use valence::entity::types::Pose;
|
||||||
|
@ -49,7 +49,7 @@ struct ServerState {
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct ClientState {
|
struct ClientState {
|
||||||
entity_id: EntityId
|
entity_id: EntityId,
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_PLAYERS: usize = 10;
|
const MAX_PLAYERS: usize = 10;
|
||||||
|
@ -266,4 +266,4 @@ impl Config for Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use valence::async_trait;
|
use valence::async_trait;
|
||||||
use valence::block::{BlockPos, BlockState};
|
use valence::block::{BlockPos, BlockState};
|
||||||
use valence::client::{GameMode, default_client_event};
|
use valence::client::{default_client_event, GameMode};
|
||||||
use valence::config::{Config, ServerListPing};
|
use valence::config::{Config, ServerListPing};
|
||||||
use valence::dimension::DimensionId;
|
use valence::dimension::DimensionId;
|
||||||
use valence::entity::{EntityId, EntityKind};
|
use valence::entity::{EntityId, EntityKind};
|
||||||
|
@ -221,4 +221,4 @@ fn fibonacci_spiral(n: usize) -> impl Iterator<Item = Vec3<f64>> {
|
||||||
let phi = (1.0 - 2.0 * y).acos();
|
let phi = (1.0 - 2.0 * y).acos();
|
||||||
Vec3::new(theta.cos() * phi.sin(), theta.sin() * phi.sin(), phi.cos())
|
Vec3::new(theta.cos() * phi.sin(), theta.sin() * phi.sin(), phi.cos())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use valence::async_trait;
|
use valence::async_trait;
|
||||||
use valence::block::{BlockPos, BlockState};
|
use valence::block::{BlockPos, BlockState};
|
||||||
use valence::client::{GameMode, default_client_event};
|
use valence::client::{default_client_event, GameMode};
|
||||||
use valence::config::{Config, ServerListPing};
|
use valence::config::{Config, ServerListPing};
|
||||||
use valence::dimension::DimensionId;
|
use valence::dimension::DimensionId;
|
||||||
use valence::entity::{EntityId, EntityKind, TrackedData};
|
use valence::entity::{EntityId, EntityKind, TrackedData};
|
||||||
|
@ -201,4 +201,4 @@ impl Config for Game {
|
||||||
e.state = false;
|
e.state = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use rayon::iter::ParallelIterator;
|
||||||
use valence::async_trait;
|
use valence::async_trait;
|
||||||
use valence::block::{BlockState, PropName, PropValue};
|
use valence::block::{BlockState, PropName, PropValue};
|
||||||
use valence::chunk::ChunkPos;
|
use valence::chunk::ChunkPos;
|
||||||
use valence::client::{GameMode, default_client_event};
|
use valence::client::{default_client_event, GameMode};
|
||||||
use valence::config::{Config, ServerListPing};
|
use valence::config::{Config, ServerListPing};
|
||||||
use valence::dimension::DimensionId;
|
use valence::dimension::DimensionId;
|
||||||
use valence::entity::{EntityId, EntityKind};
|
use valence::entity::{EntityId, EntityKind};
|
||||||
|
@ -345,4 +345,4 @@ fn fbm(noise: &SuperSimplex, p: [f64; 3], octaves: u32, lacunarity: f64, persist
|
||||||
|
|
||||||
fn noise01(noise: &SuperSimplex, xyz: [f64; 3]) -> f64 {
|
fn noise01(noise: &SuperSimplex, xyz: [f64; 3]) -> f64 {
|
||||||
(noise.get(xyz) + 1.0) / 2.0
|
(noise.get(xyz) + 1.0) / 2.0
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,15 @@ use std::time::Duration;
|
||||||
|
|
||||||
use vek::Vec3;
|
use vek::Vec3;
|
||||||
|
|
||||||
|
use super::Client;
|
||||||
use crate::block_pos::BlockPos;
|
use crate::block_pos::BlockPos;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::entity::types::Pose;
|
use crate::entity::types::Pose;
|
||||||
use crate::entity::{EntityId, EntityEvent, Entity, TrackedData};
|
use crate::entity::{Entity, EntityEvent, EntityId, TrackedData};
|
||||||
use crate::protocol::packets::c2s::play::BlockFace;
|
use crate::protocol::packets::c2s::play::BlockFace;
|
||||||
pub use crate::protocol::packets::c2s::play::{ChatMode, DisplayedSkinParts, Hand, MainHand};
|
pub use crate::protocol::packets::c2s::play::{ChatMode, DisplayedSkinParts, Hand, MainHand};
|
||||||
pub use crate::protocol::packets::s2c::play::GameMode;
|
pub use crate::protocol::packets::s2c::play::GameMode;
|
||||||
|
|
||||||
use super::Client;
|
|
||||||
|
|
||||||
/// Represents an action performed by a client.
|
/// Represents an action performed by a client.
|
||||||
///
|
///
|
||||||
/// Client events can be obtained from
|
/// Client events can be obtained from
|
||||||
|
@ -137,7 +136,8 @@ pub enum DiggingStatus {
|
||||||
Finish,
|
Finish,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Standard client event handler that stores various things a player may do. Used to avoid extra boilerplate.
|
/// Standard client event handler that stores various things a player may do.
|
||||||
|
/// Used to avoid extra boilerplate.
|
||||||
pub fn default_client_event<C: Config>(
|
pub fn default_client_event<C: Config>(
|
||||||
client: &mut Client<C>,
|
client: &mut Client<C>,
|
||||||
entity: &mut Entity<C>,
|
entity: &mut Entity<C>,
|
||||||
|
@ -252,4 +252,4 @@ pub fn default_client_event<C: Config>(
|
||||||
entity.set_world(client.world());
|
entity.set_world(client.world());
|
||||||
|
|
||||||
Some(event)
|
Some(event)
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,6 @@
|
||||||
html_logo_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg",
|
html_logo_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg",
|
||||||
html_favicon_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg"
|
html_favicon_url = "https://raw.githubusercontent.com/rj00a/valence/main/assets/logo.svg"
|
||||||
)]
|
)]
|
||||||
|
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(
|
#![warn(
|
||||||
trivial_casts,
|
trivial_casts,
|
||||||
|
|
Loading…
Reference in a new issue