mirror of
https://github.com/ExeVirus/formspec_editor.git
synced 2025-03-22 17:32:22 +00:00
request insecure env properly
This commit is contained in:
parent
b0be851f2d
commit
17f1c4a4a5
2 changed files with 9 additions and 0 deletions
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
This mod needs access to an insecure environment in order to work.
|
||||||
|
|
||||||
|
Add `formspec_edit` to `secure.trusted_mods` in your `minetest.conf` file.
|
||||||
|
|
||||||
The file *formspec.spec* in your:
|
The file *formspec.spec* in your:
|
||||||
|
|
||||||
```minetest_folder/games/formspec_editor/mods/formspec_edit```
|
```minetest_folder/games/formspec_editor/mods/formspec_edit```
|
||||||
|
|
|
@ -9,7 +9,12 @@ minetest.register_alias("mapgen_water_source", "air")
|
||||||
|
|
||||||
--Variables
|
--Variables
|
||||||
local modpath = minetest.get_modpath("formspec_edit")
|
local modpath = minetest.get_modpath("formspec_edit")
|
||||||
|
|
||||||
local insecure_env = minetest.request_insecure_environment()
|
local insecure_env = minetest.request_insecure_environment()
|
||||||
|
if not insecure_env then
|
||||||
|
error("[formspec_editor] Cannot access insecure environment!")
|
||||||
|
end
|
||||||
|
|
||||||
local io = insecure_env.io
|
local io = insecure_env.io
|
||||||
local update_time = tonumber(minetest.settings:get("formspec_editor.update_time")) or 0.2
|
local update_time = tonumber(minetest.settings:get("formspec_editor.update_time")) or 0.2
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue