starscript icon indicating copy to clipboard operation
starscript copied to clipboard

[Change] Added `setRaw` and `removeRaw` to `ValueMap`

Open CDAGaming opened this issue 9 months ago • 3 comments

  • These two functions have been added for two reasons:
    • A) Just some basic cleanup to consolidate some repeat logic
    • B) By having the ability to raw remove and raw set values, this commit also gives the user a bit more general control over setting/getting data from the ValueMap

In my use case, CraftPresence, this change was implemented here as a way to re-implement ValueMap#set to work with my placeholder mappings (My mod has the abilities to search for and see previews of any placeholder, hence the separate storage and why just using getGlobals() wouldn't work easily.

This is more so something for backend usage, rather then anything that would be useful to the frontend, besides the additional change of using a ConcurrentHashMap for ValueMap to be a bit more thread-friendly.

CDAGaming avatar May 20 '24 02:05 CDAGaming