diff options
Diffstat (limited to 'azalea-core/src')
22 files changed, 82 insertions, 82 deletions
diff --git a/azalea-core/src/aabb.rs b/azalea-core/src/aabb.rs index 4e129ef7..052e6efb 100644 --- a/azalea-core/src/aabb.rs +++ b/azalea-core/src/aabb.rs @@ -8,7 +8,7 @@ use crate::{ /// An axis-aligned bounding box. /// /// In other words, a rectangular prism with a starting and ending point. -#[derive(Copy, Clone, Debug, PartialEq, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct Aabb { pub min: Vec3, pub max: Vec3, diff --git a/azalea-core/src/attribute_modifier_operation.rs b/azalea-core/src/attribute_modifier_operation.rs index ff92a44a..8418ff22 100644 --- a/azalea-core/src/attribute_modifier_operation.rs +++ b/azalea-core/src/attribute_modifier_operation.rs @@ -4,7 +4,7 @@ use azalea_buf::AzBuf; use serde::Serialize; use simdnbt::{FromNbtTag, borrow::NbtTag}; -#[derive(Clone, Copy, PartialEq, AzBuf, Debug, Serialize)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Serialize)] #[serde(rename_all = "snake_case")] pub enum AttributeModifierOperation { AddValue, diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs index 567ad020..6abb5d1d 100644 --- a/azalea-core/src/bitset.rs +++ b/azalea-core/src/bitset.rs @@ -6,7 +6,7 @@ use std::{ use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; /// Represents Java's BitSet, a list of bits. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, AzBuf)] +#[derive(AzBuf, Clone, Debug, Default, Eq, Hash, PartialEq)] pub struct BitSet { data: Vec<u64>, } @@ -178,7 +178,7 @@ impl From<Vec<u8>> for BitSet { /// Minecraft, and may not be as performant as it could be for other purposes. /// Consider using [`FastFixedBitSet`] if you don't need the /// `AzaleaRead`/`AzaleaWrite` implementation. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct FixedBitSet<const N: usize> where [u8; bits_to_bytes(N)]: Sized, @@ -254,7 +254,7 @@ pub const fn bits_to_bytes(n: usize) -> usize { /// /// This is almost identical to [`FixedBitSet`], but more efficient (~20% faster /// access) and doesn't implement `AzaleaRead`/`AzaleaWrite`. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct FastFixedBitSet<const N: usize> where [u64; bits_to_longs(N)]: Sized, diff --git a/azalea-core/src/checksum.rs b/azalea-core/src/checksum.rs index 490d5ea4..1d0d4860 100644 --- a/azalea-core/src/checksum.rs +++ b/azalea-core/src/checksum.rs @@ -9,7 +9,7 @@ use tracing::error; use crate::registry_holder::RegistryHolder; -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default, AzBuf)] +#[derive(AzBuf, Clone, Copy, Debug, Default, Eq, Ord, PartialEq, PartialOrd)] pub struct Checksum(pub u32); pub struct ChecksumSerializer<'a, 'r> { @@ -335,7 +335,7 @@ impl<'a, 'r> ser::SerializeSeq for ChecksumListSerializer<'a, 'r> { /// keep track of that when serializing the arrays. /// /// Byte arrays aren't included here as they're handled with `serialize_bytes`. -#[derive(Default, PartialEq, Eq)] +#[derive(Default, Eq, PartialEq)] enum ListKind { #[default] Normal, @@ -617,7 +617,7 @@ impl<'a> ser::Serializer for IntOrLongArrayChecksumSerializer<'a> { } } -#[derive(Error, Debug)] +#[derive(Debug, Error)] #[error("Checksum serialization error")] pub struct ChecksumError; impl ser::Error for ChecksumError { diff --git a/azalea-core/src/color.rs b/azalea-core/src/color.rs index ff727ccd..7780deae 100644 --- a/azalea-core/src/color.rs +++ b/azalea-core/src/color.rs @@ -1,6 +1,6 @@ use azalea_buf::AzBuf; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, AzBuf)] +#[derive(AzBuf, Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct RgbColor { value: u32, } @@ -25,7 +25,7 @@ impl RgbColor { } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, AzBuf)] +#[derive(AzBuf, Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ArgbColor { value: u32, } diff --git a/azalea-core/src/cursor3d.rs b/azalea-core/src/cursor3d.rs index 91a14000..ba893bb5 100644 --- a/azalea-core/src/cursor3d.rs +++ b/azalea-core/src/cursor3d.rs @@ -54,7 +54,7 @@ impl Iterator for Cursor3d { } #[repr(u8)] -#[derive(Eq, PartialEq, Debug)] +#[derive(Debug, Eq, PartialEq)] pub enum CursorIterationType { Inside = 0, Face = 1, diff --git a/azalea-core/src/delta.rs b/azalea-core/src/delta.rs index c193649a..055ba3b8 100644 --- a/azalea-core/src/delta.rs +++ b/azalea-core/src/delta.rs @@ -12,7 +12,7 @@ pub trait PositionDeltaTrait { } /// Only works for up to 8 blocks -#[derive(Clone, Debug, AzBuf, Default, PartialEq)] +#[derive(AzBuf, Clone, Debug, Default, PartialEq)] pub struct PositionDelta8 { pub xa: i16, pub ya: i16, @@ -74,7 +74,7 @@ impl Vec3 { /// /// Can be freely converted to and from a [`Vec3`], but some precision will be /// lost. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub enum LpVec3 { #[default] Zero, diff --git a/azalea-core/src/difficulty.rs b/azalea-core/src/difficulty.rs index 427be9aa..7a018a8e 100644 --- a/azalea-core/src/difficulty.rs +++ b/azalea-core/src/difficulty.rs @@ -5,7 +5,7 @@ use std::{ use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; -#[derive(Hash, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum Difficulty { Peaceful = 0, Easy = 1, diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs index fbd7f98b..b53df448 100644 --- a/azalea-core/src/direction.rs +++ b/azalea-core/src/direction.rs @@ -91,7 +91,7 @@ impl Direction { /// /// Note that azalea_block has a similar enum named `FacingCardinal` that is /// used for block states. -#[derive(Clone, Copy, Debug, AzBuf, PartialEq, Eq, Hash, serde::Deserialize, serde::Serialize)] +#[derive(AzBuf, Clone, Copy, Debug, serde::Deserialize, Eq, Hash, PartialEq, serde::Serialize)] pub enum CardinalDirection { North, South, diff --git a/azalea-core/src/game_type.rs b/azalea-core/src/game_type.rs index db1d6bc5..95d330d2 100644 --- a/azalea-core/src/game_type.rs +++ b/azalea-core/src/game_type.rs @@ -5,7 +5,7 @@ use azalea_chat::translatable_component::TranslatableComponent; use tracing::debug; /// A Minecraft gamemode, like survival or creative. -#[derive(Hash, Copy, Clone, Debug, Default, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub enum GameMode { #[default] Survival, @@ -115,7 +115,7 @@ impl AzaleaWrite for GameMode { /// Rust doesn't let us `impl AzaleaRead for Option<GameType>` so we have to /// make a new type :( -#[derive(Hash, Copy, Clone, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, Hash, PartialEq)] pub struct OptionalGameType(pub Option<GameMode>); impl From<Option<GameMode>> for OptionalGameType { diff --git a/azalea-core/src/hit_result.rs b/azalea-core/src/hit_result.rs index 2f3d2403..2b269aba 100644 --- a/azalea-core/src/hit_result.rs +++ b/azalea-core/src/hit_result.rs @@ -7,7 +7,7 @@ use crate::{ /// /// If there's nothing, it'll be a [`BlockHitResult`] with `miss` set to true. #[cfg(feature = "bevy_ecs")] -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum HitResult { Block(BlockHitResult), Entity(EntityHitResult), @@ -65,7 +65,7 @@ impl HitResult { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct BlockHitResult { pub location: Vec3, pub miss: bool, @@ -103,7 +103,7 @@ impl From<BlockHitResult> for HitResult { } #[cfg(feature = "bevy_ecs")] -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct EntityHitResult { pub location: Vec3, pub entity: bevy_ecs::entity::Entity, diff --git a/azalea-core/src/objectives.rs b/azalea-core/src/objectives.rs index 0975a3fd..a7fdc820 100644 --- a/azalea-core/src/objectives.rs +++ b/azalea-core/src/objectives.rs @@ -5,7 +5,7 @@ use std::{ use azalea_buf::AzBuf; -#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum ObjectiveCriteria { Integer, Hearts, diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 1deb1892..502d5c20 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -305,7 +305,7 @@ macro_rules! vec3_impl { /// Used to represent an exact position in the world where an entity could be. /// /// For blocks, [`BlockPos`] is used instead. -#[derive(Clone, Copy, Debug, Default, PartialEq, AzBuf, serde::Deserialize, serde::Serialize)] +#[derive(AzBuf, Clone, Copy, Debug, Default, serde::Deserialize, PartialEq, serde::Serialize)] pub struct Vec3 { pub x: f64, pub y: f64, @@ -373,7 +373,7 @@ impl Vec3 { } /// A lower precision [`Vec3`], used for some fields in entity metadata. -#[derive(Clone, Copy, Debug, Default, PartialEq, AzBuf)] +#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)] pub struct Vec3f32 { pub x: f32, pub y: f32, @@ -401,7 +401,7 @@ impl From<Vec3> for Vec3f32 { /// The coordinates of a block in the world. /// /// For entities (if the coordinates are floating-point), use [`Vec3`] instead. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub struct BlockPos { pub x: i32, pub y: i32, @@ -487,7 +487,7 @@ impl<'de> serde::Deserialize<'de> for BlockPos { /// /// This is similar to [`BlockPos`], but isn't limited to representing block /// positions and can represent a larger range of numbers. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, AzBuf)] +#[derive(AzBuf, Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub struct Vec3i { #[var] pub x: i32, @@ -508,7 +508,7 @@ impl simdnbt::FromNbtTag for Vec3i { /// Chunk coordinates are used to represent where a chunk is in the world. /// /// You can convert the x and z to block coordinates by multiplying them by 16. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ChunkPos { pub x: i32, pub z: i32, @@ -583,7 +583,7 @@ impl Hash for ChunkPos { impl nohash_hasher::IsEnabled for ChunkPos {} /// The coordinates of a chunk section in the world. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Debug, Default, Eq, Ord, PartialEq, PartialOrd)] pub struct ChunkSectionPos { pub x: i32, pub y: i32, @@ -598,7 +598,7 @@ impl ChunkSectionPos { } /// The coordinates of a block inside a chunk. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ChunkBlockPos { pub x: u8, pub y: i32, @@ -637,7 +637,7 @@ impl nohash_hasher::IsEnabled for ChunkBlockPos {} /// The coordinates of a block inside of a chunk section. /// /// Each coordinate should be in the range 0..=15. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ChunkSectionBlockPos { pub x: u8, pub y: u8, @@ -648,7 +648,7 @@ vec3_impl!(ChunkSectionBlockPos, u8); /// The coordinates of a biome inside of a chunk section. /// /// Each coordinate should be in the range 0..=3. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ChunkSectionBiomePos { pub x: u8, pub y: u8, @@ -675,7 +675,7 @@ vec3_impl!(ChunkSectionBiomePos, u8); /// The coordinates of a biome inside a chunk. /// /// Biomes are 4x4 blocks. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct ChunkBiomePos { pub x: u8, pub y: i32, @@ -733,7 +733,7 @@ impl From<ChunkSectionBlockPos> for u16 { impl nohash_hasher::IsEnabled for ChunkSectionBlockPos {} /// A block pos with an attached world -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Clone, Debug, PartialEq, Serialize)] pub struct GlobalPos { // this is actually a ResourceKey in Minecraft, but i don't think it matters? pub dimension: Identifier, @@ -891,7 +891,7 @@ impl fmt::Display for Vec3 { } /// A 2D vector. -#[derive(Clone, Copy, Debug, Default, PartialEq, AzBuf, simdnbt::Deserialize, Serialize)] +#[derive(AzBuf, Clone, Copy, Debug, Default, simdnbt::Deserialize, PartialEq, Serialize)] pub struct Vec2 { pub x: f32, pub y: f32, diff --git a/azalea-core/src/registry_holder/block_predicate.rs b/azalea-core/src/registry_holder/block_predicate.rs index faa05d10..a9f7d961 100644 --- a/azalea-core/src/registry_holder/block_predicate.rs +++ b/azalea-core/src/registry_holder/block_predicate.rs @@ -1,3 +1,3 @@ /// TODO: unimplemented -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct BlockPredicate {} diff --git a/azalea-core/src/registry_holder/block_state_provider.rs b/azalea-core/src/registry_holder/block_state_provider.rs index f9ad603d..104e022b 100644 --- a/azalea-core/src/registry_holder/block_state_provider.rs +++ b/azalea-core/src/registry_holder/block_state_provider.rs @@ -1,3 +1,3 @@ /// TODO: unimplemented -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct BlockStateProvider {} diff --git a/azalea-core/src/registry_holder/components.rs b/azalea-core/src/registry_holder/components.rs index cbd6384d..6a216ada 100644 --- a/azalea-core/src/registry_holder/components.rs +++ b/azalea-core/src/registry_holder/components.rs @@ -125,7 +125,7 @@ impl<T: EffectComponentTrait> ResolvedEffectComponent for T {} /// just use `from_nbt_tag`, because `borrow::NbtTag` can't be constructed on /// its own. To work around this, we have this `EffectNbtTag` struct that we /// *can* construct that we use when deserializing. -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum EffectNbtTag<'a, 'tape> { Compound(NbtCompound<'a, 'tape>), List(NbtList<'a, 'tape>), @@ -167,12 +167,12 @@ macro_rules! impl_from_effect_nbt_tag { } pub(crate) use impl_from_effect_nbt_tag; -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct ConditionalEffect<T: simdnbt::Deserialize + Debug + Clone> { pub effect: T, // pub requirements } -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct TargetedConditionalEffect<T: simdnbt::Deserialize + Debug + Clone> { pub effect: T, // pub enchanted diff --git a/azalea-core/src/registry_holder/dimension_type.rs b/azalea-core/src/registry_holder/dimension_type.rs index 86dd2b3e..ce0b5367 100644 --- a/azalea-core/src/registry_holder/dimension_type.rs +++ b/azalea-core/src/registry_holder/dimension_type.rs @@ -9,7 +9,7 @@ use simdnbt::{ use crate::codec_utils::*; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct TrimMaterialElement { pub asset_name: String, @@ -20,7 +20,7 @@ pub struct TrimMaterialElement { } /// Data about a kind of chat message -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct ChatTypeElement { pub chat: ChatTypeData, @@ -28,7 +28,7 @@ pub struct ChatTypeElement { } /// Data about a chat message. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct ChatTypeData { pub translation_key: String, @@ -37,7 +37,7 @@ pub struct ChatTypeData { } /// The style of a chat message. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct ChatTypeStyle { pub color: Option<String>, @@ -50,7 +50,7 @@ pub struct ChatTypeStyle { /// Dimension attributes. #[cfg(feature = "strict_registry")] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[simdnbt(deny_unknown_fields)] pub struct DimensionKindElement { pub ambient_light: f32, @@ -75,7 +75,7 @@ pub struct DimensionKindElement { /// Dimension attributes. #[cfg(not(feature = "strict_registry"))] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct DimensionKindElement { pub height: u32, pub min_y: i32, @@ -88,7 +88,7 @@ pub struct DimensionKindElement { /// /// This can be either a single minimum value, or a formula with a min and /// max. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] // #[serde(untagged)] pub enum MonsterSpawnLightLevel { /// A simple minimum value. @@ -132,7 +132,7 @@ impl ToNbtTag for MonsterSpawnLightLevel { /// The min and max light levels at which monsters can spawn. /// /// Values are inclusive. -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct MonsterSpawnLightLevelValues { #[simdnbt(rename = "min_inclusive")] @@ -142,7 +142,7 @@ pub struct MonsterSpawnLightLevelValues { } /// Biome attributes. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct WorldTypeElement { pub has_precipitation: bool, @@ -153,7 +153,7 @@ pub struct WorldTypeElement { } /// The precipitation of a biome. -#[derive(Debug, PartialEq, Eq, Copy, Clone)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum BiomePrecipitation { None, Rain, @@ -183,7 +183,7 @@ impl ToNbtTag for BiomePrecipitation { /// /// This includes the sky, fog, water, and grass color, /// as well as music and other sound effects. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct BiomeEffects { pub sky_color: u32, @@ -203,7 +203,7 @@ pub struct BiomeEffects { /// The music of the biome. /// /// Some biomes have unique music that only play when inside them. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct BiomeMusic { pub replace_current_music: bool, @@ -212,7 +212,7 @@ pub struct BiomeMusic { pub sound: SoundEvent, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct BiomeMoodSound { pub tick_delay: u32, @@ -221,7 +221,7 @@ pub struct BiomeMoodSound { pub sound: SoundEvent, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct AdditionsSound { pub tick_chance: f32, @@ -231,14 +231,14 @@ pub struct AdditionsSound { /// Biome particles. /// /// Some biomes have particles that spawn in the air. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct BiomeParticle { pub probability: f32, pub options: HashMap<String, String>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))] pub struct TrimPatternElement { #[simdnbt(flatten)] diff --git a/azalea-core/src/registry_holder/entity_effect.rs b/azalea-core/src/registry_holder/entity_effect.rs index ef08b7f0..4cb914e3 100644 --- a/azalea-core/src/registry_holder/entity_effect.rs +++ b/azalea-core/src/registry_holder/entity_effect.rs @@ -22,7 +22,7 @@ use crate::{ sound::CustomSound, }; -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum EntityEffect { AllOf(AllOf), ApplyMobEffect(ApplyMobEffect), @@ -82,12 +82,12 @@ impl Deserialize for EntityEffect { } } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct AllOf { pub effects: Vec<EntityEffect>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ApplyMobEffect { /// IDs of mob effects. pub to_apply: HomogeneousList, @@ -99,7 +99,7 @@ pub struct ApplyMobEffect { // TODO: in vanilla this is just a HolderSetCodec using a RegistryFixedCodec, // azalea registries should probably be refactored first tho -#[derive(Debug, Clone, Default)] +#[derive(Clone, Debug, Default)] pub struct HomogeneousList { pub ids: Vec<Identifier>, } @@ -124,12 +124,12 @@ impl simdnbt::FromNbtTag for HomogeneousList { } } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ChangeItemDamage { pub amount: LevelBasedValue, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct DamageEntity { pub min_damage: LevelBasedValue, pub max_damage: LevelBasedValue, @@ -137,7 +137,7 @@ pub struct DamageEntity { pub damage_kind: DamageKindKey, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct Explode { pub attribute_to_user: Option<bool>, #[simdnbt(rename = "damage_type")] @@ -147,24 +147,24 @@ pub struct Explode { pub offset: Option<Vec3>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct Ignite { pub duration: LevelBasedValue, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ApplyEntityImpulse { pub direction: Vec3, pub coordinate_scale: Vec3, pub magnitude: LevelBasedValue, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ApplyExhaustion { pub amount: LevelBasedValue, } -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct PlaySound { // #[simdnbt(compact)] pub sound: Vec<Holder<SoundEvent, CustomSound>>, @@ -204,7 +204,7 @@ impl Deserialize for PlaySound { } } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ReplaceBlock { pub offset: Option<Vec3i>, pub predicate: Option<BlockPredicate>, @@ -212,7 +212,7 @@ pub struct ReplaceBlock { pub trigger_game_event: Option<GameEvent>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ReplaceDisk { pub radius: LevelBasedValue, pub height: LevelBasedValue, @@ -222,19 +222,19 @@ pub struct ReplaceDisk { pub trigger_game_event: Option<GameEvent>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct RunFunction { pub function: Identifier, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct SetBlockProperties { pub properties: HashMap<String, String>, pub offset: Option<Vec3i>, pub trigger_game_event: Option<GameEvent>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct SpawnParticles { pub particle: ParticleKindCodec, pub horizontal_position: SpawnParticlesPosition, @@ -244,13 +244,13 @@ pub struct SpawnParticles { pub speed: Option<FloatProvider>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct ParticleKindCodec { #[simdnbt(rename = "type")] pub kind: ParticleKind, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct SpawnParticlesPosition { #[simdnbt(rename = "type")] pub kind: Identifier, @@ -258,13 +258,13 @@ pub struct SpawnParticlesPosition { pub scale: Option<f32>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct SpawnParticlesVelocity { pub movement_scale: Option<f32>, pub base: Option<FloatProvider>, } -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct SummonEntity { pub entity: HomogeneousList, pub join_team: Option<bool>, diff --git a/azalea-core/src/registry_holder/mod.rs b/azalea-core/src/registry_holder/mod.rs index 886c75e1..90bad921 100644 --- a/azalea-core/src/registry_holder/mod.rs +++ b/azalea-core/src/registry_holder/mod.rs @@ -30,7 +30,7 @@ use tracing::error; /// per-client like you might expect. This is an optimization for swarms to /// reduce memory usage, since registries are expected to be the same for every /// client in a world. -#[derive(Default, Debug, Clone)] +#[derive(Clone, Debug, Default)] pub struct RegistryHolder { // if you add new fields here, don't forget to also update `RegistryHolder::append`, // `protocol_id_to_identifier`, and `define_default_deserializes_to!` in @@ -124,7 +124,7 @@ fn nbt_to_serializable_type<T: simdnbt::Deserialize>( T::from_compound((&nbt_borrow_compound).into()).map_err(Into::into) } -#[derive(Error, Debug)] +#[derive(Debug, Error)] enum NbtToSerializableTypeError { #[error(transparent)] NbtError(#[from] simdnbt::Error), @@ -133,7 +133,7 @@ enum NbtToSerializableTypeError { } /// A collection of values for a certain type of registry data. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct RegistryType<T: simdnbt::Deserialize> { pub map: IndexMap<Identifier, T>, } diff --git a/azalea-core/src/registry_holder/value.rs b/azalea-core/src/registry_holder/value.rs index 964d1e5a..1eedc0c0 100644 --- a/azalea-core/src/registry_holder/value.rs +++ b/azalea-core/src/registry_holder/value.rs @@ -15,7 +15,7 @@ use crate::{ registry_holder::{components::impl_from_effect_nbt_tag, get_in_compound}, }; -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum ValueEffect { Set { value: LevelBasedValue, @@ -73,7 +73,7 @@ impl simdnbt::Deserialize for ValueEffect { } impl_from_effect_nbt_tag!(ValueEffect); -#[derive(Debug, Clone, simdnbt::Deserialize)] +#[derive(Clone, Debug, simdnbt::Deserialize)] pub struct AttributeEffect { pub id: Identifier, pub attribute: Attribute, @@ -82,7 +82,7 @@ pub struct AttributeEffect { } impl_from_effect_nbt_tag!(AttributeEffect); -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum LevelBasedValue { Constant(f32), Exponent { diff --git a/azalea-core/src/sound.rs b/azalea-core/src/sound.rs index 9ac568b6..418707b9 100644 --- a/azalea-core/src/sound.rs +++ b/azalea-core/src/sound.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_registry::identifier::Identifier; use serde::Serialize; -#[derive(Clone, Debug, PartialEq, AzBuf, Serialize, simdnbt::Deserialize)] +#[derive(AzBuf, Clone, Debug, simdnbt::Deserialize, PartialEq, Serialize)] pub struct CustomSound { pub sound_id: Identifier, pub range: Option<f32>, diff --git a/azalea-core/src/tick.rs b/azalea-core/src/tick.rs index 09b45be4..435d9fb3 100644 --- a/azalea-core/src/tick.rs +++ b/azalea-core/src/tick.rs @@ -6,5 +6,5 @@ use bevy_ecs::schedule::ScheduleLabel; /// physics. /// /// This schedule runs either zero or one times after every Bevy `Update`. -#[derive(ScheduleLabel, Hash, Copy, Clone, Debug, Default, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq, ScheduleLabel)] pub struct GameTick; |
