Merge branch 'main' into worldwide-refactor
This commit is contained in:
@@ -13,6 +13,30 @@ load_script("packid:scripts/script_name.lua") -- load Lua script if not loaded y
|
||||
load_script("packid:scripts/script_name.lua", true) -- load Lua script anyway
|
||||
```
|
||||
|
||||
## *pack* library
|
||||
|
||||
```python
|
||||
pack.is_installed(packid: str) -> bool
|
||||
```
|
||||
|
||||
Check if specified pack is installed in the world
|
||||
|
||||
```python
|
||||
pack.data_file(packid: str, filename: str) -> str
|
||||
```
|
||||
|
||||
Returns data file path like `world:data/packid/filename`
|
||||
and creates missing directories.
|
||||
|
||||
Use this function when saving pack settings or other data to the world.
|
||||
|
||||
Example:
|
||||
```lua
|
||||
file.write(pack.data_file(PACK_ID, "example.txt"), text)
|
||||
```
|
||||
|
||||
For pack *containermod* will write text to the file `world:data/containermod/example.txt`
|
||||
|
||||
## *player* library
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user