···11use serde::{Deserialize, Serialize};
22use sha1::Digest as _;
33+use uuid::Uuid;
3445use crate::component::Component;
56···3334 InfinityRealm,
3435 /// From a player's save data.
3536 PlayerData {
3636- uuid: String,
3737+ uuid: Uuid,
3738 inventory: PlayerInventoryKind,
3939+ slot: u8,
3840 },
3941 /// From a placed block entity, such as a chest.
4042 BlockEntity {
···4244 x: i32,
4345 y: i32,
4446 z: i32,
4747+ slot: u8,
4548 },
4949+ /// Inside an item at `slot` within another container.
5050+ ItemBlockEntity { slot: u8, within: Box<BookSource> },
4651}
47524853#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
+7
nara_core/src/lib.rs
···11+use ::uuid::Uuid;
22+13pub mod book;
24pub mod color;
35pub mod component;
46pub mod profile;
77+pub mod uuid;
88+99+pub fn i64_pair_to_uuid(most_significant: i64, least_signifcant: i64) -> Uuid {
1010+ Uuid::from_u64_pair(most_significant as u64, least_signifcant as u64)
1111+}
···1515pub enum Command {
1616 /// Build the library and optionally run the webserver.
1717 Serve(ServeArgs),
1818+ /// Scan a world directory.
1919+ ScanWorld(ScanWorldArgs),
2020+}
2121+2222+#[derive(Args, Debug)]
2323+pub struct ScanWorldArgs {
2424+ /// Path to the world directory.
2525+ #[arg(short = 'w', long = "world")]
2626+ pub world_path: PathBuf,
1827}
19282029#[derive(Args, Debug)]
+2-2
src/library.rs
···5353}
54545555impl Library {
5656- /// Inserts a book and updates all indices and caches.
5757- fn add_book(
5656+ /// Inserts a book
5757+ pub fn add_book(
5858 &mut self,
5959 book: Book,
6060 warn_duplicates: bool,