Skip to content

Commit

Permalink
feat(core): physics (#696)
Browse files Browse the repository at this point in the history
- Fixes #676

---------

Co-authored-by: Kumpelinus <kumpelinus@jat.de>
Co-authored-by: Andrew Gazelka <andrew.gazelka@gmail.com>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent 31119b4 commit be235e7
Show file tree
Hide file tree
Showing 9 changed files with 396 additions and 324 deletions.
7 changes: 6 additions & 1 deletion crates/hyperion-inventory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod parser;
pub type PlayerInventory = Inventory<46>;

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

#[must_use]
pub fn get_offhand(&self) -> &ItemStack {
self.get(Self::OFFHAND_SLOT).unwrap()
}

pub fn try_add_item(&mut self, mut item: ItemStack) -> AddItemResult {
let mut result = AddItemResult { remaining: None };

Expand Down
Loading

0 comments on commit be235e7

Please sign in to comment.