-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
12 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "pumpkin-inventory" | ||
version.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
num-traits = "0.2" | ||
num-derive = "0.4" |
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,41 @@ | ||
use num_derive::ToPrimitive; | ||
|
||
/// https://wiki.vg/Inventory | ||
#[derive(Debug, ToPrimitive)] | ||
pub enum WindowType { | ||
// not used | ||
Generic9x1, | ||
// not used | ||
Generic9x2, | ||
// General-purpose 3-row inventory. Used by Chest, minecart with chest, ender chest, and barrel | ||
Generic9x3, | ||
// not used | ||
Generic9x4, | ||
// not used | ||
Generic9x5, | ||
// Used by large chests | ||
Generic9x6, | ||
// General-purpose 3-by-3 square inventory, used by Dispenser and Dropper | ||
Generic3x3, | ||
// General-purpose 3-by-3 square inventory, used by the Crafter | ||
Craft3x3, | ||
Anvil, | ||
Beacon, | ||
BlastFurance, | ||
BrewingStand, | ||
CraftingTable, | ||
EnchantmentTable, | ||
Furnace, | ||
Grindstone, | ||
// Hopper or minecart with hopper | ||
Hopper, | ||
Lectern, | ||
Loom, | ||
// Villager, Wandering Trader | ||
Merchant, | ||
ShulkerBox, | ||
SmithingTable, | ||
Smoker, | ||
CartographyTable, | ||
Stonecutter, | ||
} |
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,23 @@ | ||
use pumpkin_macros::packet; | ||
use pumpkin_text::TextComponent; | ||
use serde::Serialize; | ||
|
||
use crate::VarInt; | ||
|
||
#[derive(Serialize, Clone)] | ||
#[packet(0x33)] | ||
pub struct COpenScreen { | ||
window_id: VarInt, | ||
window_type: VarInt, | ||
window_title: TextComponent, | ||
} | ||
|
||
impl COpenScreen { | ||
pub fn new(window_id: VarInt, window_type: VarInt, window_title: TextComponent) -> Self { | ||
Self { | ||
window_id, | ||
window_type, | ||
window_title, | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
pub struct ChatType {} | ||
|
||
pub struct Decoration { | ||
translation_key: String, | ||
// style: Option, | ||
parameters: Vec<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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,4 +231,4 @@ impl Default for TextContent { | |
fn default() -> Self { | ||
Self::Text { text: "".into() } | ||
} | ||
} | ||
} |
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