Reindent code

- Add load message into "action" log
This commit is contained in:
sys4-fr 2018-12-31 17:03:16 +01:00
parent a08d5f21a3
commit fdc371d8ea
1 changed files with 83 additions and 75 deletions

158
init.lua
View File

@ -9,25 +9,26 @@ local function add_simple_flower(name, desc, box, f_groups)
f_groups.flora = 1 f_groups.flora = 1
f_groups.attached_node = 1 f_groups.attached_node = 1
minetest.register_node("moreflowers:" .. name, { minetest.register_node(
description = desc, "moreflowers:" .. name, {
drawtype = "plantlike", description = desc,
waving = 1, drawtype = "plantlike",
tiles = {"moreflowers_"..name..".png"}, waving = 1,
inventory_image = "moreflowers_"..name..".png", tiles = {"moreflowers_"..name..".png"},
wield_image = "moreflowers_"..name..".png", inventory_image = "moreflowers_"..name..".png",
sunlight_propagates = true, wield_image = "moreflowers_"..name..".png",
paramtype = "light", sunlight_propagates = true,
walkable = false, paramtype = "light",
buildable_to = true, walkable = false,
stack_max = 99, buildable_to = true,
groups = f_groups, stack_max = 99,
sounds = default.node_sound_leaves_defaults(), groups = f_groups,
selection_box = { sounds = default.node_sound_leaves_defaults(),
type = "fixed", selection_box = {
fixed = box type = "fixed",
} fixed = box
}) }
})
end end
local function add_tall_flower(name, desc, box, f_groups) local function add_tall_flower(name, desc, box, f_groups)
@ -36,27 +37,28 @@ local function add_tall_flower(name, desc, box, f_groups)
f_groups.flora = 1 f_groups.flora = 1
f_groups.attached_node = 1 f_groups.attached_node = 1
minetest.register_node("moreflowers:" .. name, { minetest.register_node(
description = desc, "moreflowers:" .. name, {
drawtype = "plantlike", description = desc,
waving = 1, drawtype = "plantlike",
tiles = {"moreflowers_"..name..".png"}, waving = 1,
inventory_image = "moreflowers_"..name..".png", tiles = {"moreflowers_"..name..".png"},
wield_image = "moreflowers_"..name..".png", inventory_image = "moreflowers_"..name..".png",
sunlight_propagates = true, wield_image = "moreflowers_"..name..".png",
paramtype = "light", sunlight_propagates = true,
walkable = false, paramtype = "light",
buildable_to = true, walkable = false,
stack_max = 99, buildable_to = true,
visual_scale = 1.3, stack_max = 99,
wield_scale = {x=1, y=1.5, z=1}, visual_scale = 1.3,
groups = f_groups, wield_scale = {x=1, y=1.5, z=1},
sounds = default.node_sound_leaves_defaults(), groups = f_groups,
selection_box = { sounds = default.node_sound_leaves_defaults(),
type = "fixed", selection_box = {
fixed = box type = "fixed",
} fixed = box
}) }
})
end end
moreflowers.datas_simple = { moreflowers.datas_simple = {
@ -88,46 +90,50 @@ end
-- Bunch of flowers -- Bunch of flowers
if minetest.get_modpath("farming") then if minetest.get_modpath("farming") then
minetest.register_craftitem(
"moreflowers:bunch", {
description = "Bunch of flowers",
inventory_image = "moreflowers_bunch.png",
})
minetest.register_craftitem("moreflowers:bunch", { minetest.register_craft(
description = "Bunch of flowers", {
inventory_image = "moreflowers_bunch.png", output = "moreflowers:bunch",
}) recipe = {
{"group:flower", "group:flower", "group:flower"},
minetest.register_craft({ {"group:flower", "group:flower", "group:flower"},
output = "moreflowers:bunch", {"", "farming:cotton", ""},
recipe = { },
{"group:flower", "group:flower", "group:flower"}, })
{"group:flower", "group:flower", "group:flower"},
{"", "farming:cotton", ""},
},
})
if minetest.get_modpath("vessels") then if minetest.get_modpath("vessels") then
-- Bunch in a vase -- Bunch in a vase
minetest.register_node("moreflowers:bunch_vase", { minetest.register_node(
description = "Bunch in a vase", "moreflowers:bunch_vase", {
drawtype = "plantlike", description = "Bunch in a vase",
tiles = {"moreflowers_bunch_vase.png"}, drawtype = "plantlike",
inventory_image = "moreflowers_bunch_vase.png", tiles = {"moreflowers_bunch_vase.png"},
wield_image = "moreflowers_bunch_vase.png", inventory_image = "moreflowers_bunch_vase.png",
paramtype = "light", wield_image = "moreflowers_bunch_vase.png",
is_ground_content = false, paramtype = "light",
walkable = false, is_ground_content = false,
selection_box = { walkable = false,
type = "fixed", selection_box = {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} type = "fixed",
}, fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
groups = {dig_immediate = 3, attached_node = 1, falling_node = 1}, },
sounds = default.node_sound_glass_defaults(), groups = {dig_immediate = 3, attached_node = 1, falling_node = 1},
}) sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft({ minetest.register_craft(
output = "moreflowers:bunch_vase", {
type = "shapeless", output = "moreflowers:bunch_vase",
recipe = {"moreflowers:bunch", "group:vessel"}, type = "shapeless",
}) recipe = {"moreflowers:bunch", "group:vessel"},
})
end end
end end
@ -167,3 +173,5 @@ if minetest.get_modpath("bonemeal") and bonemeal then
bonemeal:add_deco(dirt_with_grass_deco) bonemeal:add_deco(dirt_with_grass_deco)
bonemeal:add_deco(dirt_with_dry_grass_deco) bonemeal:add_deco(dirt_with_dry_grass_deco)
end end
minetest.log("action", "[moreflowers] loaded.")