Skip to content

Commit bc0f103

Browse files
libcraft: Add entity interaction types (feather-rs#21)
* Add entity interaction types * Derive `Serialize` and `Deserialize` on the interaction types. Co-authored-by: Caelum van Ispelen <caelunshun@gmail.com>
1 parent 325221d commit bc0f103

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

libcraft/crates/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ num-traits = "0.2"
1111
serde = { version = "1", features = ["derive"] }
1212
strum = "0.20"
1313
strum_macros = "0.20"
14-
vek = "0.14"
14+
vek = "0.14"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use serde::{Deserialize, Serialize};
2+
3+
#[derive(Debug, Serialize, Deserialize)]
4+
pub enum InteractionType {
5+
Interact,
6+
Attack,
7+
InteractAt,
8+
}
9+
10+
#[derive(Debug, Serialize, Deserialize)]
11+
pub enum InteractHand {
12+
Main,
13+
Offhand,
14+
}

libcraft/crates/core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mod enchantment;
77
mod entity;
88
mod gamemode;
99
mod gamerules;
10+
mod interaction;
1011
mod positions;
1112

1213
pub use biome::Biome;
@@ -15,6 +16,7 @@ pub use enchantment::{Enchantment, EnchantmentKind};
1516
pub use entity::EntityKind;
1617
pub use gamemode::Gamemode;
1718
pub use gamerules::GameRules;
19+
pub use interaction::{InteractHand, InteractionType};
1820
pub use positions::{
1921
vec3, Aabb, BlockPosition, ChunkPosition, Mat4f, Position, Vec2d, Vec2f, Vec2i, Vec3d, Vec3f,
2022
Vec3i, Vec4d, Vec4f, Vec4i,

0 commit comments

Comments
 (0)