aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/registry_holder
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-15 11:14:40 +0930
committermat <git@matdoes.dev>2025-12-15 11:14:40 +0930
commitdcbd690f21665e22ea250024a1aa85dec34e6c9e (patch)
tree411c76eb92ca1cfe284e56f47bc0abd4079a3364 /azalea-core/src/registry_holder
parentb0a2a809331b0f781517649857d31e0aec67d300 (diff)
downloadazalea-drasl-dcbd690f21665e22ea250024a1aa85dec34e6c9e.tar.xz
sort derives with cargo sort-derives
might add to ci later, unsure how to do it without adding significant friction for contributors though
Diffstat (limited to 'azalea-core/src/registry_holder')
-rw-r--r--azalea-core/src/registry_holder/block_predicate.rs2
-rw-r--r--azalea-core/src/registry_holder/block_state_provider.rs2
-rw-r--r--azalea-core/src/registry_holder/components.rs6
-rw-r--r--azalea-core/src/registry_holder/dimension_type.rs32
-rw-r--r--azalea-core/src/registry_holder/entity_effect.rs40
-rw-r--r--azalea-core/src/registry_holder/mod.rs6
-rw-r--r--azalea-core/src/registry_holder/value.rs6
7 files changed, 47 insertions, 47 deletions
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 {