mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 04:23:44 +01:00
Sugar
This commit is contained in:
parent
0271f61fc2
commit
22a85f50c1
7
init.lua
7
init.lua
@ -258,6 +258,7 @@ end
|
|||||||
|
|
||||||
local function groups_item_in_recipe(item, recipe)
|
local function groups_item_in_recipe(item, recipe)
|
||||||
local item_groups = reg_items[item].groups
|
local item_groups = reg_items[item].groups
|
||||||
|
|
||||||
for _, recipe_item in pairs(recipe.items) do
|
for _, recipe_item in pairs(recipe.items) do
|
||||||
if sub(recipe_item, 1, 6) == "group:" then
|
if sub(recipe_item, 1, 6) == "group:" then
|
||||||
local groups = extract_groups(recipe_item)
|
local groups = extract_groups(recipe_item)
|
||||||
@ -478,6 +479,7 @@ local function get_recipe_fs(data, iY)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local groups
|
local groups
|
||||||
|
|
||||||
if sub(item, 1, 6) == "group:" then
|
if sub(item, 1, 6) == "group:" then
|
||||||
groups = extract_groups(item)
|
groups = extract_groups(item)
|
||||||
item = groups_to_item(groups)
|
item = groups_to_item(groups)
|
||||||
@ -1168,11 +1170,12 @@ M.register_chatcommand("craft", {
|
|||||||
local player = get_player_by_name(name)
|
local player = get_player_by_name(name)
|
||||||
local ppos = player:get_pos()
|
local ppos = player:get_pos()
|
||||||
local dir = player:get_look_dir()
|
local dir = player:get_look_dir()
|
||||||
local eye_h = {x = ppos.x, y = ppos.y + 1.625, z = ppos.z}
|
|
||||||
|
ppos.y = ppos.y + 1.625
|
||||||
local node_name
|
local node_name
|
||||||
|
|
||||||
for i = 1, 10 do
|
for i = 1, 10 do
|
||||||
local look_at = vec_add(eye_h, vec_mul(dir, i))
|
local look_at = vec_add(ppos, vec_mul(dir, i))
|
||||||
local node = M.get_node(look_at)
|
local node = M.get_node(look_at)
|
||||||
|
|
||||||
if node.name ~= "air" then
|
if node.name ~= "air" then
|
||||||
|
Loading…
Reference in New Issue
Block a user