Skip to content

Commit be235e7

Browse files
TebaremKumpelinusandrewgazelka
authored
feat(core): physics (#696)
- Fixes #676 --------- Co-authored-by: Kumpelinus <kumpelinus@jat.de> Co-authored-by: Andrew Gazelka <andrew.gazelka@gmail.com>
1 parent 31119b4 commit be235e7

File tree

9 files changed

+396
-324
lines changed

9 files changed

+396
-324
lines changed

crates/hyperion-inventory/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub mod parser;
1010
pub type PlayerInventory = Inventory<46>;
1111

1212
/// Placeholder; this will be added later.
13-
#[derive(Component, Debug)]
13+
#[derive(Component, Debug, PartialEq)]
1414
pub struct Inventory<const T: usize> {
1515
slots: [ItemStack; T],
1616
hand_slot: u16,
@@ -304,6 +304,11 @@ impl PlayerInventory {
304304
self.get(Self::BOOTS_SLOT).unwrap()
305305
}
306306

307+
#[must_use]
308+
pub fn get_offhand(&self) -> &ItemStack {
309+
self.get(Self::OFFHAND_SLOT).unwrap()
310+
}
311+
307312
pub fn try_add_item(&mut self, mut item: ItemStack) -> AddItemResult {
308313
let mut result = AddItemResult { remaining: None };
309314

0 commit comments

Comments
 (0)