mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 12:33:43 +01:00
Style
This commit is contained in:
parent
4483f60cbc
commit
8c7408f66f
18
init.lua
18
init.lua
@ -52,16 +52,16 @@ local ES = function(...)
|
|||||||
return ESC(S(...))
|
return ESC(S(...))
|
||||||
end
|
end
|
||||||
|
|
||||||
local maxn, sort, concat, copy, insert, remove, unpack =
|
local maxn, sort, concat, copy, insert, remove =
|
||||||
table.maxn, table.sort, table.concat, table.copy,
|
table.maxn, table.sort, table.concat, table.copy,
|
||||||
table.insert, table.remove, unpack
|
table.insert, table.remove
|
||||||
|
|
||||||
local fmt, find, gmatch, match, sub, split, upper, lower =
|
local fmt, find, gmatch, match, sub, split, upper, lower =
|
||||||
string.format, string.find, string.gmatch, string.match,
|
string.format, string.find, string.gmatch, string.match,
|
||||||
string.sub, string.split, string.upper, string.lower
|
string.sub, string.split, string.upper, string.lower
|
||||||
|
|
||||||
local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil
|
local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil
|
||||||
local pairs, next, type, tostring, io = pairs, next, type, tostring, io
|
local pairs, next, type, tostring, unpack, io = pairs, next, type, tostring, unpack, io
|
||||||
local vec_add, vec_mul = vector.add, vector.multiply
|
local vec_add, vec_mul = vector.add, vector.multiply
|
||||||
|
|
||||||
local FORMSPEC_MINIMAL_VERSION = 3
|
local FORMSPEC_MINIMAL_VERSION = 3
|
||||||
@ -301,8 +301,9 @@ function craftguide.register_craft(def)
|
|||||||
|
|
||||||
if true_str(def.url) then
|
if true_str(def.url) then
|
||||||
if not http then
|
if not http then
|
||||||
return err"No HTTP support for this mod. " ..
|
return err "craftguide.register_craft(): Unable to reach " ..
|
||||||
"Add it to the `secure.http_mods` or `secure.trusted_mods` setting."
|
def.url .. ". No HTTP support for this mod: " ..
|
||||||
|
"add it to the `secure.http_mods` or `secure.trusted_mods` setting."
|
||||||
end
|
end
|
||||||
|
|
||||||
http.fetch({url = def.url}, function(result)
|
http.fetch({url = def.url}, function(result)
|
||||||
@ -473,6 +474,7 @@ end
|
|||||||
|
|
||||||
local function item_in_recipe(item, recipe)
|
local function item_in_recipe(item, recipe)
|
||||||
local clean_item = reg_aliases[item] or item
|
local clean_item = reg_aliases[item] or item
|
||||||
|
|
||||||
for _, recipe_item in pairs(recipe.items) do
|
for _, recipe_item in pairs(recipe.items) do
|
||||||
local clean_recipe_item = reg_aliases[recipe_item] or recipe_item
|
local clean_recipe_item = reg_aliases[recipe_item] or recipe_item
|
||||||
if clean_recipe_item == clean_item then
|
if clean_recipe_item == clean_item then
|
||||||
@ -1825,11 +1827,7 @@ if progressive_mode then
|
|||||||
return filtered
|
return filtered
|
||||||
end
|
end
|
||||||
|
|
||||||
local item_lists = {
|
local item_lists = {"main", "craft", "craftpreview"}
|
||||||
"main",
|
|
||||||
"craft",
|
|
||||||
"craftpreview",
|
|
||||||
}
|
|
||||||
|
|
||||||
local function get_inv_items(player)
|
local function get_inv_items(player)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
|
Loading…
Reference in New Issue
Block a user