1
0
Fork 0

Merge pull request 'New sunflower mesh (by JoseDouglas26)' (#4094) from sunflower_mesh_update into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4094
mobile_bow_workaround
the-real-herowl 2023-12-23 20:24:45 +00:00
commit 4bb46d7d30
3 changed files with 110 additions and 7 deletions

View File

@ -192,7 +192,7 @@ if has_mcl_flowerpots then
})
end
local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_img, selbox_radius, selbox_top_height, drop, shears_drop, is_flower, grass_color, fortune_drop)
local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_img, selbox_radius, selbox_top_height, drop, shears_drop, is_flower, grass_color, fortune_drop, mesh)
if not inv_img then
inv_img = top_img
end
@ -236,13 +236,26 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
drop_top = drop
drop_bottom = drop
end
-- Sunflower mesh and tiles
local top_drawtype, bottom_drawtype
local bottom_tiles = {}
if not mesh then
top_drawtype = "plantlike"
bottom_drawtype = "plantlike"
table.insert(bottom_tiles, bottom_img)
else
top_drawtype = "airlike"
bottom_drawtype = "mesh"
bottom_tiles = bottom_img
end
-- Bottom
minetest.register_node("mcl_flowers:"..name, {
description = desc,
_doc_items_create_entry = create_entry,
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = plant_usage_help,
drawtype = "plantlike",
tiles = { bottom_img },
drawtype = bottom_drawtype,
tiles = bottom_tiles,
inventory_image = inv_img,
wield_image = inv_img,
sunlight_propagates = true,
@ -334,6 +347,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
end,
groups = bottom_groups,
sounds = mcl_sounds.node_sound_leaves_defaults(),
mesh = mesh
})
local top_groups = table.copy(bottom_groups)
@ -345,7 +359,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
minetest.register_node("mcl_flowers:"..name.."_top", {
description = desc.." " .. S("(Top Part)"),
_doc_items_create_entry = false,
drawtype = "plantlike",
drawtype = top_drawtype,
tiles = { top_img },
sunlight_propagates = true,
paramtype = "light",
@ -382,9 +396,7 @@ end
add_large_plant("peony", S("Peony"), S("A peony is a large plant which occupies two blocks. It is mainly used in dye production."), "mcl_flowers_double_plant_paeonia_bottom.png", "mcl_flowers_double_plant_paeonia_top.png", nil, 5/16, 6/16)
add_large_plant("rose_bush", S("Rose Bush"), S("A rose bush is a large plant which occupies two blocks. It is safe to touch it. Rose bushes are mainly used in dye production."), "mcl_flowers_double_plant_rose_bottom.png", "mcl_flowers_double_plant_rose_top.png", nil, 5/16, 1/16)
add_large_plant("lilac", S("Lilac"), S("A lilac is a large plant which occupies two blocks. It is mainly used in dye production."), "mcl_flowers_double_plant_syringa_bottom.png", "mcl_flowers_double_plant_syringa_top.png", nil, 5/16, 6/16)
-- TODO: Make the sunflower face East. Requires a mesh for the top node.
add_large_plant("sunflower", S("Sunflower"), S("A sunflower is a large plant which occupies two blocks. It is mainly used in dye production."), "mcl_flowers_double_plant_sunflower_bottom.png", "mcl_flowers_double_plant_sunflower_top.png^mcl_flowers_double_plant_sunflower_front.png", "mcl_flowers_double_plant_sunflower_front.png", 6/16, 6/16)
add_large_plant("sunflower", S("Sunflower"), S("A sunflower is a large plant which occupies two blocks. It is mainly used in dye production."), {"mcl_flowers_double_plant_sunflower_bottom.png", "mcl_flowers_double_plant_sunflower_bottom.png", "mcl_flowers_double_plant_sunflower_front.png", "mcl_flowers_double_plant_sunflower_back.png"}, nil, "mcl_flowers_double_plant_sunflower_front.png", 6/16, 6/16, "mcl_flowers:sunflower", nil, true, nil, nil, "mcl_flowers_sunflower.obj")
local longdesc_grass = S("Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds.")
local longdesc_fern = S("Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds.")

View File

@ -0,0 +1,32 @@
# Blender 3.6.4 MTL File: 'sunflower.blend'
# www.blender.org
newmtl Flower_1
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd C:/Minetest-5.8/games/mineclone2/textures/mcl_flowers_double_plant_sunflower_front.png
newmtl Flower_2
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd C:/Minetest-5.8/games/mineclone2/textures/mcl_flowers_double_plant_sunflower_back.png
newmtl Stem
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd C:/Minetest-5.8/games/mineclone2/textures/mcl_flowers_double_plant_sunflower_bottom.png

View File

@ -0,0 +1,59 @@
# Blender 3.6.4
# www.blender.org
mtllib mcl_flowers_sunflower.mtl
o Stem_1
v 0.381859 1.050000 0.309359
v -0.236859 1.050000 -0.309359
v 0.381859 -0.500000 0.309359
v -0.236859 -0.500000 -0.309359
vn -0.7071 -0.0000 0.7071
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
s 0
g Stem_1_Stem
usemtl Stem
f 1/1/1 2/2/1 4/3/1 3/4/1
o Stem_2
v -0.236859 1.050000 0.309359
v 0.381859 1.050000 -0.309359
v -0.236859 -0.500000 0.309359
v 0.381859 -0.500000 -0.309359
vn -0.7071 -0.0000 -0.7071
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
s 0
g Stem_2_Stem
usemtl Stem
f 5/5/2 6/6/2 8/7/2 7/8/2
o Flower_1
v 0.247500 1.433013 -0.500000
v -0.252500 0.766987 -0.500000
v 0.247500 1.433013 0.500000
v -0.252500 0.766987 0.500000
vn -0.8660 0.5000 -0.0000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
s 0
g Flower_1_Flower_1
usemtl Flower_1
f 9/9/3 10/10/3 12/11/3 11/12/3
o Flower_2
v 0.252500 1.432013 -0.500000
v -0.247500 0.765988 -0.500000
v 0.252500 1.432013 0.500000
v -0.247500 0.765988 0.500000
vn -0.8660 0.5000 -0.0000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
s 0
g Flower_2_Flower_2
usemtl Flower_2
f 13/13/4 14/14/4 16/15/4 15/16/4