mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-25 20:23:42 +01:00
test
This commit is contained in:
parent
a8ad0435fa
commit
98a652259b
18
init.lua
18
init.lua
@ -20,6 +20,8 @@ local toolrepair
|
|||||||
local progressive_mode = core.settings:get_bool("craftguide_progressive_mode")
|
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 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_items = core.registered_items
|
||||||
local reg_tools = core.registered_tools
|
local reg_tools = core.registered_tools
|
||||||
local reg_aliases = core.registered_aliases
|
local reg_aliases = core.registered_aliases
|
||||||
@ -1870,11 +1872,11 @@ register_command("craft", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
print(core.write_json({
|
if http then
|
||||||
result = "default:cobble 16",
|
local data = http.fetch_async({
|
||||||
items = {
|
url = "https://raw.githubusercontent.com/minetest-mods/craftguide/master/test.json",
|
||||||
"default:stone, default:stone, default:stone",
|
})
|
||||||
"default:stone, , default:stone",
|
|
||||||
"default:stone, default:stone, default:stone",
|
print(type(data))
|
||||||
}
|
print(core.parse_json(data))
|
||||||
}))
|
end
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"items":[
|
"items": [
|
||||||
"default:stone, default:stone, default:stone",
|
"default:stone, default:stone, default:stone",
|
||||||
"default:stone, , default:stone",
|
"default:stone, , default:stone",
|
||||||
"default:stone, default:stone, default:stone"],
|
"default:stone, default:stone, default:stone"
|
||||||
"result":"default:cobble 16"
|
],
|
||||||
|
"result": "default:cobble 16"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user