mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
world: add Eq + Ord to all block entity types
This commit is contained in:
parent
825cf70e51
commit
e36ae4601d
3 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@ use super::{
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Kind of sign block
|
/// Kind of sign block
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum SignKind {
|
pub enum SignKind {
|
||||||
/// Standing or attached sign
|
/// Standing or attached sign
|
||||||
|
@ -18,7 +18,7 @@ pub enum SignKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Processed sign data
|
/// Processed sign data
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct Sign {
|
pub struct Sign {
|
||||||
/// The kind of the sign
|
/// The kind of the sign
|
||||||
pub kind: SignKind,
|
pub kind: SignKind,
|
||||||
|
@ -45,7 +45,7 @@ impl Sign {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Data for different kinds of [BlockEntity]
|
/// Data for different kinds of [BlockEntity]
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
#[serde(tag = "type", rename_all = "snake_case")]
|
#[serde(tag = "type", rename_all = "snake_case")]
|
||||||
pub enum BlockEntityData {
|
pub enum BlockEntityData {
|
||||||
/// A sign block
|
/// A sign block
|
||||||
|
@ -53,7 +53,7 @@ pub enum BlockEntityData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A processed block entity
|
/// A processed block entity
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct BlockEntity {
|
pub struct BlockEntity {
|
||||||
/// Global X coordinate
|
/// Global X coordinate
|
||||||
pub x: i32,
|
pub x: i32,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// is handled by [DeserializedText].
|
/// is handled by [DeserializedText].
|
||||||
///
|
///
|
||||||
/// Formatting that is not set in a node is inherited from the parent.
|
/// Formatting that is not set in a node is inherited from the parent.
|
||||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct FormattedText {
|
pub struct FormattedText {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
/// Text content
|
/// Text content
|
||||||
|
@ -77,7 +77,7 @@ impl From<String> for FormattedTextTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List of [FormattedText]
|
/// List of [FormattedText]
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct FormattedTextList(pub Vec<FormattedText>);
|
pub struct FormattedTextList(pub Vec<FormattedText>);
|
||||||
|
|
||||||
impl FormattedTextList {
|
impl FormattedTextList {
|
||||||
|
|
|
@ -79,7 +79,7 @@ impl BlockEntitySignExt for de::BlockEntitySign {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
/// Deserialized and linearized sign text
|
/// Deserialized and linearized sign text
|
||||||
pub struct SignText(pub Vec<FormattedTextList>);
|
pub struct SignText(pub Vec<FormattedTextList>);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue