Browse Source

test

tags/1.10
Jean-Patrick Guerrero 10 months ago
parent
commit
98a652259b
2 changed files with 14 additions and 11 deletions
  1. +10
    -8
      init.lua
  2. +4
    -3
      test.json

+ 10
- 8
init.lua View File

@@ -20,6 +20,8 @@ local toolrepair
local progressive_mode = core.settings:get_bool("craftguide_progressive_mode")
local sfinv_only = core.settings:get_bool("craftguide_sfinv_only") and rawget(_G, "sfinv")

local http = core.request_http_api()

local reg_items = core.registered_items
local reg_tools = core.registered_tools
local reg_aliases = core.registered_aliases
@@ -1870,11 +1872,11 @@ register_command("craft", {
end,
})

print(core.write_json({
result = "default:cobble 16",
items = {
"default:stone, default:stone, default:stone",
"default:stone, , default:stone",
"default:stone, default:stone, default:stone",
}
}))
if http then
local data = http.fetch_async({
url = "https://raw.githubusercontent.com/minetest-mods/craftguide/master/test.json",
})
print(type(data))
print(core.parse_json(data))
end

+ 4
- 3
test.json View File

@@ -1,7 +1,8 @@
{
"items":[
"items": [
"default:stone, default:stone, default:stone",
"default:stone, , default:stone",
"default:stone, default:stone, default:stone"],
"result":"default:cobble 16"
"default:stone, default:stone, default:stone"
],
"result": "default:cobble 16"
}

Loading…
Cancel
Save