-Instead of having the game functions <span style="color:#C792EA">`hash_map_string`</span>, <span style="color:#C792EA">`hash_map_i32`</span>, <span style="color:#C792EA">`hash_map_f32`</span>, etc., the [grug mod loader for Minecraft](https://github.com/MyNameIsTrez/grug-mod-loader-for-minecraft) offers a generic <span style="color:#C792EA">`hash_map`</span> game function that only stores <span style="color:#FFC964">`id`</span>s. You store an <span style="color:#FFC964">`i32`</span> in it by using the game function <span style="color:#C792EA">`box_i32`</span>, which wraps an <span style="color:#FFC964">`i32`</span> in an object, and returns its <span style="color:#FFC964">`id`</span>. You unwrap the <span style="color:#FFC964">`i32`</span> in it using <span style="color:#C792EA">`unbox_i32`</span>. This is similar to [Java's autoboxing](https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html).
0 commit comments