forked from Pumpkin-MC/Pumpkin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
214 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Debug, Clone, Deserialize)] | ||
#[serde(rename_all = "PascalCase")] | ||
pub struct BlockEntityItem { | ||
count: Option<u8>, | ||
slot: Option<u8>, | ||
#[serde(rename = "id")] | ||
id: String, | ||
//tag - Currently not needed | ||
} | ||
|
||
#[derive(Debug, Clone, Deserialize)] | ||
pub struct BlockEntity { | ||
pub x: i32, | ||
pub y: i32, | ||
pub z: i32, | ||
// #[serde(rename = "id")] | ||
// pub id: String, | ||
#[serde(flatten)] | ||
pub data: BlockEntityType | ||
} | ||
|
||
#[derive(Debug, Clone, Deserialize)] | ||
#[serde(tag = "id")] | ||
pub enum BlockEntityType { | ||
|
||
#[serde(rename = "minecraft:jukebox")] | ||
Jukebox { | ||
#[serde(rename = "RecordItem")] | ||
record_item: Option<RecordItem>, | ||
ticks_since_song_started: Option<i64>, | ||
}, | ||
|
||
#[serde(other)] | ||
Unknown | ||
} | ||
|
||
|
||
/// --- Entity specific structs --- | ||
/// Jukebox record item | ||
#[derive(Debug, Clone, Deserialize)] | ||
pub struct RecordItem { | ||
pub count: u8, | ||
pub id: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.