classicube_helpers\events/
world.rs

1use std::os::raw::{c_float, c_int};
2
3use classicube_sys::{cc_bool, cc_uint8};
4
5use crate::make_event_handler;
6
7make_event_handler!(
8    /// Player begins loading a new world
9    World,
10    NewMap,
11    Void,
12    ()
13);
14
15make_event_handler!(
16    /// Portion of world is decompressed/generated (Arg is progress from 0-1)
17    World,
18    Loading,
19    Float,
20    (
21        {
22            name: progress,
23            rust_type: c_float,
24            c_type: c_float,
25            to_rust: |a| a,
26        },
27    )
28);
29
30make_event_handler!(
31    /// New world has finished loading, player can now interact with it
32    World,
33    MapLoaded,
34    Void,
35    ()
36);
37
38make_event_handler!(
39    /// World environment variable changed by player/CPE/WoM config
40    World,
41    EnvVarChanged,
42    Int,
43    (
44        {
45            name: var,
46            rust_type: c_int,
47            c_type: c_int,
48            to_rust: |a| a,
49        },
50    )
51);
52
53make_event_handler!(
54    /// Lighting mode changed.
55    World,
56    LightingModeChanged,
57    LightingMode,
58    (
59        {
60            name: old_mode,
61            rust_type: cc_uint8,
62            c_type: cc_uint8,
63            to_rust: |a| a,
64        },
65        {
66            name: from_server,
67            rust_type: cc_bool,
68            c_type: cc_bool,
69            to_rust: |a| a,
70        },
71    )
72);