diff --git a/pumpkin-data/build/item.rs b/pumpkin-data/build/item.rs index 0f06d89e9..5bedaae8c 100644 --- a/pumpkin-data/build/item.rs +++ b/pumpkin-data/build/item.rs @@ -296,7 +296,8 @@ pub(crate) fn build() -> TokenStream { #constants pub fn translated_name(&self) -> TextComponent { - serde_json::from_str(self.components.item_name.unwrap()).expect("Could not parse item name.") + // TODO + TextComponent::text(self.components.item_name.unwrap()) } #[doc = "Try to parse an item from a resource location string."] diff --git a/pumpkin-util/src/text/hover.rs b/pumpkin-util/src/text/hover.rs index b4cff794a..9e5b523bc 100644 --- a/pumpkin-util/src/text/hover.rs +++ b/pumpkin-util/src/text/hover.rs @@ -16,18 +16,16 @@ pub enum HoverEvent { /// Number of the items in the stack #[serde(default, skip_serializing_if = "Option::is_none")] count: Option, - /// NBT information about the item (sNBT format) - #[serde(default, skip_serializing_if = "Option::is_none")] - tag: Option>, + // #[serde(default, skip_serializing_if = "Option::is_none")] + // components: Option>, }, /// Shows an entity. ShowEntity { + /// The entity's ID Entity Type + id: Cow<'static, str>, /// The entity's UUID /// The UUID cannot use uuid::Uuid because its serialization parses it into bytes, so its double bytes serialized - id: Cow<'static, str>, - /// Resource identifier of the entity - #[serde(default, skip_serializing_if = "Option::is_none")] - r#type: Option>, + uuid: Cow<'static, str>, /// Optional custom name for the entity #[serde(default, skip_serializing_if = "Option::is_none")] name: Option>, @@ -40,13 +38,13 @@ impl HoverEvent { value: vec![text.0], } } - pub fn show_entity

(id: P, kind: P, name: Option) -> Self + pub fn show_entity

(uuid: P, kind: P, name: Option) -> Self where P: Into>, { Self::ShowEntity { - id: id.into(), - r#type: Some(kind.into()), + id: kind.into(), + uuid: uuid.into(), name: match name { Some(name) => Some(vec![name.0]), None => None, diff --git a/pumpkin/src/command/commands/give.rs b/pumpkin/src/command/commands/give.rs index 80be7862f..f4b488ec0 100644 --- a/pumpkin/src/command/commands/give.rs +++ b/pumpkin/src/command/commands/give.rs @@ -67,7 +67,6 @@ impl CommandExecutor for Executor { .hover_event(HoverEvent::ShowItem { id: item_name.to_string().into(), count: Some(item_count), - tag: None, }), TextComponent::text(targets[0].gameprofile.name.to_string()) .hover_event(HoverEvent::show_entity( @@ -97,7 +96,6 @@ impl CommandExecutor for Executor { .hover_event(HoverEvent::ShowItem { id: item_name.to_string().into(), count: Some(item_count), - tag: None, }), TextComponent::text(targets.len().to_string()), ],