ToddLLM/luanti-complete-dataset huggingface dataset:
**Title:** World Storage [deprecated]

**Description:** 

**Details:**
# Usage

**DEPRECATED**: Avoid using for new projects. Mod storage is faster and more robust. This API is only good for if you need to be able to easily access the data in the world folder, but other than that it's a slower, less robust version of the builtin `minetest.get_mod_storage`. That is, if you specifically want to be able to edit the files in the world folder, this is fine, but for literally everything else, use modstorage and roll your own persistence using that. For world settings, use [aom_settings](https://content.luanti.org/packages/Sumianvoice/aom_settings/) which is a lighter weight alternative, yet comes with a formspec so you can edit world settings in game on the fly as a moderator with server privs.

To get a key from storage:
```lua
world_storage.get(domain, key)
```

To save a key to storage:
```lua
world_storage.set(domain, key, val, flags)
```


# As a world settings solution
You can also use the chat command to set custom settings that can be used by your mods instead of the global minetest server settings. Note this cannot affect domains other than "_ws", and this is its intended and only valid use. The first param is n for number or s for string / raw.
```
wset n key 389.2
wset s key some string of letters, even with spaces
wset [anything] key nil -- deletes a key
```
Then, these values can be accessed with wset and wget.
```lua
local value = world_storage.wget("my_mod:setting_name")
-- e.g.
local reload_time = world_storage.wget("pmb_muskets:reload_speed")
```
To make sure you don't get nil or have to check for it all the time, you can do this with all of your stored variables:
```lua
if world_storage.wget("pmb_muskets:reload_speed") == nil then
    world_storage.wset("pmb_muskets:reload_speed", "my_default_value")
end
```



# Parameters
## domain
This is the `filename` used for the saving of the data. Each domain is a list - `world_storage.domain[domainname] = {}`.
You can overwrite keys from other mods with this, so choose a unique name, such as the name of your mod.
## key
The key name / variable name you want to save
## val
The arbitrary data you want to save
## flags
Only one flag implemented so far:
- timeout : used to tell the system how long between autosaves



# Notes on usage
The system will autosave regularly if there are changes made, and this is important to note. If you are saving a lot of data, this is not the right system to use. Instead, construct your own system to handle your specific use case. For example, if you need to store several kilobytes of data regularly, **this is not how you do it.**

**Tags:** library
**Repository:** https://codeberg.org/SumianVoice/world_storage
**License:** 0BSD
**Title:** Player Info [deprecated]

**Description:** 

**Details:**
# Player Info

**DEPRECATED**: Avoid using for new projects. This is bloated and does more than it should, and tried to overextend its functionality. It was written before I understood I shouldn't have written it. Instead, it would be better to create or find a player API that does only what you need it to.

For now, covers controls.

This includes:

- controls copy themselves
- just_pressed
- just_released
- since_released
- since_pressed


```LUA
player_info
  [player name]
    ctrl
    just_released
    just_pressed
    since_released
    since_pressed
```

## player_info.get(player_ref)
Use this to get the player profile. This is the same as player_info.p[player_name] but you don't have to test for `is_player`.

## ctrl
bool or nil

ctrl is just whether the control is pressed.

## just_pressed
bool or nil

Is available for one step after you start pressing a key.

## just_released
bool or nil

Is available for one step after you start letting go of a key.

## since_pressed
number or nil

How long the player has been holding the key.

## since_released
number or nil

How long it has been since the player released the key.

**Tags:** library
**Repository:** https://codeberg.org/SumianVoice/player_info.git
**License:** 0BSD