There was an error while loading. Please reload this page.
1 parent 9fd146a commit 5883b5bCopy full SHA for 5883b5b
3 files changed
libcraft/crates/generators/python/item.py
@@ -21,7 +21,7 @@
21
else:
22
durabilities[variant] = f"Some({durability})"
23
24
-output_data = generate_enum("Item", items)
+output_data = "#[derive(serde::Serialize, serde::Deserialize)]" + generate_enum("Item", items)
25
output_data += generate_enum_property("Item", "id", "u32", ids, True)
26
output_data += generate_enum_property("Item", "name", "&str", names, True, "&'static str")
27
output_data += generate_enum_property("Item", "display_name", "&str", display_names, False, "&'static str")
libcraft/crates/items/src/item.rs
@@ -1,6 +1,7 @@
1
// This file is @generated. Please do not edit.
2
-
3
-#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
+#[derive(
+ serde::Serialize, serde::Deserialize, Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord,
4
+)]
5
pub enum Item {
6
Air,
7
Stone,
libcraft/crates/particles/src/particle.rs
@@ -1,9 +1,9 @@
-use bytemuck::{Pod, Zeroable};
+use serde::{Serialize, Deserialize};
use libcraft_blocks::BlockState;
use libcraft_items::Item;
use ordinalizer::Ordinal;
-#[derive(Copy, Clone, Debug, Pod, Zeroable)]
+#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[repr(C)]
8
pub struct Particle {
9
pub kind: ParticleKind,
@@ -17,7 +17,7 @@ pub struct Particle {
17
/// listed on [the Particle data type](https://wiki.vg/index.php?title=Protocol&oldid=16400#Particle).
18
/// Some particles are missing on that list (SoulFlame, Soul, BubblePop and the crying obsidian ones)
19
/// So they've been added
20
-#[derive(Copy, Clone, Debug, PartialEq, Ordinal)]
+#[derive(Copy, Clone, Debug, PartialEq, Ordinal, Serialize, Deserialize)]
pub enum ParticleKind {
AmbientEntityEffect,
@@ -347,7 +347,3 @@ impl ParticleKind {
347
}
348
349
350
351
-unsafe impl Zeroable for ParticleKind {}
352
353
-unsafe impl Pod for ParticleKind {}
0 commit comments