mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-24 06:51: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};
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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};
|
||||||
|
|
|
@ -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};
|
||||||
|
|
|
@ -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};
|
||||||
|
|
|
@ -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>,
|
||||||
|
|
|
@ -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