classicube_helpers\events/entity.rs
1use std::os::raw::c_int;
2
3use crate::make_event_handler;
4
5make_event_handler!(
6 /// Entity is spawned in the current world
7 Entity,
8 Added,
9 Int,
10 (
11 {
12 name: id,
13 rust_type: u8,
14 c_type: c_int,
15 to_rust: |id| u8::try_from(id).unwrap(),
16 },
17 )
18);
19
20make_event_handler!(
21 /// Entity is despawned from the current world
22 Entity,
23 Removed,
24 Int,
25 (
26 {
27 name: id,
28 rust_type: u8,
29 c_type: c_int,
30 to_rust: |id| u8::try_from(id).unwrap(),
31 },
32 )
33);