BlackBoxMC / blackboxmc

Minecraft plugin that allows you to write plugins in many other compiled languages besides Java
GNU Lesser General Public License v3.0
14 stars 1 forks source link

Create a map of variables that can be added to, so that data can be stored outside of event handlers. #1

Closed IoIxD closed 1 year ago

IoIxD commented 1 year ago

The user can, and should, just use global/lifetime variables (Lazy wrapper in Rust).

static mut LIBRARY_MANAGER: Lazy<LibraryManager> = Lazy::new(|| LibraryManager::new());

In the case of Rust, accessing the global is unsafe. But the alternative would be extremely limited and expensive and is not worth implementing.